Changeset 8423 for code/trunk/src/libraries/core/Game.h
- Timestamp:
- May 9, 2011, 5:06:49 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Game.h
r8418 r8423 45 45 #include <vector> 46 46 #include <boost/shared_ptr.hpp> 47 #include <boost/scoped_ptr.hpp>48 47 #include <boost/preprocessor/cat.hpp> 49 #include <loki/ScopeGuard.h>50 48 51 49 #include "util/Debug.h" 50 #include "util/DestructionHelper.h" 52 51 #include "util/Singleton.h" 53 52 #include "OrxonoxClass.h" … … 56 55 @brief 57 56 Adds a new GameState to the Game. The second parameter is the name as string 58 and every following param ter is a constructor argument (which is usually non existent)57 and every following parameter is a constructor argument (which is usually non existent) 59 58 */ 60 59 #define DeclareGameState(className, stateName, bIgnoreTickTime, bGraphicsMode) \ … … 92 91 public: 93 92 Game(const std::string& cmdLine); 94 ~Game(); 93 94 //! Leave empty and use cleanup() instead 95 ~Game() {} 96 /// Destructor that also executes when object fails to construct 97 void destroy(); 95 98 96 99 void setConfigValues(); … … 138 141 { return shared_ptr<GameState>(new T(info)); } 139 142 }; 140 // For the factory destruction141 typedef Loki::ObjScopeGuardImpl0<std::map<std::string, shared_ptr<GameStateFactory> >, void (std::map<std::string, shared_ptr<GameStateFactory> >::*)()> ObjScopeGuard;142 143 143 144 struct StatisticsTickInfo … … 166 167 void resetChangingState() { this->bChangingState_ = false; } 167 168 168 scoped_ptr<Clock> gameClock_; 169 scoped_ptr<Core> core_; 170 ObjScopeGuard gsFactoryDestroyer_; 169 Clock* gameClock_; 170 Core* core_; 171 171 172 172 GameStateMap constructedStates_; … … 194 194 unsigned int fpsLimit_; 195 195 196 /// Helper object that executes the surrogate destructor destroy() 197 DestructionHelper<Game> destructionHelper_; 198 196 199 static std::map<std::string, GameStateInfo> gameStateDeclarations_s; 197 200 static Game* singletonPtr_s; //!< Pointer to the Singleton
Note: See TracChangeset
for help on using the changeset viewer.