Changeset 1940 for code/branches/objecthierarchy/src/orxonox
- Timestamp:
- Oct 18, 2008, 10:58:46 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox
- Files:
-
- 15 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/CMakeLists.txt
r1916 r1940 42 42 tools/WindowEventListener.cc 43 43 44 objects/worldentities/WorldEntity.cc 45 objects/worldentities/PositionableEntity.cc 44 46 # objects/Backlight.cc 45 47 objects/Camera.cc … … 50 52 objects/RadarViewable.cc 51 53 objects/Tickable.cc 54 55 objects/infos/Info.cc 56 objects/infos/LevelInfo.cc 57 objects/infos/PlayerInfo.cc 58 59 objects/gametypes/Gametype.cc 52 60 53 61 tolua/tolua_bind.cc -
code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h
r1916 r1940 81 81 82 82 // objects 83 class WorldEntity; 84 class PositionableEntity; 85 class MovableEntity; 86 class ControllableEntity; 87 83 88 class Backlight; 84 89 class Camera; 85 90 class ParticleSpawner; 91 92 class Info; 93 class LevelInfo; 94 class PlayerInfo; 95 96 class Gametype; 86 97 87 98 // tools -
code/branches/objecthierarchy/src/orxonox/Settings.cc
r1907 r1940 52 52 , bHasServer_(false) 53 53 , bIsClient_(false) 54 , bIsStandalone_(false) 55 , bIsMaster_(false) 54 56 { 55 57 RegisterRootObject(Settings); -
code/branches/objecthierarchy/src/orxonox/Settings.h
r1907 r1940 54 54 friend class GSClient; 55 55 friend class GSDedicated; 56 friend class GSStandalone; 56 57 57 58 public: … … 65 66 static bool hasServer() { assert(singletonRef_s); return singletonRef_s->bHasServer_; } 66 67 static bool isClient() { assert(singletonRef_s); return singletonRef_s->bIsClient_; } 68 static bool isStandalone() { assert(singletonRef_s); return singletonRef_s->bIsStandalone_; } 69 static bool isMaster() { assert(singletonRef_s); return singletonRef_s->bIsMaster_; } 67 70 68 71 private: 69 72 // GSRoot has access to these 70 static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; } 71 static void setHasServer (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_ = val; } 72 static void setIsClient (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_ = val; } 73 static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; singletonRef_s->updateIsMaster(); } 74 static void setHasServer (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_ = val; singletonRef_s->updateIsMaster(); } 75 static void setIsClient (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_ = val; singletonRef_s->updateIsMaster(); } 76 static void setIsStandalone (bool val) { assert(singletonRef_s); singletonRef_s->bIsStandalone_ = val; singletonRef_s->updateIsMaster(); } 77 static void updateIsMaster () { assert(singletonRef_s); singletonRef_s->bIsMaster_ = (singletonRef_s->bHasServer_ || singletonRef_s->bIsStandalone_); } 73 78 74 79 Settings(); … … 85 90 bool bHasServer_; //!< global variable that tells whether this is a server 86 91 bool bIsClient_; 92 bool bIsStandalone_; 93 bool bIsMaster_; 87 94 88 95 std::string dataPath_; //!< Path to the game data -
code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc
r1907 r1940 51 51 void GSClient::enter() 52 52 { 53 Settings::_getInstance(). bIsClient_ = true;53 Settings::_getInstance().setIsClient(true); 54 54 55 55 GSLevel::enter(); … … 81 81 GSLevel::leave(); 82 82 83 Settings::_getInstance(). bIsClient_ = false;83 Settings::_getInstance().setIsClient(false); 84 84 } 85 85 -
code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc
r1790 r1940 57 57 void GSDedicated::enter() 58 58 { 59 Settings::_getInstance(). bHasServer_ = true;59 Settings::_getInstance().setHasServer(true); 60 60 61 61 // create Ogre SceneManager for the level … … 97 97 Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_); 98 98 99 Settings::_getInstance(). bHasServer_ = false;99 Settings::_getInstance().setHasServer(false); 100 100 } 101 101 -
code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc
r1891 r1940 101 101 void GSGraphics::enter() 102 102 { 103 Settings::_getInstance(). bShowsGraphics_ = true;103 Settings::_getInstance().setShowsGraphics(true); 104 104 105 105 // initialise graphics engine. Doesn't load the render window yet! … … 196 196 delete graphicsEngine_; 197 197 198 Settings::_getInstance(). bShowsGraphics_ = false;198 Settings::_getInstance().setShowsGraphics(false); 199 199 } 200 200 … … 221 221 this->console_->tick(dt); 222 222 this->tickChild(time); 223 223 224 224 unsigned long long timeAfterTick = time.getRealMicroseconds(); 225 225 -
code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc
r1910 r1940 52 52 void GSServer::enter() 53 53 { 54 Settings::_getInstance(). bHasServer_ = true;54 Settings::_getInstance().setHasServer(true); 55 55 56 56 GSLevel::enter(); … … 85 85 86 86 GSLevel::leave(); 87 88 Settings::_getInstance(). bHasServer_ = false;87 88 Settings::_getInstance().setHasServer(false); 89 89 } 90 90 -
code/branches/objecthierarchy/src/orxonox/gamestates/GSStandalone.cc
r1755 r1940 32 32 #include "core/input/InputManager.h" 33 33 #include "core/ConsoleCommand.h" 34 #include "Settings.h" 34 35 35 36 namespace orxonox … … 57 58 // level is loaded: we can start capturing the input 58 59 InputManager::getInstance().requestEnterState("game"); 60 61 Settings::_getInstance().setIsStandalone(true); 59 62 } 60 63 … … 68 71 69 72 GSLevel::leave(); 73 74 Settings::_getInstance().setIsStandalone(false); 70 75 } 71 76
Note: See TracChangeset
for help on using the changeset viewer.