Changeset 3036 for code/trunk/src/core
- Timestamp:
- May 24, 2009, 2:39:16 AM (16 years ago)
- Location:
- code/trunk/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/CMakeLists.txt
r2896 r3036 67 67 68 68 GENERATE_SOURCE_GROUPS(${CORE_FILES}) 69 GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h )69 GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h Game.h) 70 70 71 71 ADD_LIBRARY(core SHARED ${CORE_FILES}) -
code/trunk/src/core/Game.cc
r2927 r3036 122 122 SetConfigValue(statisticsAvgLength_, 1000000) 123 123 .description("Sets the time in microseconds interval at which average fps, etc. gets calculated."); 124 SetConfigValue(levelName_, "presentation_dm.oxw") 125 .description("Sets the preselection of the level in the main menu."); 126 } 127 128 void Game::setLevel(std::string levelName) 129 { 130 ModifyConfigValue(levelName_, set, levelName); 131 } 132 133 const std::string& Game::getLevel() 134 { 135 std::string levelName; 136 CommandLine::getValue("level", &levelName); 137 if (levelName == "") 138 return levelName_; 139 else 140 return levelName; 124 141 } 125 142 -
code/trunk/src/core/Game.h
r2946 r3036 46 46 static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(name)) 47 47 48 // tolua_begin 48 49 namespace orxonox 49 50 { … … 52 53 Main class responsible for running the game. 53 54 */ 54 class _CoreExport Game : public OrxonoxClass 55 class _CoreExport Game 56 // tolua_end 57 : public OrxonoxClass 58 // tolua_begin 55 59 { 60 //tolua_end 56 61 public: 57 62 Game(int argc, char** argv); … … 78 83 static bool addGameState(GameState* state); 79 84 static void destroyStates(); 80 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 85 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } //tolua_export 86 87 void setLevel(std::string levelName); //tolua_export 88 const std::string& getLevel(); //tolua_export 81 89 82 90 private: … … 114 122 unsigned int statisticsRefreshCycle_; 115 123 unsigned int statisticsAvgLength_; 124 std::string levelName_; 116 125 117 126 static std::map<std::string, GameState*> allStates_s; 118 127 static Game* singletonRef_s; //!< Pointer to the Singleton 128 // tolua_begin 119 129 }; 120 130 } 121 131 //tolua_end 122 132 #endif /* _Game_H__ */
Note: See TracChangeset
for help on using the changeset viewer.