diff --git a/source/glest_game/CMakeLists.txt b/source/glest_game/CMakeLists.txt index 777bd63b..2f9e5048 100644 --- a/source/glest_game/CMakeLists.txt +++ b/source/glest_game/CMakeLists.txt @@ -97,6 +97,30 @@ ENDFOREACH(DIR) # [RCL] FIXME: make it compiler-agnostic SET(CMAKE_CXX_FLAGS "-O3 -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DSTREFLOP_SSE") +# The stuff below gets SVN Global Revision # but ONLY when calling cmake! +# the FindSubversion.cmake module is part of the standard distribution +include(FindSubversion) +# extract working copy information for SOURCE_DIR into MY_XXX variables +Subversion_WC_INFO(${PROJECT_SOURCE_DIR} MG) +#add_definitions(-DSVNVERSION="${MG_WC_REVISION}") +SET(SVN_VERSION_CMD -DSVNVERSION="${MG_WC_REVISION}") + +IF(UNIX AND NOT APPLE) + # We do some funky character escaping to get the right stuff written out to + # the final Makefile so we get the SVN Global Revsion # + SET(SVN_VERSION_CMD "-DSVNVERSION='\\\"`svnversion -n ${PROJECT_SOURCE_DIR}`\\\"'") +ENDIF() + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SVN_VERSION_CMD}") + +IF(UNIX AND NOT APPLE) + # We do some funky character escaping to get the right stuff written out to + # the final Makefile so we get the SVN Global Revsion # + string(REPLACE "'" "\"" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + +message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") + SET(TARGET_NAME "glest.bin") IF(UNIX AND NOT APPLE) diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index efb6fdf7..47e119f9 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -28,7 +28,11 @@ namespace Glest { namespace Game { const string mailString = "contact_game@glest.org"; const string glestVersionString = "v3.4.0-dev"; +#if defined(SVNVERSION) +const string SVN_Rev = string("Rev: ") + string(SVNVERSION); +#else const string SVN_Rev = "$Rev$"; +#endif string getCrashDumpFileName(){ return "glest" + glestVersionString + ".dmp"; diff --git a/source/glest_game/menu/menu_state_root.cpp b/source/glest_game/menu/menu_state_root.cpp index e81bf5c9..c3903f91 100644 --- a/source/glest_game/menu/menu_state_root.cpp +++ b/source/glest_game/menu/menu_state_root.cpp @@ -3,9 +3,9 @@ // // Copyright (C) 2001-2005 Marti�o Figueroa // -// You can redistribute this code and/or modify it under -// the terms of the GNU General Public License as published -// by the Free Software Foundation; either version 2 of the +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version // ============================================================== @@ -34,7 +34,7 @@ namespace Glest{ namespace Game{ // class MenuStateRoot // ===================================================== -MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu): +MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu): MenuState(program, mainMenu, "root") { containerName = "MainMenu"; @@ -59,15 +59,15 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu): buttonExit.registerGraphicComponent(containerName,"buttonExit"); buttonExit.init(425, i, 150); labelVersion.registerGraphicComponent(containerName,"labelVersion"); - labelVersion.init(435, 420); + labelVersion.init(405, 420); buttonNewGame.setText(lang.get("NewGame")); buttonJoinGame.setText(lang.get("JoinGame")); buttonMasterserverGame.setText(lang.get("JoinInternetGame")); buttonOptions.setText(lang.get("Options")); - buttonAbout.setText(lang.get("About")); + buttonAbout.setText(lang.get("About")); buttonExit.setText(lang.get("Exit")); - labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + "]"); + labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]"); //mesage box mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox"); @@ -85,7 +85,7 @@ void MenuStateRoot::mouseClick(int x, int y, MouseButton mouseButton){ if(buttonNewGame.mouseClick(x, y)){ soundRenderer.playFx(coreData.getClickSoundB()); mainMenu->setState(new MenuStateNewGame(program, mainMenu)); - } + } else if(buttonJoinGame.mouseClick(x, y)){ soundRenderer.playFx(coreData.getClickSoundB()); mainMenu->setState(new MenuStateJoinGame(program, mainMenu)); @@ -94,11 +94,11 @@ void MenuStateRoot::mouseClick(int x, int y, MouseButton mouseButton){ soundRenderer.playFx(coreData.getClickSoundB()); mainMenu->setState(new MenuStateMasterserver(program, mainMenu)); } - else if(buttonOptions.mouseClick(x, y)){ + else if(buttonOptions.mouseClick(x, y)){ soundRenderer.playFx(coreData.getClickSoundB()); mainMenu->setState(new MenuStateOptions(program, mainMenu)); } - else if(buttonAbout.mouseClick(x, y)){ + else if(buttonAbout.mouseClick(x, y)){ soundRenderer.playFx(coreData.getClickSoundB()); mainMenu->setState(new MenuStateAbout(program, mainMenu)); } @@ -129,7 +129,7 @@ void MenuStateRoot::mouseMove(int x, int y, const MouseState *ms){ buttonJoinGame.mouseMove(x, y); buttonMasterserverGame.mouseMove(x, y); buttonOptions.mouseMove(x, y); - buttonAbout.mouseMove(x, y); + buttonAbout.mouseMove(x, y); buttonExit.mouseMove(x,y); if (mainMessageBox.getEnabled()) { mainMessageBox.mouseMove(x, y); @@ -141,12 +141,12 @@ void MenuStateRoot::render() { Renderer &renderer= Renderer::getInstance(); CoreData &coreData= CoreData::getInstance(); const Metrics &metrics= Metrics::getInstance(); - + int w= 300; int h= 150; renderer.renderTextureQuad( - (metrics.getVirtualW()-w)/2, 475-h/2, w, h, + (metrics.getVirtualW()-w)/2, 475-h/2, w, h, coreData.getLogoTexture(), GraphicComponent::getFade()); int maxLogoWidth=0;