Changeset 10624 for code/trunk/src/orxonox
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 4 deleted
- 74 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/CMakeLists.txt
r10216 r10624 29 29 Main.cc 30 30 MoodManager.cc 31 PawnManager.cc32 31 PlayerManager.cc 33 ShipPartManager.cc34 32 Radar.cc 35 33 # Test.cc -
code/trunk/src/orxonox/CameraManager.cc
r9667 r10624 35 35 #include <OgreCompositorManager.h> 36 36 37 #include "util/ScopedSingletonManager.h"38 37 #include "core/GameMode.h" 39 38 #include "core/GraphicsManager.h" 40 39 #include "core/object/ObjectList.h" 40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "tools/Shader.h" 42 42 #include "graphics/Camera.h" … … 44 44 namespace orxonox 45 45 { 46 ManageScopedSingleton(CameraManager, ScopeID::G raphics, false);46 ManageScopedSingleton(CameraManager, ScopeID::GRAPHICS, false); 47 47 48 48 CameraManager::CameraManager() -
code/trunk/src/orxonox/Level.cc
r9667 r10624 35 35 #include "core/XMLFile.h" 36 36 #include "core/XMLPort.h" 37 #include "core/module/PluginReference.h" 37 38 38 39 #include "infos/PlayerInfo.h" … … 49 50 RegisterObject(Level); 50 51 52 this->setLevel(WeakPtr<Level>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency) 51 53 52 54 this->registerVariables(); … … 63 65 64 66 if (this->xmlfile_) 65 Loader::unload(this->xmlfile_); 67 Loader::getInstance().unload(this->xmlfile_); 68 69 this->unloadPlugins(); 66 70 } 67 71 } … … 71 75 SUPER(Level, XMLPort, xmlelement, mode); 72 76 77 XMLPortParam(Level, "plugins", setPluginsString, getPluginsString, xmlelement, mode); 73 78 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 74 79 … … 95 100 this->xmlfile_ = new XMLFile(mask, this->xmlfilename_); 96 101 97 Loader:: open(this->xmlfile_);102 Loader::getInstance().load(this->xmlfile_); 98 103 } 99 104 … … 105 110 Template::getTemplate(*it)->applyOn(this); 106 111 } 112 } 113 114 void Level::setPluginsString(const std::string& pluginsString) 115 { 116 // unload old plugins 117 this->unloadPlugins(); 118 119 // load new plugins 120 this->pluginsString_ = pluginsString; 121 SubString tokens(pluginsString, ","); 122 for (size_t i = 0; i < tokens.size(); ++i) 123 this->plugins_.push_back(new PluginReference(tokens[i])); 124 } 125 126 void Level::unloadPlugins() 127 { 128 // use destroyLater() - this ensures that plugins are not unloaded too early. 129 // Note: When a level gets unloaded, the Level object is usually the last object that gets destroyed. This is because all other 130 // objects inside a level have a StrongPtr (in BaseObject) that references the Level object. This means that the Level 131 // object is only destroyed, when all StrongPtrs that pointed to it were destroyed. But at the time when the last StrongPtr 132 // is destroyed, the other object is not yet fully destroyed because the StrongPtr is destroyed in ~BaseObject (and this 133 // means that e.g. ~Identifiable was not yet called for this object). This means that technically there are still other 134 // objects alive when ~Level is called. This is the reason why we cannot directly destroy() the Plugins - instead we need 135 // to call destroyLater() to ensure that no instances from this plugin exist anymore. 136 for (std::list<PluginReference*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it) 137 (*it)->destroyLater(); 138 this->plugins_.clear(); 107 139 } 108 140 … … 121 153 122 154 Gametype* rootgametype = orxonox_cast<Gametype*>(identifier->fabricate(this)); 123 this->setGametype(rootgametype); 124 125 for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it) 126 (*it)->setGametype(rootgametype); 155 156 // store a weak-pointer to the gametype to avoid a circular dependency between this level and the gametype (which has a strong-reference on this level) 157 this->setGametype(WeakPtr<Gametype>(rootgametype)); 158 159 rootgametype->init(); // call init() AFTER the gametype was set 127 160 128 161 if (LevelManager::exists()) … … 134 167 { 135 168 this->objects_.push_back(object); 136 object->setGametype(this->getGametype());137 object->setLevel(this);138 169 } 139 170 … … 170 201 { 171 202 orxout(internal_info) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl; 172 player->s etGametype(this->getGametype());203 player->switchGametype(this->getGametype()); 173 204 } 174 205 … … 176 207 { 177 208 orxout(internal_info) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ')' << endl; 178 player->s etGametype(0);209 player->switchGametype(0); 179 210 } 180 211 } -
code/trunk/src/orxonox/Level.h
r9667 r10624 65 65 // MeshLodInformation* getLodInfo(unsigned int index) const; 66 66 67 void setPluginsString(const std::string& pluginsString); 68 inline const std::string& getPluginsString() const 69 { return this->pluginsString_; } 70 71 void unloadPlugins(); 72 67 73 void setGametypeString(const std::string& gametype); 68 74 inline const std::string& getGametypeString() const … … 70 76 71 77 void networkcallback_applyXMLFile(); 78 79 std::string pluginsString_; 80 std::list<PluginReference*> plugins_; 72 81 73 82 std::string gametype_; -
code/trunk/src/orxonox/LevelManager.cc
r10258 r10624 36 36 #include <map> 37 37 38 #include " util/ScopedSingletonManager.h"39 #include "core/co nfig/CommandLineParser.h"38 #include "core/singleton/ScopedSingletonIncludes.h" 39 #include "core/commandline/CommandLineIncludes.h" 40 40 #include "core/config/ConfigValueIncludes.h" 41 41 #include "core/CoreIncludes.h" … … 51 51 SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)"); 52 52 53 ManageScopedSingleton(LevelManager, ScopeID::Root, false); 53 ManageScopedSingleton(LevelManager, ScopeID::ROOT, false); 54 55 RegisterAbstractClass(LevelManager).inheritsFrom<Configurable>(); 54 56 55 57 /** … … 274 276 // Load the LevelInfo object from the level file. 275 277 XMLFile file = XMLFile(*it); 276 Loader:: load(&file, mask, false, true);278 Loader::getInstance().load(&file, mask, false, true); 277 279 278 280 // Find the LevelInfo object we've just loaded (if there was one) … … 282 284 283 285 // We don't need the loaded stuff anymore 284 Loader:: unload(&file);286 Loader::getInstance().unload(&file); 285 287 286 288 if(info == NULL) -
code/trunk/src/orxonox/Main.cc
r9667 r10624 36 36 #include "Main.h" 37 37 38 #include "core/co nfig/CommandLineParser.h"38 #include "core/commandline/CommandLineIncludes.h" 39 39 #include "core/Game.h" 40 40 #include "core/LuaState.h" -
code/trunk/src/orxonox/MoodManager.cc
r9667 r10624 29 29 #include "MoodManager.h" 30 30 31 #include " util/ScopedSingletonManager.h"31 #include "core/singleton/ScopedSingletonIncludes.h" 32 32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "core/CoreIncludes.h" … … 36 36 namespace orxonox 37 37 { 38 ManageScopedSingleton(MoodManager, ScopeID::R oot, false);38 ManageScopedSingleton(MoodManager, ScopeID::ROOT, false); 39 39 40 40 // Note: I'm (Kevin Young) not entirely sure whether that's good code style: 41 41 const std::string MoodManager::defaultMood_ = "default"; 42 43 RegisterAbstractClass(MoodListener).inheritsFrom<OrxonoxInterface>(); 44 RegisterAbstractClass(MoodManager).inheritsFrom<Configurable>(); 42 45 43 46 MoodManager::MoodManager() -
code/trunk/src/orxonox/OrxonoxPrereqs.h
r10281 r10624 73 73 class LevelInfoItem; 74 74 class LevelManager; 75 class PawnManager;76 75 class PlayerManager; 77 76 class Radar; -
code/trunk/src/orxonox/PlayerManager.cc
r9667 r10624 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/GameMode.h" 33 #include " util/ScopedSingletonManager.h"33 #include "core/singleton/ScopedSingletonIncludes.h" 34 34 35 35 #include "Level.h" … … 39 39 namespace orxonox 40 40 { 41 ManageScopedSingleton(PlayerManager, ScopeID::Root, false); 41 ManageScopedSingleton(PlayerManager, ScopeID::ROOT, false); 42 43 RegisterAbstractClass(PlayerManager).inheritsFrom<ClientConnectionListener>(); 42 44 43 45 PlayerManager::PlayerManager() -
code/trunk/src/orxonox/Radar.cc
r9667 r10624 37 37 38 38 //#include "util/Math.h" 39 #include "core/CoreIncludes.h" 39 40 #include "core/object/ObjectList.h" 40 41 #include "core/command/ConsoleCommand.h" … … 45 46 namespace orxonox 46 47 { 48 RegisterAbstractClass(Radar).inheritsFrom<Tickable>(); 47 49 48 50 Radar::Radar() -
code/trunk/src/orxonox/Scene.cc
r10316 r10624 44 44 #include "core/GUIManager.h" 45 45 #include "core/XMLPort.h" 46 #include "core/command/ConsoleCommand .h"46 #include "core/command/ConsoleCommandIncludes.h" 47 47 #include "tools/BulletConversions.h" 48 48 #include "tools/BulletDebugDrawer.h" … … 62 62 RegisterObject(Scene); 63 63 64 this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN); 64 this->setScene(WeakPtr<Scene>(this), this->getObjectID()); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency) 65 65 66 this->bShadows_ = true; 66 67 this->bDebugDrawPhysics_ = false; 67 68 this->debugDrawer_ = NULL; 68 69 this->soundReferenceDistance_ = 20.0; 70 this->bIsUpdatingPhysics_ = false; 69 71 70 72 if (GameMode::showsGraphics()) … … 141 143 registerVariable(this->bHasPhysics_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics)); 142 144 registerVariable(this->bShadows_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows)); 143 registerVariable(this->getLevel(), VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::changedLevel));144 145 } 145 146 … … 266 267 // Note: 60 means that Bullet will do physics correctly down to 1 frames per seconds. 267 268 // Under that mark, the simulation will "loose time" and get unusable. 268 physicalWorld_->stepSimulation(dt, 60); 269 this->bIsUpdatingPhysics_ = true; 270 this->physicalWorld_->stepSimulation(dt, 60); 271 this->bIsUpdatingPhysics_ = false; 269 272 270 273 if (this->bDebugDrawPhysics_) 271 physicalWorld_->debugDrawWorld();274 this->physicalWorld_->debugDrawWorld(); 272 275 } 273 276 } … … 313 316 { 314 317 this->objects_.push_back(object); 315 object->setScene(this, this->getObjectID());316 318 } 317 319 … … 363 365 { 364 366 // get the WorldEntity pointers 365 S martPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());366 S martPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());367 StrongPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer()); 368 StrongPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer()); 367 369 368 370 // get the CollisionShape pointers -
code/trunk/src/orxonox/Scene.h
r10196 r10624 110 110 111 111 public: 112 inline bool hasPhysics() 112 inline bool hasPhysics() const 113 113 { return this->physicalWorld_ != 0; } 114 114 void setPhysicalWorld(bool wantsPhysics); … … 128 128 void addPhysicalObject(WorldEntity* object); 129 129 void removePhysicalObject(WorldEntity* object); 130 131 inline bool isUpdatingPhysics() const 132 { return this->bIsUpdatingPhysics_; } 130 133 131 134 void setDebugDrawPhysics(bool bDraw, bool bFill, float fillAlpha); … … 163 166 BulletDebugDrawer* debugDrawer_; 164 167 bool bDebugDrawPhysics_; 168 bool bIsUpdatingPhysics_; 165 169 }; 166 170 } -
code/trunk/src/orxonox/Test.cc
r9667 r10624 29 29 #include "core/CoreIncludes.h" 30 30 #include "core/config/ConfigValueIncludes.h" 31 #include "core/command/ConsoleCommand .h"32 #include "network/NetworkFunction .h"31 #include "core/command/ConsoleCommandIncludes.h" 32 #include "network/NetworkFunctionIncludes.h" 33 33 #include "Test.h" 34 34 #include "util/MultiType.h" … … 105 105 void Test::call(unsigned int clientID) 106 106 { 107 callStaticNetworkFunction( 108 callStaticNetworkFunction( 107 callStaticNetworkFunction(&Test::printV1, clientID ); 108 callStaticNetworkFunction(&Test::printV1, clientID ); 109 109 } 110 110 111 111 void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4) 112 112 { 113 callMemberNetworkFunction( Test,printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );113 callMemberNetworkFunction( &Test::printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 ); 114 114 } 115 115 … … 130 130 // if(!Core::isMaster()) 131 131 // call2(0, "bal", "a", "n", "ce"); 132 // callMemberNetworkFunction( Test,checkU1, this->getObjectID(), 0 );132 // callMemberNetworkFunction( &Test::checkU1, this->getObjectID(), 0 ); 133 133 } 134 134 -
code/trunk/src/orxonox/chat/ChatHistory.cc
r9667 r10624 28 28 29 29 #include "ChatHistory.h" 30 #include "util/ScopedSingletonManager.h" 30 #include "core/singleton/ScopedSingletonIncludes.h" 31 #include "core/ConfigurablePaths.h" 31 32 32 33 #ifndef CHATTEST … … 34 35 { 35 36 /* singleton */ 36 ManageScopedSingleton( ChatHistory, ScopeID::Root, false ); 37 ManageScopedSingleton( ChatHistory, ScopeID::ROOT, false ); 38 39 RegisterAbstractClass(ChatHistory).inheritsFrom<ChatListener>(); 40 37 41 #endif 38 42 … … 118 122 */ 119 123 #ifndef CHATTEST 120 this->hist_logfile.open( ( PathConfig::getInstance().getLogPathString() +124 this->hist_logfile.open( (ConfigurablePaths::getLogPathString() + 121 125 "chatlog.log").c_str(), 122 126 std::fstream::out | std::fstream::app ); -
code/trunk/src/orxonox/chat/ChatHistory.h
r8858 r10624 41 41 #include "util/Singleton.h" 42 42 #include "core/BaseObject.h" 43 #include "core/PathConfig.h"44 43 #include "chat/ChatListener.h" 45 44 #include "infos/PlayerInfo.h" -
code/trunk/src/orxonox/chat/ChatInputHandler.cc
r9675 r10624 47 47 #endif 48 48 49 #include " util/ScopedSingletonManager.h"49 #include "core/singleton/ScopedSingletonIncludes.h" 50 50 #include "core/CoreIncludes.h" 51 51 #include "core/GUIManager.h" 52 #include "core/command/ConsoleCommand .h"52 #include "core/command/ConsoleCommandIncludes.h" 53 53 #include "core/input/InputBuffer.h" 54 54 #include "core/input/InputManager.h" … … 62 62 { 63 63 /* singleton */ 64 ManageScopedSingleton( ChatInputHandler, ScopeID::G raphics, false );64 ManageScopedSingleton( ChatInputHandler, ScopeID::GRAPHICS, false ); 65 65 66 66 /* add commands to console */ 67 67 SetConsoleCommand( "startchat", &ChatInputHandler::activate_static ); 68 68 SetConsoleCommand( "startchat_small", &ChatInputHandler::activate_small_static ); 69 70 RegisterAbstractClass(ChatInputHandler).inheritsFrom<ChatListener>(); 69 71 70 72 /* constructor */ -
code/trunk/src/orxonox/chat/ChatManager.cc
r9667 r10624 30 30 #include "ChatListener.h" 31 31 32 #include "util/ScopedSingletonManager.h"33 32 #include "core/CoreIncludes.h" 34 #include "core/command/ConsoleCommand.h" 33 #include "core/singleton/ScopedSingletonIncludes.h" 34 #include "core/command/ConsoleCommandIncludes.h" 35 35 #include "network/Host.h" 36 36 … … 40 40 namespace orxonox 41 41 { 42 ManageScopedSingleton(ChatManager, ScopeID::R oot, false);42 ManageScopedSingleton(ChatManager, ScopeID::ROOT, false); 43 43 44 44 SetConsoleCommand("chat", &ChatManager::chat).defaultValue(1, NETWORK_PEER_ID_BROADCAST); 45 46 RegisterAbstractClass(ChatManager).inheritsFrom<NetworkChatListener>(); 45 47 46 48 ChatManager::ChatManager() … … 113 115 // ChatListener // 114 116 ////////////////////////////////////////////////////////////////////////// 115 RegisterAbstractClass(ChatListener).inheritsFrom (Class(Listable));117 RegisterAbstractClass(ChatListener).inheritsFrom<Listable>(); 116 118 117 119 ChatListener::ChatListener() -
code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
r10216 r10624 41 41 #include "CompoundCollisionShape.h" 42 42 #include "WorldEntityCollisionShape.h" 43 #include "Scene.h" 43 44 44 45 namespace orxonox 45 46 { 46 RegisterAbstractClass(CollisionShape).inheritsFrom (Class(BaseObject)).inheritsFrom(Class(Synchronisable));47 RegisterAbstractClass(CollisionShape).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>(); 47 48 48 49 /** … … 74 75 { 75 76 // Detach from parent CompoundCollisionShape. 76 if (this->isInitialized() && this->parent_) 77 this->parent_->detach(this); 77 if (this->isInitialized()) 78 { 79 if (this->getScene() && this->getScene()->isUpdatingPhysics()) 80 orxout(internal_error) << "Don't destroy collision shapes while the physics is updated! This will lead to crashes. Try to use destroyLater() instead" << endl; 81 82 if (this->parent_) 83 this->parent_->detach(this); 84 85 if (this->collisionShape_) 86 delete this->collisionShape_; 87 } 78 88 } 79 89 -
code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r9667 r10624 71 71 it->first->notifyDetached(); 72 72 it->first->destroy(); 73 if (this->collisionShape_ == it->second) 74 this->collisionShape_ = NULL; // don't destroy it twice 73 75 } 74 76 75 77 delete this->compoundShape_; 78 if (this->collisionShape_ == this->compoundShape_) 79 this->collisionShape_ = NULL; // don't destroy it twice 76 80 } 77 81 } -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
r9667 r10624 37 37 namespace orxonox 38 38 { 39 RegisterClass(WorldEntityCollisionShape); 40 39 41 WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context) 40 42 { … … 44 46 // suppress synchronisation 45 47 this->setSyncMode(ObjectDirection::None); 46 }47 48 WorldEntityCollisionShape::~WorldEntityCollisionShape()49 {50 // Called always by WE destructor51 48 } 52 49 -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h
r9667 r10624 39 39 public: 40 40 WorldEntityCollisionShape(Context* context); 41 virtual ~WorldEntityCollisionShape();42 41 43 42 inline void setWorldEntityOwner(WorldEntity* worldEntityOwner) -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r10294 r10624 30 30 #include "core/CoreIncludes.h" 31 31 #include "core/XMLPort.h" 32 #include "core/command/ConsoleCommand .h"32 #include "core/command/ConsoleCommandIncludes.h" 33 33 #include "worldentities/pawns/Pawn.h" 34 34 #include "worldentities/pawns/SpaceShip.h" -
code/trunk/src/orxonox/controllers/FormationController.cc
r10622 r10624 33 33 34 34 #include "core/XMLPort.h" 35 #include "core/command/ConsoleCommand .h"35 #include "core/command/ConsoleCommandIncludes.h" 36 36 37 37 #include "worldentities/ControllableEntity.h" -
code/trunk/src/orxonox/controllers/HumanController.cc
r9979 r10624 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/command/ConsoleCommand .h"32 #include "core/command/ConsoleCommandIncludes.h" 33 33 #include "worldentities/ControllableEntity.h" 34 34 #include "worldentities/pawns/Pawn.h" … … 59 59 SetConsoleCommand("HumanController", __CC_suicide_name, &HumanController::suicide ).addShortcut(); 60 60 SetConsoleCommand("HumanController", "toggleGodMode", &HumanController::toggleGodMode ).addShortcut(); 61 SetConsoleCommand("HumanController", "addBots", &HumanController::addBots ).addShortcut().defaultValues(1);62 SetConsoleCommand("HumanController", "killBots", &HumanController::killBots ).addShortcut().defaultValues(0);63 61 SetConsoleCommand("HumanController", "cycleNavigationFocus", &HumanController::cycleNavigationFocus).addShortcut(); 64 62 SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut(); … … 318 316 } 319 317 320 void HumanController::addBots(unsigned int amount)321 {322 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())323 HumanController::localController_s->controllableEntity_->getGametype()->addBots(amount);324 }325 326 void HumanController::killBots(unsigned int amount)327 {328 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())329 HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount);330 }331 332 318 Pawn* HumanController::getLocalControllerEntityAsPawn() 333 319 { -
code/trunk/src/orxonox/controllers/HumanController.h
r9979 r10624 83 83 static void FFChangeMode(); 84 84 85 static void addBots(unsigned int amount);86 static void killBots(unsigned int amount = 0);87 88 85 static void pauseControl(); // tolua_export 89 86 static void resumeControl(); // tolua_export -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r10216 r10624 37 37 38 38 #include "core/CoreIncludes.h" 39 #include "core/command/ConsoleCommand .h"39 #include "core/command/ConsoleCommandIncludes.h" 40 40 #include "core/input/KeyBinder.h" 41 41 #include "core/input/KeyBinderManager.h" -
code/trunk/src/orxonox/gamestates/GSClient.cc
r9667 r10624 30 30 31 31 #include "util/Exception.h" 32 #include "core/co nfig/CommandLineParser.h"32 #include "core/commandline/CommandLineIncludes.h" 33 33 #include "core/Game.h" 34 34 #include "core/GameMode.h" -
code/trunk/src/orxonox/gamestates/GSLevel.cc
r10299 r10624 44 44 #include "core/Loader.h" 45 45 #include "core/XMLFile.h" 46 #include "core/command/ConsoleCommand .h"46 #include "core/command/ConsoleCommandIncludes.h" 47 47 48 48 #include "LevelManager.h" 49 #include "Level.h" 49 50 #include "PlayerManager.h" 50 51 #include "GSRoot.h" … … 95 96 } 96 97 98 this->prepareObjectTracking(); 99 97 100 if (GameMode::isMaster()) 98 101 { … … 128 131 if (GameMode::isMaster()) 129 132 this->unloadLevel(); 133 else 134 this->unloadLevelAsClient(); 135 136 this->performObjectTracking(); 130 137 131 138 if (GameMode::showsGraphics()) … … 161 168 } 162 169 163 void GSLevel:: loadLevel()170 void GSLevel::prepareObjectTracking() 164 171 { 165 172 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it) 166 173 this->staticObjects_.insert(*it); 167 168 // call the loader 169 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 170 bool loaded = Loader::open(startFile_); 171 172 Core::getInstance().updateLastLevelTimestamp(); 173 if(!loaded) 174 GSRoot::delayedStartMainMenu(); 175 } 176 177 void GSLevel::unloadLevel() 178 { 179 Loader::unload(startFile_); 180 delete startFile_; 181 174 } 175 176 void GSLevel::performObjectTracking() 177 { 182 178 orxout(internal_info) << "Remaining objects:" << endl; 183 179 unsigned int i = 0; … … 187 183 if (find == this->staticObjects_.end()) 188 184 { 189 orxout(internal_ info) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;185 orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl; 190 186 } 191 187 } … … 194 190 else 195 191 orxout(internal_warning) << i << " objects remaining. Try harder!" << endl; 192 } 193 194 void GSLevel::loadLevel() 195 { 196 // call the loader 197 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 198 bool loaded = Loader::getInstance().load(startFile_); 199 200 Core::getInstance().getConfig()->updateLastLevelTimestamp(); 201 if(!loaded) 202 GSRoot::delayedStartMainMenu(); 203 } 204 205 void GSLevel::unloadLevel() 206 { 207 Loader::getInstance().unload(startFile_); 208 delete startFile_; 209 } 210 211 /** 212 * Unloads a level when the game instance is (or was) a client in a multiplayer session. 213 * In this case, cleanup after unloading a level is done differently because certain things (e.g. the xml file) are unknown. 214 */ 215 void GSLevel::unloadLevelAsClient() 216 { 217 for (ObjectList<Level>::iterator it = ObjectList<Level>::begin(); it != ObjectList<Level>::end(); ) 218 { 219 StrongPtr<Level> level = *(it++); // StrongPtr prevents that the Level gets destroyed while we loop over it 220 for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(level); it != ObjectList<BaseObject>::end(level); ) 221 (it++)->destroy(); 222 } 223 224 for (ObjectList<Synchronisable>::iterator it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ) 225 { 226 if (it->getSyncMode() != 0x0) 227 (it++)->destroy(); 228 else 229 ++it; 230 } 196 231 } 197 232 … … 252 287 /////////////////////////////////////////////////////////////////////////// 253 288 254 RegisterAbstractClass(GSLevelMemento).inheritsFrom (Class(OrxonoxInterface));289 RegisterAbstractClass(GSLevelMemento).inheritsFrom<OrxonoxInterface>(); 255 290 256 291 GSLevelMemento::GSLevelMemento() -
code/trunk/src/orxonox/gamestates/GSLevel.h
r10281 r10624 53 53 void reloadLevel(); 54 54 55 pr otected:55 private: 56 56 void loadLevel(); 57 57 void unloadLevel(); 58 void unloadLevelAsClient(); 59 60 void prepareObjectTracking(); 61 void performObjectTracking(); 58 62 59 63 InputState* gameInputState_; //!< input state for normal ingame playing -
code/trunk/src/orxonox/gamestates/GSMainMenu.cc
r9944 r10624 36 36 #include "core/GraphicsManager.h" 37 37 #include "core/GUIManager.h" 38 #include "core/command/ConsoleCommand .h"38 #include "core/command/ConsoleCommandIncludes.h" 39 39 #include "core/input/KeyBinderManager.h" 40 40 #include "network/Client.h" … … 63 63 SetConsoleCommand(__CC_setMainMenuSoundPath_name, &GSMainMenu::setMainMenuSoundPath).hide(); 64 64 65 RegisterAbstractClass(GSMainMenu).inheritsFrom<Configurable>(); 66 65 67 GSMainMenu::GSMainMenu(const GameStateInfo& info) 66 68 : GameState(info) -
code/trunk/src/orxonox/gamestates/GSRoot.cc
r9348 r10624 33 33 #include "core/Game.h" 34 34 #include "core/GameMode.h" 35 #include "core/command/ConsoleCommand .h"36 #include "network/NetworkFunction .h"35 #include "core/command/ConsoleCommandIncludes.h" 36 #include "network/NetworkFunctionIncludes.h" 37 37 #include "tools/Timer.h" 38 38 #include "tools/interfaces/Tickable.h" … … 68 68 GSRoot::~GSRoot() 69 69 { 70 NetworkFunctionBase::destroyAllNetworkFunctions();71 70 } 72 71 -
code/trunk/src/orxonox/gamestates/GSServer.cc
r10197 r10624 30 30 31 31 #include "util/Output.h" 32 #include "core/co nfig/CommandLineParser.h"32 #include "core/commandline/CommandLineIncludes.h" 33 33 #include "core/Game.h" 34 34 #include "core/GameMode.h" -
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
r9945 r10624 310 310 if (spaceship) 311 311 { 312 WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);313 if(ptr == NULL)314 return;315 312 spaceship->addSpeedFactor(5); 316 313 ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this)); 317 executor->setDefaultValue(0, ptr);314 executor->setDefaultValue(0, spaceship); 318 315 new Timer(10, false, executor, true); 319 316 } … … 593 590 } 594 591 595 void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function 596 { 597 if (*ptr) 598 { 599 (*ptr)->addSpeedFactor(1.0f/5.0f); 600 } 601 delete ptr; 592 void Dynamicmatch::resetSpeedFactor(SpaceShip* spaceship)// helper function 593 { 594 if (spaceship) 595 { 596 spaceship->addSpeedFactor(1.0f/5.0f); 597 } 602 598 } 603 599 -
code/trunk/src/orxonox/gametypes/Dynamicmatch.h
r9676 r10624 77 77 virtual void rewardPig(); 78 78 void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost. 79 void resetSpeedFactor( WeakPtr<SpaceShip>* ptr);79 void resetSpeedFactor(SpaceShip* spaceship); 80 80 void tick (float dt);// used to end the game 81 81 SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const; -
code/trunk/src/orxonox/gametypes/Gametype.cc
r10281 r10624 34 34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/GameMode.h" 36 #include "core/command/ConsoleCommand .h"36 #include "core/command/ConsoleCommandIncludes.h" 37 37 #include "gamestates/GSLevel.h" 38 38 … … 49 49 namespace orxonox 50 50 { 51 static const std::string __CC_addBots_name = "addBots"; 52 static const std::string __CC_killBots_name = "killBots"; 53 54 SetConsoleCommand("Gametype", __CC_addBots_name, &Gametype::addBots ).addShortcut().defaultValues(1); 55 SetConsoleCommand("Gametype", __CC_killBots_name, &Gametype::killBots).addShortcut().defaultValues(0); 56 51 57 RegisterUnloadableClass(Gametype); 52 58 … … 55 61 RegisterObject(Gametype); 56 62 63 this->setGametype(WeakPtr<Gametype>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency) 64 57 65 this->gtinfo_ = new GametypeInfo(context); 58 66 59 this->setGametype(SmartPtr<Gametype>(this, false));60 61 67 this->defaultControllableEntity_ = Class(Spectator); 68 this->scoreboard_ = 0; 62 69 63 70 this->bAutoStart_ = false; … … 74 81 this->setConfigValues(); 75 82 83 ModifyConsoleCommand(__CC_addBots_name).setObject(this); 84 ModifyConsoleCommand(__CC_killBots_name).setObject(this); 85 } 86 87 Gametype::~Gametype() 88 { 89 if (this->isInitialized()) 90 { 91 if (this->gtinfo_) 92 this->gtinfo_->destroy(); 93 94 ModifyConsoleCommand(__CC_addBots_name).setObject(NULL); 95 ModifyConsoleCommand(__CC_killBots_name).setObject(NULL); 96 } 97 } 98 99 /** 100 * @brief Initializes sub-objects of the Gametype. This must be called after the constructor. 101 * At this point, the context is expected to have the current gametype. This allows to pass the current gametype to the sub-objects via constructor. 102 */ 103 void Gametype::init() 104 { 76 105 // load the corresponding score board 77 106 if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty()) 78 107 { 79 this->scoreboard_ = new OverlayGroup( context);108 this->scoreboard_ = new OverlayGroup(this->getContext()); 80 109 this->scoreboard_->addTemplate(this->scoreboardTemplate_); 81 this->scoreboard_->setGametype(this);82 }83 else84 this->scoreboard_ = 0;85 86 /* HACK HACK HACK */87 this->dedicatedAddBots_ = createConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) );88 this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );89 /* HACK HACK HACK */90 }91 92 Gametype::~Gametype()93 {94 if (this->isInitialized())95 {96 this->gtinfo_->destroy();97 if( this->dedicatedAddBots_ )98 delete this->dedicatedAddBots_;99 if( this->dedicatedKillBots_ )100 delete this->dedicatedKillBots_;101 110 } 102 111 } … … 406 415 { 407 416 // If in developer's mode, there is no start countdown. 408 if(Core::getInstance(). inDevMode())417 if(Core::getInstance().getConfig()->inDevMode()) 409 418 this->start(); 410 419 else -
code/trunk/src/orxonox/gametypes/Gametype.h
r10281 r10624 72 72 virtual ~Gametype(); 73 73 74 virtual void init(); 75 74 76 void setConfigValues(); 75 77 … … 176 178 virtual void importMementoState(const std::vector<GSLevelMementoState*>& states); 177 179 178 SmartPtr<GametypeInfo> gtinfo_;180 WeakPtr<GametypeInfo> gtinfo_; 179 181 180 182 bool bAutoStart_; … … 199 201 std::string scoreboardTemplate_; 200 202 201 /* HACK HACK HACK */202 ConsoleCommand* dedicatedAddBots_;203 ConsoleCommand* dedicatedKillBots_;204 /* HACK HACK HACK */205 203 Timer showMenuTimer_; 206 204 }; -
code/trunk/src/orxonox/gametypes/Mission.cc
r10258 r10624 33 33 34 34 #include "core/CoreIncludes.h" 35 #include "core/command/ConsoleCommand .h"35 #include "core/command/ConsoleCommandIncludes.h" 36 36 #include "infos/PlayerInfo.h" 37 37 #include "network/Host.h" -
code/trunk/src/orxonox/infos/GametypeInfo.cc
r9667 r10624 37 37 #include "core/GameMode.h" 38 38 #include "network/Host.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 #include "util/Convert.h" 41 41 … … 369 369 this->changedReadyToSpawn(ready); 370 370 else 371 callMemberNetworkFunction( GametypeInfo,changedReadyToSpawn, this->getObjectID(), player->getClientID(), ready);371 callMemberNetworkFunction(&GametypeInfo::changedReadyToSpawn, this->getObjectID(), player->getClientID(), ready); 372 372 } 373 373 } … … 388 388 this->changedSpawned(spawned); 389 389 else 390 callMemberNetworkFunction( GametypeInfo,changedSpawned, this->getObjectID(), player->getClientID(), spawned);390 callMemberNetworkFunction(&GametypeInfo::changedSpawned, this->getObjectID(), player->getClientID(), spawned); 391 391 } 392 392 } … … 399 399 if (GameMode::isMaster()) 400 400 { 401 callMemberNetworkFunction( GametypeInfo,dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message);401 callMemberNetworkFunction(&GametypeInfo::dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message); 402 402 this->dispatchAnnounceMessage(message); 403 403 } … … 411 411 this->dispatchAnnounceMessage(message); 412 412 else 413 callMemberNetworkFunction( GametypeInfo,dispatchAnnounceMessage, this->getObjectID(), clientID, message);413 callMemberNetworkFunction(&GametypeInfo::dispatchAnnounceMessage, this->getObjectID(), clientID, message); 414 414 } 415 415 } … … 422 422 this->dispatchKillMessage(message); 423 423 else 424 callMemberNetworkFunction( GametypeInfo,dispatchKillMessage, this->getObjectID(), clientID, message);424 callMemberNetworkFunction(&GametypeInfo::dispatchKillMessage, this->getObjectID(), clientID, message); 425 425 } 426 426 } … … 433 433 this->dispatchDeathMessage(message); 434 434 else 435 callMemberNetworkFunction( GametypeInfo,dispatchDeathMessage, this->getObjectID(), clientID, message);435 callMemberNetworkFunction(&GametypeInfo::dispatchDeathMessage, this->getObjectID(), clientID, message); 436 436 } 437 437 } … … 444 444 this->dispatchStaticMessage(message, colour); 445 445 else 446 callMemberNetworkFunction( GametypeInfo,dispatchStaticMessage, this->getObjectID(), clientID, message, colour);446 callMemberNetworkFunction(&GametypeInfo::dispatchStaticMessage, this->getObjectID(), clientID, message, colour); 447 447 } 448 448 } … … 455 455 this->dispatchFadingMessage(message); 456 456 else 457 callMemberNetworkFunction( GametypeInfo,dispatchFadingMessage, this->getObjectID(), clientID, message);457 callMemberNetworkFunction(&GametypeInfo::dispatchFadingMessage, this->getObjectID(), clientID, message); 458 458 } 459 459 } -
code/trunk/src/orxonox/infos/HumanPlayer.cc
r9667 r10624 160 160 } 161 161 162 void HumanPlayer:: changedGametype()163 { 164 PlayerInfo:: changedGametype();162 void HumanPlayer::switchGametype(Gametype* gametype) 163 { 164 PlayerInfo::switchGametype(gametype); 165 165 166 166 if (this->isInitialized() && this->isLocalPlayer()) -
code/trunk/src/orxonox/infos/HumanPlayer.h
r9667 r10624 51 51 void setClientID(unsigned int clientID); 52 52 53 virtual void changedGametype();53 virtual void switchGametype(Gametype* gametype); 54 54 55 55 inline void setHumanHUDTemplate(const std::string& name) -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r9945 r10624 40 40 namespace orxonox 41 41 { 42 RegisterAbstractClass(PlayerInfo).inheritsFrom (Class(Info));42 RegisterAbstractClass(PlayerInfo).inheritsFrom<Info>(); 43 43 44 44 PlayerInfo::PlayerInfo(Context* context) : Info(context) … … 57 57 this->gtinfo_ = 0; 58 58 this->gtinfoID_ = OBJECTID_UNKNOWN; 59 this->updateGametypeInfo( );59 this->updateGametypeInfo(this->getGametype()); 60 60 61 61 this->registerVariables(); … … 95 95 } 96 96 97 void PlayerInfo::changedGametype() 98 { 99 this->updateGametypeInfo(); 97 void PlayerInfo::switchGametype(Gametype* gametype) 98 { 99 Gametype* oldGametype = this->getGametype(); 100 this->setGametype(StrongPtr<Gametype>(gametype)); 101 Gametype* newGametype = this->getGametype(); 102 103 104 this->updateGametypeInfo(newGametype); 100 105 101 106 if (this->isInitialized()) 102 107 { 103 if ( this->getOldGametype())108 if (oldGametype) 104 109 { 105 if ( this->getGametype())106 this->getOldGametype()->playerSwitched(this, this->getGametype());110 if (newGametype) 111 oldGametype->playerSwitched(this, newGametype); 107 112 else 108 this->getOldGametype()->playerLeft(this);113 oldGametype->playerLeft(this); 109 114 } 110 115 111 if ( this->getGametype())116 if (newGametype) 112 117 { 113 if ( this->getOldGametype())114 this->getGametype()->playerSwitchedBack(this, this->getOldGametype());118 if (oldGametype) 119 newGametype->playerSwitchedBack(this, oldGametype); 115 120 else 116 this->getGametype()->playerEntered(this);121 newGametype->playerEntered(this); 117 122 } 118 123 } 119 124 } 120 125 121 void PlayerInfo::updateGametypeInfo( )126 void PlayerInfo::updateGametypeInfo(Gametype* gametype) 122 127 { 123 128 this->gtinfo_ = 0; 124 129 this->gtinfoID_ = OBJECTID_UNKNOWN; 125 130 126 if ( this->getGametype() && this->getGametype()->getGametypeInfo())127 { 128 this->gtinfo_ = this->getGametype()->getGametypeInfo();131 if (gametype && gametype->getGametypeInfo()) 132 { 133 this->gtinfo_ = gametype->getGametypeInfo(); 129 134 this->gtinfoID_ = this->gtinfo_->getObjectID(); 130 135 } … … 186 191 187 192 this->controllableEntity_->destroyHud(); // HACK-ish 188 this->previousControllableEntity_.push_back( WeakPtr<ControllableEntity>(this->controllableEntity_));193 this->previousControllableEntity_.push_back(this->controllableEntity_); 189 194 this->controllableEntity_ = entity; 190 195 this->controllableEntityID_ = entity->getObjectID(); -
code/trunk/src/orxonox/infos/PlayerInfo.h
r9667 r10624 45 45 46 46 virtual void changedName(); 47 virtual void changedGametype();47 virtual void switchGametype(Gametype* gametype); 48 48 49 49 virtual void changedController() {} … … 94 94 void networkcallback_changedcontrollableentityID(); 95 95 void networkcallback_changedgtinfoID(); 96 void updateGametypeInfo( );96 void updateGametypeInfo(Gametype* gametype); 97 97 98 98 bool bReadyToSpawn_; -
code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
r9667 r10624 50 50 // GametypeMessageListener 51 51 //---------------------------- 52 RegisterAbstractClass(GametypeMessageListener).inheritsFrom (Class(OrxonoxInterface));52 RegisterAbstractClass(GametypeMessageListener).inheritsFrom<OrxonoxInterface>(); 53 53 54 54 GametypeMessageListener::GametypeMessageListener() … … 60 60 // PlayerTrigger 61 61 //---------------------------- 62 RegisterAbstractClass(PlayerTrigger).inheritsFrom (Class(OrxonoxInterface));62 RegisterAbstractClass(PlayerTrigger).inheritsFrom<OrxonoxInterface>(); 63 63 64 64 PlayerTrigger::PlayerTrigger() … … 72 72 { 73 73 assert(pawn); 74 this->pawn_ = WeakPtr<Pawn>(pawn);74 this->pawn_ = pawn; 75 75 if (pawn) 76 this->player_ = WeakPtr<PlayerInfo>(pawn->getPlayer());76 this->player_ = pawn->getPlayer(); 77 77 } 78 78 … … 80 80 // RadarListener 81 81 //---------------------------- 82 RegisterAbstractClass(RadarListener).inheritsFrom (Class(OrxonoxInterface));82 RegisterAbstractClass(RadarListener).inheritsFrom<OrxonoxInterface>(); 83 83 84 84 RadarListener::RadarListener() … … 90 90 // TeamColourable 91 91 //---------------------------- 92 RegisterAbstractClass(TeamColourable).inheritsFrom (Class(OrxonoxInterface));92 RegisterAbstractClass(TeamColourable).inheritsFrom<OrxonoxInterface>(); 93 93 94 94 TeamColourable::TeamColourable() … … 100 100 // Rewardable 101 101 //---------------------------- 102 RegisterAbstractClass(Rewardable).inheritsFrom (Class(OrxonoxInterface));102 RegisterAbstractClass(Rewardable).inheritsFrom<OrxonoxInterface>(); 103 103 104 104 Rewardable::Rewardable() -
code/trunk/src/orxonox/interfaces/NotificationListener.cc
r9667 r10624 34 34 #include "core/CoreIncludes.h" 35 35 #include "network/Host.h" 36 #include "network/NetworkFunction .h"36 #include "network/NetworkFunctionIncludes.h" 37 37 #include "util/SubString.h" 38 38 … … 51 51 registerStaticNetworkFunction(NotificationListener::sendHelper); 52 52 53 RegisterAbstractClass(NotificationListener).inheritsFrom<OrxonoxInterface>(); 54 53 55 NotificationListener::NotificationListener() 54 56 { … … 82 84 else if(GameMode::isServer() && sendMode == notificationSendMode::network && Host::getPlayerID() != clientId) 83 85 { 84 callStaticNetworkFunction( NotificationListener::sendHelper, clientId, message, sender, isCommand, (unsigned int)messageType);86 callStaticNetworkFunction(&NotificationListener::sendHelper, clientId, message, sender, isCommand, (unsigned int)messageType); 85 87 } 86 88 else if(GameMode::isServer() && sendMode == notificationSendMode::broadcast) 87 89 { 88 90 // TODO: Works as intended? 89 callStaticNetworkFunction( NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, (unsigned int)messageType);91 callStaticNetworkFunction(&NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, (unsigned int)messageType); 90 92 } 91 93 } -
code/trunk/src/orxonox/interfaces/PickupCarrier.cc
r9667 r10624 41 41 namespace orxonox 42 42 { 43 RegisterAbstractClass(PickupCarrier).inheritsFrom (Class(OrxonoxInterface));43 RegisterAbstractClass(PickupCarrier).inheritsFrom<OrxonoxInterface>(); 44 44 45 45 /** -
code/trunk/src/orxonox/interfaces/PickupListener.cc
r9667 r10624 40 40 namespace orxonox 41 41 { 42 RegisterAbstractClass(PickupListener).inheritsFrom<OrxonoxInterface>(); 42 43 43 44 /** -
code/trunk/src/orxonox/interfaces/Pickupable.cc
r9667 r10624 46 46 namespace orxonox 47 47 { 48 RegisterAbstractClass(Pickupable).inheritsFrom (Class(OrxonoxInterface)).inheritsFrom(Class(Rewardable));48 RegisterAbstractClass(Pickupable).inheritsFrom<OrxonoxInterface>().inheritsFrom<Rewardable>(); 49 49 50 50 /** -
code/trunk/src/orxonox/interfaces/Pickupable.h
r9667 r10624 187 187 188 188 //! SUPER functions. 189 SUPER_FUNCTION( 10, Pickupable, changedUsed, false);190 SUPER_FUNCTION(1 1, Pickupable, changedCarrier, false);191 SUPER_FUNCTION(1 2, Pickupable, changedPickedUp, false);189 SUPER_FUNCTION(9, Pickupable, changedUsed, false); 190 SUPER_FUNCTION(10, Pickupable, changedCarrier, false); 191 SUPER_FUNCTION(11, Pickupable, changedPickedUp, false); 192 192 } 193 193 -
code/trunk/src/orxonox/interfaces/PlayerTrigger.h
r9667 r10624 63 63 */ 64 64 inline Pawn* getTriggeringPawn(void) const 65 { return this->pawn_ .get(); }65 { return this->pawn_; } 66 66 67 67 /** -
code/trunk/src/orxonox/interfaces/RadarViewable.cc
r9667 r10624 38 38 namespace orxonox 39 39 { 40 RegisterAbstractClass(RadarViewable).inheritsFrom (Class(OrxonoxInterface));40 RegisterAbstractClass(RadarViewable).inheritsFrom<OrxonoxInterface>(); 41 41 42 42 /** -
code/trunk/src/orxonox/interfaces/RadarViewable.h
r9939 r10624 37 37 #include "util/Math.h" 38 38 #include "core/class/OrxonoxInterface.h" 39 #include "core/object/S martPtr.h"39 #include "core/object/StrongPtr.h" 40 40 41 41 namespace orxonox … … 163 163 //Radar 164 164 const WorldEntity* wePtr_; 165 S martPtr<Radar> radar_;165 StrongPtr<Radar> radar_; 166 166 float radarObjectCamouflage_; 167 167 Shape radarObjectShape_; -
code/trunk/src/orxonox/items/ShipPart.cc
r10262 r10624 50 50 51 51 ShipPart::ShipPart(Context* context) 52 : Item(context) 52 : Item(context), parent_(NULL) 53 53 { 54 54 RegisterObject(ShipPart); 55 this->setAlive(true); 56 this->setEventExecution(true); 55 this->eventExecution_ = true; 57 56 this->healthMem_ = 100; 58 57 } … … 60 59 ShipPart::~ShipPart() 61 60 { 62 61 if (this->parent_) 62 { 63 // Remove this ShipPart from the parent. 64 this->parent_->removeShipPart(this); 65 } 63 66 } 64 67 … … 86 89 void ShipPart::death() 87 90 { 88 //if (!(this->isAlive()))89 //return;90 91 91 this->explode(); 92 this->setAlive(false);93 92 94 93 if(eventExecution_) … … 101 100 } 102 101 103 // Remove this ShipPart from the parent. 104 this->parent_->removeShipPart(this); 105 delete this; 102 this->destroyLater(); 106 103 } 107 104 … … 203 200 { 204 201 this->health_ = health; 205 }206 207 void ShipPart::setAlive(bool var)208 {209 this->alive_ = var;210 orxout() << "ShipPart " << this->getName() << " alive_: " << this->alive_ << endl;211 202 } 212 203 … … 240 231 } 241 232 if (this->health_ < 0) 242 this->alive_ = false; 243 //this->death(); 233 this->death(); 244 234 245 235 // (Ugly) Chatoutput of health, until a GUI for modularspaceships-shipparts is implemented. -
code/trunk/src/orxonox/items/ShipPart.h
r10262 r10624 72 72 { return this->parent_; } 73 73 74 void setAlive(bool var);75 inline bool isAlive()76 { return this->alive_; }77 78 74 inline void setEventExecution(bool var) 79 75 { this->eventExecution_ = var; } … … 121 117 std::vector<PartDestructionEvent*> eventList_; // The list of all PartDestructionEvent assigned to this ShipPart. 122 118 123 bool alive_;124 119 bool eventExecution_; 125 120 -
code/trunk/src/orxonox/overlays/InGameConsole.cc
r9667 r10624 45 45 #include "util/Math.h" 46 46 #include "util/DisplayStringConversions.h" 47 #include "util/ScopedSingletonManager.h"48 47 #include "util/output/MemoryWriter.h" 49 48 #include "util/output/OutputManager.h" 50 49 #include "core/CoreIncludes.h" 51 50 #include "core/config/ConfigValueIncludes.h" 52 #include "core/command/ConsoleCommand.h" 51 #include "core/command/ConsoleCommandIncludes.h" 52 #include "core/singleton/ScopedSingletonIncludes.h" 53 53 #include "core/GUIManager.h" 54 54 #include "core/input/InputManager.h" … … 65 65 SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole); 66 66 67 ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false); 67 ManageScopedSingleton(InGameConsole, ScopeID::GRAPHICS, false); 68 69 RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>().inheritsFrom<UpdateListener>(); 68 70 69 71 /** -
code/trunk/src/orxonox/overlays/InGameConsole.h
r8858 r10624 39 39 #include "core/WindowEventListener.h" 40 40 #include "core/command/Shell.h" 41 #include "core/UpdateListener.h" 41 42 42 43 namespace orxonox 43 44 { 44 class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener 45 class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener, public UpdateListener 45 46 { 46 47 friend class Singleton<InGameConsole>; … … 53 54 54 55 void preUpdate(const Clock& time); 56 void postUpdate(const Clock& time) { /*no action*/ } 55 57 56 58 static void openConsole(); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r9667 r10624 48 48 #include "core/CoreIncludes.h" 49 49 #include "core/XMLPort.h" 50 #include "core/command/ConsoleCommand .h"50 #include "core/command/ConsoleCommandIncludes.h" 51 51 52 52 #include "OverlayGroup.h" -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r9667 r10624 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "core/command/ConsoleCommand .h"38 #include "core/command/ConsoleCommandIncludes.h" 39 39 #include "OrxonoxOverlay.h" 40 #include "gametypes/Gametype.h" 40 41 41 42 namespace orxonox … … 61 62 OverlayGroup::~OverlayGroup() 62 63 { 63 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)64 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 64 65 (*it)->destroy(); 65 66 this->hudElements_.clear(); … … 85 86 void OverlayGroup::setScale(const Vector2& scale) 86 87 { 87 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)88 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 88 89 (*it)->scale(scale / this->scale_); 89 90 this->scale_ = scale; … … 93 94 void OverlayGroup::setScroll(const Vector2& scroll) 94 95 { 95 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)96 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 96 97 (*it)->scroll(scroll - this->scroll_); 97 98 this->scroll_ = scroll; … … 106 107 void OverlayGroup::addElement(OrxonoxOverlay* element) 107 108 { 108 hudElements_.insert( SmartPtr<OrxonoxOverlay>(element));109 hudElements_.insert(element); 109 110 element->setOverlayGroup( this ); 110 111 if (this->owner_) … … 122 123 bool OverlayGroup::removeElement(OrxonoxOverlay* element) 123 124 { 124 if(this->hudElements_.erase( SmartPtr<OrxonoxOverlay>(element)) == 0)125 if(this->hudElements_.erase(element) == 0) 125 126 return false; 126 127 return true; … … 132 133 if (index < this->hudElements_.size()) 133 134 { 134 std::set< S martPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();135 std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin(); 135 136 for (unsigned int i = 0; i != index; ++it, ++i) 136 137 ; 137 return it->get();138 return *it; 138 139 } 139 140 else … … 146 147 SUPER( OverlayGroup, changedVisibility ); 147 148 148 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)149 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 149 150 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 150 151 } 151 152 152 //! Changes the gametype of all elements153 void OverlayGroup::changedGametype()154 {155 SUPER( OverlayGroup, changedGametype );156 157 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)158 (*it)->setGametype(this->getGametype());159 }160 161 153 void OverlayGroup::setOwner(BaseObject* owner) 162 154 { 163 155 this->owner_ = owner; 164 156 165 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)157 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 166 158 (*it)->setOwner(owner); 167 159 } -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r9667 r10624 65 65 static void scrollGroup(const std::string& name, const Vector2& scroll); 66 66 67 inline const std::set< S martPtr<OrxonoxOverlay> >& getOverlays() const67 inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const 68 68 { return this->hudElements_; } 69 69 70 70 virtual void changedVisibility(); 71 virtual void changedGametype();72 71 73 72 void setOwner(BaseObject* owner); … … 92 91 93 92 private: 94 std::set< S martPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group.93 std::set< StrongPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 95 94 Vector2 scale_; //!< Current scale (independent of the elements). 96 95 Vector2 scroll_; //!< Current scrolling offset. -
code/trunk/src/orxonox/sound/AmbientSound.cc
r9939 r10624 36 36 namespace orxonox 37 37 { 38 RegisterAbstractClass(AmbientSound).inheritsFrom<BaseSound>().inheritsFrom<MoodListener>(); 39 38 40 AmbientSound::AmbientSound() 39 41 : bPlayOnLoad_(false) … … 49 51 if (GameMode::playsSound()) 50 52 { 51 // Smoothly fade out by keeping a S martPtr53 // Smoothly fade out by keeping a StrongPtr 52 54 SoundManager::getInstance().unregisterAmbientSound(this); 53 55 } -
code/trunk/src/orxonox/sound/BaseSound.cc
r9939 r10624 43 43 namespace orxonox 44 44 { 45 RegisterAbstractClass(BaseSound).inheritsFrom (Class(Listable));45 RegisterAbstractClass(BaseSound).inheritsFrom<Listable>(); 46 46 47 47 BaseSound::BaseSound() -
code/trunk/src/orxonox/sound/SoundBuffer.h
r6764 r10624 46 46 friend class SoundManager; 47 47 #if !defined(_MSC_VER) || _MSC_VER >= 1500 48 // Make sure nobody deletes an instance (using s martpointers)48 // Make sure nobody deletes an instance (using strong pointers) 49 49 template <class T> 50 50 friend void boost::checked_delete(T*); -
code/trunk/src/orxonox/sound/SoundManager.cc
r9939 r10624 38 38 #include "util/Math.h" 39 39 #include "util/Clock.h" 40 #include " util/ScopedSingletonManager.h"40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "core/config/ConfigValueIncludes.h" 42 42 #include "core/CoreIncludes.h" … … 50 50 namespace orxonox 51 51 { 52 ManageScopedSingleton(SoundManager, ScopeID::G raphics, true);52 ManageScopedSingleton(SoundManager, ScopeID::GRAPHICS, true); 53 53 54 54 std::string SoundManager::getALErrorString(ALenum code) … … 65 65 } 66 66 } 67 68 RegisterAbstractClass(SoundManager).inheritsFrom<Configurable>().inheritsFrom<UpdateListener>(); 67 69 68 70 SoundManager::SoundManager() … … 163 165 SoundManager::~SoundManager() 164 166 { 165 // Erase fade lists because of the s martpointers167 // Erase fade lists because of the strong pointers 166 168 this->bDestructorCalled_ = true; 167 169 this->fadeInList_.clear(); … … 417 419 } 418 420 419 void SoundManager::fadeIn( const SmartPtr<AmbientSound>&sound)421 void SoundManager::fadeIn(AmbientSound* sound) 420 422 { 421 423 // If we're already fading out --> remove that 422 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)424 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++) 423 425 { 424 426 if (*it == sound) … … 433 435 } 434 436 435 void SoundManager::fadeOut( const SmartPtr<AmbientSound>&sound)437 void SoundManager::fadeOut(AmbientSound* sound) 436 438 { 437 439 // If we're already fading in --> remove that 438 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)440 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++) 439 441 { 440 442 if (*it == sound) … … 459 461 460 462 // FADE IN 461 for (std::list<S martPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )463 for (std::list<StrongPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); ) 462 464 { 463 465 if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f) … … 474 476 475 477 // FADE OUT 476 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )478 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); ) 477 479 { 478 480 if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f) -
code/trunk/src/orxonox/sound/SoundManager.h
r9667 r10624 40 40 #include "util/Singleton.h" 41 41 #include "core/config/Configurable.h" 42 #include "core/object/SmartPtr.h" 42 #include "core/object/StrongPtr.h" 43 #include "core/UpdateListener.h" 43 44 44 45 // tolua_begin … … 59 60 class _OrxonoxExport SoundManager 60 61 // tolua_end 61 : public Singleton<SoundManager>, public Configurable 62 : public Singleton<SoundManager>, public Configurable, public UpdateListener 62 63 { // tolua_export 63 64 friend class Singleton<SoundManager>; … … 68 69 69 70 void preUpdate(const Clock& time); 71 void postUpdate(const Clock& time) { /*no action*/ } 70 72 void setConfigValues(); 71 73 … … 104 106 private: 105 107 void processCrossFading(float dt); 106 void fadeIn( const SmartPtr<AmbientSound>&sound);107 void fadeOut( const SmartPtr<AmbientSound>&sound);108 void fadeIn(AmbientSound* sound); 109 void fadeOut(AmbientSound* sound); 108 110 109 111 void checkFadeStepValidity(); … … 127 129 //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading 128 130 float crossFadeStep_; 129 std::list<S martPtr<AmbientSound> > fadeInList_;130 std::list<S martPtr<AmbientSound> > fadeOutList_;131 std::list<StrongPtr<AmbientSound> > fadeInList_; 132 std::list<StrongPtr<AmbientSound> > fadeOutList_; 131 133 132 134 // Volume related -
code/trunk/src/orxonox/sound/WorldAmbientSound.cc
r9945 r10624 33 33 #include "core/XMLPort.h" 34 34 #include "AmbientSound.h" 35 #include "core/command/ConsoleCommand .h"35 #include "core/command/ConsoleCommandIncludes.h" 36 36 #include <exception> 37 37 -
code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
r9939 r10624 45 45 namespace orxonox 46 46 { 47 RegisterAbstractClass(WeaponMode).inheritsFrom (Class(BaseObject));47 RegisterAbstractClass(WeaponMode).inheritsFrom<BaseObject>(); 48 48 49 49 WeaponMode::WeaponMode(Context* context) : BaseObject(context) -
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r9799 r10624 36 36 #include "core/GameMode.h" 37 37 #include "core/XMLPort.h" 38 #include "network/NetworkFunction .h"38 #include "network/NetworkFunctionIncludes.h" 39 39 40 40 #include "Scene.h" … … 108 108 this->camera_->destroy(); 109 109 110 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)110 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 111 111 (*it)->destroy(); 112 112 … … 165 165 { 166 166 unsigned int i = 0; 167 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)167 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 168 168 { 169 169 if (i == index) … … 180 180 181 181 unsigned int counter = 0; 182 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)182 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 183 183 { 184 184 if ((*it) == this->currentCameraPosition_) … … 215 215 { 216 216 this->cameraPositions_.front()->attachCamera(this->camera_); 217 this->currentCameraPosition_ = this->cameraPositions_.front() .get();217 this->currentCameraPosition_ = this->cameraPositions_.front(); 218 218 } 219 219 else if (this->cameraPositions_.size() > 0) 220 220 { 221 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)221 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 222 222 { 223 223 if ((*it) == this->camera_->getParent()) … … 307 307 else 308 308 { 309 callMemberNetworkFunction( ControllableEntity,fire, this->getObjectID(), 0, firemode);309 callMemberNetworkFunction(&ControllableEntity::fire, this->getObjectID(), 0, firemode); 310 310 } 311 311 } … … 323 323 if ( target != 0 ) 324 324 { 325 callMemberNetworkFunction( ControllableEntity,setTargetInternal, this->getObjectID(), 0, target->getObjectID() );325 callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, target->getObjectID() ); 326 326 } 327 327 else 328 328 { 329 callMemberNetworkFunction( ControllableEntity,setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN );329 callMemberNetworkFunction(&ControllableEntity::setTargetInternal, this->getObjectID(), 0, OBJECTID_UNKNOWN ); 330 330 } 331 331 } … … 477 477 if (parent) 478 478 { 479 for (std::list<S martPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)479 for (std::list<StrongPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 480 480 if ((*it)->getIsAbsolute()) 481 481 parent->attach((*it)); -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r10437 r10624 121 121 void addCameraPosition(CameraPosition* position); 122 122 CameraPosition* getCameraPosition(unsigned int index) const; 123 inline const std::list<S martPtr<CameraPosition> >& getCameraPositions() const123 inline const std::list<StrongPtr<CameraPosition> >& getCameraPositions() const 124 124 { return this->cameraPositions_; } 125 125 unsigned int getCurrentCameraIndex() const; … … 162 162 163 163 inline Controller* getController() const 164 { return this->controller_ .get(); }164 { return this->controller_; } 165 165 void setController(Controller* val); 166 166 … … 168 168 virtual void setTarget( WorldEntity* target ); 169 169 virtual WorldEntity* getTarget() 170 { return this->target_ .get(); }170 { return this->target_; } 171 171 void setTargetInternal( uint32_t targetID ); 172 172 … … 242 242 bool bMouseLook_; 243 243 float mouseLookSpeed_; 244 std::list<S martPtr<CameraPosition> > cameraPositions_;244 std::list<StrongPtr<CameraPosition> > cameraPositions_; 245 245 CameraPosition* currentCameraPosition_; 246 246 std::string cameraPositionTemplate_; -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r10288 r10624 61 61 BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD == (int)WorldEntity::World); 62 62 63 RegisterAbstractClass(WorldEntity).inheritsFrom (Class(BaseObject)).inheritsFrom(Class(Synchronisable));63 RegisterAbstractClass(WorldEntity).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>(); 64 64 65 65 /** … … 130 130 WorldEntity* entity = *it; 131 131 132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to s martpointers pointing to it132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to strong pointers pointing to it 133 133 entity->setPosition(entity->getWorldPosition()); 134 134 this->detach(entity); // detach also erases the element from the children set -
code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
r9667 r10624 40 40 RegisterObject(Destroyer); 41 41 42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype() .get());42 UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype()); 43 43 if (gametype) 44 44 { -
code/trunk/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10270 r10624 37 37 #include "util/Math.h" 38 38 #include "gametypes/Gametype.h" 39 #include "core/command/ConsoleCommand .h"39 #include "core/command/ConsoleCommandIncludes.h" 40 40 41 41 #include "items/ShipPart.h" … … 69 69 if (this->isInitialized()) 70 70 { 71 71 while (!this->partList_.empty()) 72 this->partList_[0]->destroy(); 72 73 } 73 74 } … … 177 178 if (it->second->getName() == name) 178 179 { 179 it->second-> setAlive(false);180 it->second->death(); 180 181 return; 181 182 } … … 196 197 if (it->second->getName() == name) 197 198 { 198 it->second-> setAlive(false);199 it->second->death(); 199 200 return; 200 201 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r10622 r10624 326 326 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 327 327 { 328 // Set bAlive_ to false and wait for PawnManagerto do the destruction328 // Set bAlive_ to false and wait for destroyLater() to do the destruction 329 329 this->bAlive_ = false; 330 this->destroyLater(); 330 331 331 332 this->setDestroyWhenPlayerLeft(false); -
code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
r9667 r10624 34 34 #include "core/GameMode.h" 35 35 #include "core/command/CommandExecutor.h" 36 #include "core/command/ConsoleCommand .h"36 #include "core/command/ConsoleCommandIncludes.h" 37 37 38 38 #include "tools/BillboardSet.h" -
code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
r9667 r10624 45 45 this->state_ = BaseState::Uncontrolled; 46 46 47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype() .get());47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype()); 48 48 if (gametype) 49 49 { … … 58 58 this->fireEvent(); 59 59 60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype() .get());60 TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype()); 61 61 if (!gametype) 62 62 return;
Note: See TracChangeset
for help on using the changeset viewer.