Changeset 10624 for code/trunk/src/modules
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 101 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/modules/designtools/ScreenshotManager.cc
r9667 r10624 45 45 #include "core/config/ConfigValueIncludes.h" 46 46 #include "core/GraphicsManager.h" 47 #include "core/ PathConfig.h"47 #include "core/ConfigurablePaths.h" 48 48 #include "core/Resource.h" 49 #include "core/command/ConsoleCommand .h"50 #include " util/ScopedSingletonManager.h"49 #include "core/command/ConsoleCommandIncludes.h" 50 #include "core/singleton/ScopedSingletonIncludes.h" 51 51 #include "util/StringUtils.h" 52 52 … … 61 61 SetConsoleCommand("printScreenHD", &ScreenshotManager::makeScreenshot_s); 62 62 63 ManageScopedSingleton(ScreenshotManager, ScopeID::Graphics, false); 63 ManageScopedSingleton(ScreenshotManager, ScopeID::GRAPHICS, false); 64 65 RegisterAbstractClass(ScreenshotManager).inheritsFrom<Configurable>(); 64 66 65 67 /** … … 152 154 { 153 155 // Save it. 154 finalImage->save( PathConfig::getInstance().getLogPathString() + "screenshot_" + getTimestamp() + this->fileExtension_);156 finalImage->save(ConfigurablePaths::getLogPathString() + "screenshot_" + getTimestamp() + this->fileExtension_); 155 157 delete finalImage; 156 158 orxout(user_info) << "Finished taking " << this->gridSize_*this->windowWidth_ << "x" << this->gridSize_*this->windowHeight_ << " pixel HD screenshot. Storing in log/." << endl; -
code/trunk/src/modules/designtools/SkyboxGenerator.cc
r9667 r10624 38 38 #include <OgreCamera.h> 39 39 40 #include "util/ScopedSingletonManager.h"41 40 #include "core/CoreIncludes.h" 42 41 #include "core/config/ConfigValueIncludes.h" 43 42 #include "core/GraphicsManager.h" 44 #include "core/ PathConfig.h"43 #include "core/ConfigurablePaths.h" 45 44 #include "core/Resource.h" 46 #include "core/command/ConsoleCommand .h"45 #include "core/command/ConsoleCommandIncludes.h" 47 46 #include "core/command/CommandExecutor.h" 47 #include "core/singleton/ScopedSingletonIncludes.h" 48 48 49 49 #include "controllers/HumanController.h" … … 60 60 SetConsoleCommand("SkyboxGenerator", "createSkybox", &SkyboxGenerator::createSkybox).addShortcut(); 61 61 62 ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false); 62 ManageScopedSingleton(SkyboxGenerator, ScopeID::GRAPHICS, false); 63 64 RegisterAbstractClass(SkyboxGenerator).inheritsFrom<Configurable>().inheritsFrom<Tickable>(); 63 65 64 66 /** … … 173 175 this->setupRenderWindow(renderWindow); 174 176 // Add the log path to the standard resource group. 175 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( PathConfig::getInstance().getLogPathString(), "FileSystem", Resource::getDefaultResourceGroup());177 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getLogPathString(), "FileSystem", Resource::getDefaultResourceGroup()); 176 178 177 179 orxout(internal_status) << "Setting up SkyboxGenerator..." << endl; … … 208 210 this->restoreRenderWindow(renderWindow); 209 211 // Remove the log path from the standard resource group. 210 Ogre::ResourceGroupManager::getSingleton().removeResourceLocation( PathConfig::getInstance().getLogPathString(), Resource::getDefaultResourceGroup());212 Ogre::ResourceGroupManager::getSingleton().removeResourceLocation(ConfigurablePaths::getLogPathString(), Resource::getDefaultResourceGroup()); 211 213 212 214 // Reset the flow parameters for the next skybox generation. … … 306 308 void SkyboxGenerator::saveImage(Ogre::Image* image, const std::string& name) const 307 309 { 308 image->save( PathConfig::getInstance().getLogPathString()+name);310 image->save(ConfigurablePaths::getLogPathString()+name); 309 311 delete image; 310 312 // Loading the resizing, then saving again. This seems stupid, but resizing doesn't seem to work otherwise. … … 313 315 image->load(name, Resource::getDefaultResourceGroup()); 314 316 image->resize(this->size_, this->size_); 315 image->save( PathConfig::getInstance().getLogPathString()+name);317 image->save(ConfigurablePaths::getLogPathString()+name); 316 318 delete image; 317 319 ScreenshotManager::getInstance().cleanup(); // Free memory in ScreenshotManager. -
code/trunk/src/modules/docking/Dock.cc
r9945 r10624 37 37 #include "core/LuaState.h" 38 38 #include "core/GUIManager.h" 39 #include "core/command/ConsoleCommand .h"40 #include "network/NetworkFunction .h"39 #include "core/command/ConsoleCommandIncludes.h" 40 #include "network/NetworkFunctionIncludes.h" 41 41 42 42 #include "infos/HumanPlayer.h" … … 184 184 } 185 185 else 186 callStaticNetworkFunction( Dock::showDockingDialog, player->getClientID());186 callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID()); 187 187 188 188 } … … 201 201 } 202 202 else 203 callStaticNetworkFunction( Dock::showDockingDialog, player->getClientID());203 callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID()); 204 204 205 205 } -
code/trunk/src/modules/docking/DockingAnimation.cc
r9667 r10624 39 39 namespace orxonox 40 40 { 41 RegisterAbstractClass(DockingAnimation).inheritsFrom (Class(BaseObject));41 RegisterAbstractClass(DockingAnimation).inheritsFrom<BaseObject>(); 42 42 43 43 DockingAnimation::DockingAnimation(Context* context) : BaseObject(context) -
code/trunk/src/modules/docking/DockingEffect.cc
r9667 r10624 37 37 namespace orxonox 38 38 { 39 RegisterAbstractClass(DockingEffect).inheritsFrom (Class(BaseObject));39 RegisterAbstractClass(DockingEffect).inheritsFrom<BaseObject>(); 40 40 41 41 DockingEffect::DockingEffect(Context* context) : BaseObject(context) -
code/trunk/src/modules/dodgerace/CMakeLists.txt
r10284 r10624 8 8 9 9 ORXONOX_ADD_LIBRARY(dodgerace 10 MODULE10 PLUGIN 11 11 FIND_HEADER_FILES 12 12 LINK_LIBRARIES -
code/trunk/src/modules/dodgerace/DodgeRace.cc
r10236 r10624 35 35 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header! 36 36 #include "DodgeRaceCube.h" 37 #include "core/CoreIncludes.h" 37 38 38 39 namespace orxonox … … 43 44 { 44 45 RegisterObject(DodgeRace); 45 init(); 46 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 47 this->center_ = 0; 48 49 this->setHUDTemplate("DodgeRaceHUD"); 50 } 51 52 void DodgeRace::init() 53 { 46 54 47 bEndGame = false; 55 48 lives = 1; … … 65 58 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this))); 66 59 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this))); 60 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 61 this->center_ = 0; 62 63 this->setHUDTemplate("DodgeRaceHUD"); 67 64 } 68 65 … … 74 71 for (int i = 0; i < 7; i++) 75 72 { 76 WeakPtr<BigExplosion>chunk = new BigExplosion(this->center_->getContext());73 BigExplosion* chunk = new BigExplosion(this->center_->getContext()); 77 74 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 78 75 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() … … 90 87 if (getPlayer() != NULL) 91 88 { 92 //WeakPtr<DodgeRaceShip> ship = getPlayer();93 94 89 currentPosition = getPlayer()->getWorldPosition().x; 95 90 counter = counter + (currentPosition - lastPosition); … … 112 107 for(int i = 0; i<6; i++) 113 108 { 114 WeakPtr<DodgeRaceCube>cube = new DodgeRaceCube(this->center_->getContext());109 DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext()); 115 110 cubeList.push_back(cube); 116 111 switch(pattern) … … 137 132 } 138 133 139 WeakPtr<DodgeRaceShip>DodgeRace::getPlayer()134 DodgeRaceShip* DodgeRace::getPlayer() 140 135 { 141 136 if (player == NULL) … … 168 163 { 169 164 orxout() << "start" << endl; 170 init();171 165 for(unsigned int i=0; i< cubeList.size();i++) 172 166 { … … 199 193 /* 200 194 orxout() << "prespawn" << endl; 201 init();202 195 for(int i=0; i< cubeList.size();i++) 203 196 { -
code/trunk/src/modules/dodgerace/DodgeRace.h
r10236 r10624 44 44 45 45 46 #include "core/CoreIncludes.h"47 46 #include "core/EventIncludes.h" 48 47 #include "core/command/Executor.h" … … 69 68 public: 70 69 DodgeRace(Context* context); 71 72 void init();73 70 74 71 virtual void start(); … … 106 103 Timer endGameTimer; 107 104 108 WeakPtr<DodgeRaceShip>getPlayer();105 DodgeRaceShip* getPlayer(); 109 106 WeakPtr<DodgeRaceShip> player; 110 107 std::vector<DodgeRaceCube*> cubeList; -
code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc
r10232 r10624 54 54 } 55 55 56 void DodgeRaceCenterPoint::changedGametype()57 {58 SUPER(DodgeRaceCenterPoint, changedGametype);59 60 // Check, whether it's still DodgeRace.61 this->checkGametype();62 }63 64 56 void DodgeRaceCenterPoint::checkGametype() 65 57 { 66 58 if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace))) 67 59 { 68 DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype() .get());60 DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype()); 69 61 DodgeRaceGametype->setCenterpoint(this); 70 62 } -
code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h
r10234 r10624 52 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 53 53 54 virtual void changedGametype(); //!< Is called when the gametype has changed.55 54 private: 56 55 void checkGametype(); -
code/trunk/src/modules/dodgerace/DodgeRaceCube.cc
r10236 r10624 33 33 #include "DodgeRaceCube.h" 34 34 #include "DodgeRace.h" 35 #include "core/CoreIncludes.h" 35 36 36 37 namespace orxonox -
code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc
r10236 r10624 82 82 if (this->getOwner() && this->getOwner()->getGametype()) 83 83 { 84 this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype() .get());84 this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype()); 85 85 } 86 86 else -
code/trunk/src/modules/dodgerace/DodgeRaceShip.cc
r10236 r10624 33 33 34 34 #include "DodgeRaceShip.h" 35 #include "core/CoreIncludes.h" 35 36 36 37 namespace orxonox … … 89 90 90 91 // Camera 91 WeakPtr<Camera>camera = this->getCamera();92 Camera* camera = this->getCamera(); 92 93 if (camera != NULL) 93 94 { … … 149 150 } 150 151 151 WeakPtr<DodgeRace>DodgeRaceShip::getGame()152 DodgeRace* DodgeRaceShip::getGame() 152 153 { 153 154 if (game == NULL) -
code/trunk/src/modules/dodgerace/DodgeRaceShip.h
r10284 r10624 38 38 #include "dodgerace/DodgeRacePrereqs.h" 39 39 40 #include "core/CoreIncludes.h"41 40 #include "core/XMLPort.h" 42 41 #include "worldentities/pawns/SpaceShip.h" … … 79 78 private: 80 79 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 81 WeakPtr<DodgeRace>getGame();80 DodgeRace* getGame(); 82 81 WeakPtr<DodgeRace> game; 83 82 WeakPtr<WorldEntity> lastEntity; -
code/trunk/src/modules/gametypes/CMakeLists.txt
r9526 r10624 10 10 11 11 ORXONOX_ADD_LIBRARY(gametypes 12 MODULE12 PLUGIN 13 13 FIND_HEADER_FILES 14 14 TOLUA_FILES -
code/trunk/src/modules/gametypes/OldRaceCheckPoint.cc
r9667 r10624 61 61 SUPER(OldRaceCheckPoint, tick, dt); 62 62 63 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype() .get());63 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype()); 64 64 assert(gametype); 65 65 if (this->getCheckpointIndex() == gametype->getCheckpointsReached()) … … 82 82 DistanceTrigger::triggered(bIsTriggered); 83 83 84 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype() .get());84 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype()); 85 85 if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered) 86 86 { … … 107 107 if (this->bTimeLimit_ != 0) 108 108 { 109 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype() .get());109 OldSpaceRace* gametype = orxonox_cast<OldSpaceRace*>(this->getGametype()); 110 110 if (gametype) 111 111 { -
code/trunk/src/modules/gametypes/SpaceRaceManager.cc
r9667 r10624 46 46 { 47 47 RegisterObject(SpaceRaceManager); 48 this->race_ = orxonox_cast<SpaceRace*>(this->getGametype() .get());48 this->race_ = orxonox_cast<SpaceRace*>(this->getGametype()); 49 49 assert(race_); 50 50 //amountOfPlayers=(race_->getPlayers()).size(); … … 139 139 void SpaceRaceManager::checkpointReached(RaceCheckPoint* newCheckpoint, PlayerInfo* player) 140 140 { 141 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype() .get());141 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype()); 142 142 assert(gametype); 143 143 if (!gametype) -
code/trunk/src/modules/invader/CMakeLists.txt
r9958 r10624 13 13 14 14 ORXONOX_ADD_LIBRARY(invader 15 MODULE15 PLUGIN 16 16 FIND_HEADER_FILES 17 17 LINK_LIBRARIES -
code/trunk/src/modules/invader/Invader.cc
r9961 r10624 62 62 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 63 63 this->center_ = 0; 64 init();65 this->setHUDTemplate("InvaderHUD");66 }67 68 void Invader::init()69 {70 64 bEndGame = false; 71 65 lives = 3; … … 78 72 enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this))); 79 73 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&Invader::comboControll, this))); 74 this->setHUDTemplate("InvaderHUD"); 80 75 } 81 76 … … 87 82 for (int i = 0; i < 7; i++) 88 83 { 89 WeakPtr<BigExplosion>chunk = new BigExplosion(this->center_->getContext());84 BigExplosion* chunk = new BigExplosion(this->center_->getContext()); 90 85 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 91 86 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() … … 99 94 } 100 95 101 WeakPtr<InvaderShip>Invader::getPlayer()96 InvaderShip* Invader::getPlayer() 102 97 { 103 98 if (player == NULL) … … 116 111 for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++) 117 112 { 118 WeakPtr<InvaderEnemy>newPawn;113 InvaderEnemy* newPawn; 119 114 if (rand() % 42/(1 + level*level) == 0) 120 115 { … … 155 150 void Invader::start() 156 151 { 157 init();158 152 // Set variable to temporarily force the player to spawn. 159 153 this->bForceSpawn_ = true; -
code/trunk/src/modules/invader/Invader.h
r9943 r10624 71 71 // checks if multiplier should be reset. 72 72 void comboControll(); 73 void init();74 73 int lives; 75 74 int multiplier; … … 78 77 private: 79 78 void toggleShowLevel(){bShowLevel = !bShowLevel;} 80 WeakPtr<InvaderShip>getPlayer();79 InvaderShip* getPlayer(); 81 80 WeakPtr<InvaderCenterPoint> center_; 82 81 WeakPtr<InvaderShip> player; -
code/trunk/src/modules/invader/InvaderCenterPoint.cc
r9943 r10624 54 54 } 55 55 56 void InvaderCenterPoint::changedGametype()57 {58 SUPER(InvaderCenterPoint, changedGametype);59 60 // Check, whether it's still Invader.61 this->checkGametype();62 }63 64 56 void InvaderCenterPoint::checkGametype() 65 57 { 66 58 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader))) 67 59 { 68 Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype() .get());60 Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype()); 69 61 InvaderGametype->setCenterpoint(this); 70 62 } -
code/trunk/src/modules/invader/InvaderCenterPoint.h
r9943 r10624 49 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 50 51 virtual void changedGametype(); //!< Is called when the gametype has changed.52 51 private: 53 52 void checkGametype(); -
code/trunk/src/modules/invader/InvaderEnemy.cc
r9961 r10624 69 69 } 70 70 71 WeakPtr<Invader>InvaderEnemy::getGame()71 Invader* InvaderEnemy::getGame() 72 72 { 73 73 if (game == NULL) -
code/trunk/src/modules/invader/InvaderEnemy.h
r9943 r10624 49 49 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 50 50 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator); 51 virtual void setPlayer( WeakPtr<InvaderShip>player){this->player = player;}51 virtual void setPlayer(InvaderShip* player){this->player = player;} 52 52 53 53 int level; 54 54 protected: 55 WeakPtr<Invader>getGame();55 Invader* getGame(); 56 56 WeakPtr<Invader> game; 57 57 WeakPtr<InvaderShip> player; -
code/trunk/src/modules/invader/InvaderHUDinfo.cc
r9961 r10624 128 128 if (this->getOwner() && this->getOwner()->getGametype()) 129 129 { 130 this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype() .get());130 this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype()); 131 131 } 132 132 else -
code/trunk/src/modules/invader/InvaderShip.cc
r9943 r10624 91 91 92 92 // Camera 93 WeakPtr<Camera>camera = this->getCamera();93 Camera* camera = this->getCamera(); 94 94 if (camera != NULL) 95 95 { … … 142 142 { 143 143 // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint; 144 WeakPtr<InvaderEnemy>enemy = orxonox_cast<InvaderEnemy*>(otherObject);145 WeakPtr<Projectile>shot = orxonox_cast<Projectile*>(otherObject);144 InvaderEnemy* enemy = orxonox_cast<InvaderEnemy*>(otherObject); 145 Projectile* shot = orxonox_cast<Projectile*>(otherObject); 146 146 // ensure that this gets only called once per enemy. 147 147 if (enemy != NULL && lastEnemy != enemy) … … 171 171 } 172 172 173 WeakPtr<Invader>InvaderShip::getGame()173 Invader* InvaderShip::getGame() 174 174 { 175 175 if (game == NULL) -
code/trunk/src/modules/invader/InvaderShip.h
r9943 r10624 70 70 virtual void death(); 71 71 private: 72 WeakPtr<Invader>getGame();72 Invader* getGame(); 73 73 WeakPtr<Invader> game; 74 74 Camera* camera; -
code/trunk/src/modules/invader/InvaderWeapon.cc
r10216 r10624 68 68 // Create the projectile.projectile 69 69 projectile = new Projectile(this->getContext()); 70 WeakPtr<Model>model = new Model(projectile->getContext());70 Model* model = new Model(projectile->getContext()); 71 71 model->setMeshSource(mesh_); 72 72 model->setCastShadows(false); -
code/trunk/src/modules/jump/CMakeLists.txt
r10284 r10624 24 24 25 25 ORXONOX_ADD_LIBRARY(jump 26 MODULE26 PLUGIN 27 27 FIND_HEADER_FILES 28 28 LINK_LIBRARIES -
code/trunk/src/modules/jump/JumpCenterpoint.cc
r10262 r10624 80 80 } 81 81 82 void JumpCenterpoint::changedGametype()83 {84 SUPER(JumpCenterpoint, changedGametype);85 86 checkGametype();87 }88 89 82 void JumpCenterpoint::checkGametype() 90 83 { 91 84 if (getGametype() != NULL && this->getGametype()->isA(Class(Jump))) 92 85 { 93 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype() .get());86 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype()); 94 87 jumpGametype->setCenterpoint(this); 95 88 } -
code/trunk/src/modules/jump/JumpCenterpoint.h
r10262 r10624 114 114 virtual ~JumpCenterpoint() {} 115 115 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a JumpCenterpoint through XML. 116 virtual void changedGametype();117 116 void setPlatformStaticTemplate(const std::string& balltemplate) 118 117 { this->platformStaticTemplate_ = balltemplate; } -
code/trunk/src/modules/jump/JumpEnemy.cc
r10262 r10624 151 151 An array (of size 2) of weak pointers, to be set as the new bats. 152 152 */ 153 void JumpEnemy::setFigure( WeakPtr<JumpFigure>newFigure)153 void JumpEnemy::setFigure(JumpFigure* newFigure) 154 154 { 155 155 figure_ = newFigure; -
code/trunk/src/modules/jump/JumpEnemy.h
r10262 r10624 68 68 69 69 virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed); 70 void setFigure( WeakPtr<JumpFigure> bats);70 void setFigure(JumpFigure* newFigure); 71 71 virtual void touchFigure(); 72 72 bool dead_; -
code/trunk/src/modules/jump/JumpItem.cc
r10262 r10624 109 109 } 110 110 111 void JumpItem::setFigure( WeakPtr<JumpFigure>newFigure)111 void JumpItem::setFigure(JumpFigure* newFigure) 112 112 { 113 113 figure_ = newFigure; -
code/trunk/src/modules/jump/JumpItem.h
r10262 r10624 53 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 54 54 virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed); 55 virtual void setFigure( WeakPtr<JumpFigure> bats);55 virtual void setFigure(JumpFigure* newFigure); 56 56 virtual void touchFigure(); 57 57 -
code/trunk/src/modules/jump/JumpPlatform.cc
r10262 r10624 125 125 } 126 126 127 void JumpPlatform::setFigure( WeakPtr<JumpFigure>newFigure)127 void JumpPlatform::setFigure(JumpFigure* newFigure) 128 128 { 129 129 figure_ = newFigure; -
code/trunk/src/modules/jump/JumpPlatform.h
r10262 r10624 49 49 virtual void tick(float dt); 50 50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 51 void setFigure( WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.51 void setFigure(JumpFigure* newFigure); 52 52 virtual void touchFigure(); 53 53 -
code/trunk/src/modules/jump/JumpProjectile.cc
r10262 r10624 84 84 } 85 85 86 void JumpProjectile::setFigure( WeakPtr<JumpFigure>figure)86 void JumpProjectile::setFigure(JumpFigure* figure) 87 87 { 88 88 figure_ = figure; -
code/trunk/src/modules/jump/JumpProjectile.h
r10262 r10624 56 56 { return Vector2(this->fieldWidth_, this->fieldHeight_); } 57 57 58 void setFigure( WeakPtr<JumpFigure>figure);58 void setFigure(JumpFigure* figure); 59 59 60 60 protected: -
code/trunk/src/modules/jump/JumpScore.cc
r10437 r10624 118 118 if (this->getOwner() != NULL && this->getOwner()->getGametype()) 119 119 { 120 this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype() .get());120 this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype()); 121 121 } 122 122 else -
code/trunk/src/modules/mini4dgame/CMakeLists.txt
r10284 r10624 6 6 7 7 ORXONOX_ADD_LIBRARY(mini4dgame 8 MODULE8 PLUGIN 9 9 FIND_HEADER_FILES 10 10 LINK_LIBRARIES -
code/trunk/src/modules/mini4dgame/Mini4Dgame.cc
r10230 r10624 45 45 #include "core/config/ConfigValueIncludes.h" 46 46 #include "infos/PlayerInfo.h" 47 #include "core/command/ConsoleCommand .h"47 #include "core/command/ConsoleCommandIncludes.h" 48 48 49 49 #include "gamestates/GSLevel.h" -
code/trunk/src/modules/mini4dgame/Mini4DgameBoard.cc
r10230 r10624 901 901 /** 902 902 @brief 903 Is called when the gametype has changed.904 */905 void Mini4DgameBoard::changedGametype()906 {907 SUPER(Mini4DgameBoard, changedGametype);908 909 // Check, whether it's still Mini4Dgame.910 this->checkGametype();911 }912 913 /**914 @brief915 903 Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint. 916 904 */ … … 919 907 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Mini4Dgame))) 920 908 { 921 Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype() .get());909 Mini4Dgame* Mini4DgameGametype = orxonox_cast<Mini4Dgame*>(this->getGametype()); 922 910 Mini4DgameGametype->setGameboard(this); 923 911 } -
code/trunk/src/modules/mini4dgame/Mini4DgameBoard.h
r10230 r10624 81 81 Mini4DgameWinner getWinner(); 82 82 83 void changedGametype();84 83 void checkGametype(); 85 84 -
code/trunk/src/modules/notifications/NotificationDispatcher.cc
r9667 r10624 37 37 #include "core/EventIncludes.h" 38 38 #include "core/XMLPort.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 #include "network/Host.h" 41 41 … … 118 118 if(!GameMode::isStandalone()) 119 119 { 120 callMemberNetworkFunction( NotificationDispatcher,broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);120 callMemberNetworkFunction(&NotificationDispatcher::broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST); 121 121 } 122 122 } … … 148 148 else if(GameMode::isServer()) 149 149 { 150 callMemberNetworkFunction( NotificationDispatcher,dispatch, this->getObjectID(), clientId, clientId);150 callMemberNetworkFunction(&NotificationDispatcher::dispatch, this->getObjectID(), clientId, clientId); 151 151 } 152 152 } -
code/trunk/src/modules/notifications/NotificationManager.cc
r9667 r10624 37 37 #include "core/CoreIncludes.h" 38 38 #include "core/LuaState.h" 39 #include " util/ScopedSingletonManager.h"39 #include "core/singleton/ScopedSingletonIncludes.h" 40 40 41 41 #include "interfaces/NotificationListener.h" … … 47 47 { 48 48 49 ManageScopedSingleton(NotificationManager, ScopeID::Root, false); 49 ManageScopedSingleton(NotificationManager, ScopeID::ROOT, false); 50 51 RegisterAbstractClass(NotificationManager).inheritsFrom<NotificationListener>(); 50 52 51 53 /** -
code/trunk/src/modules/objects/Planet.cc
r9675 r10624 85 85 86 86 SUPER(Planet, tick, dt); 87 }88 89 void Planet::init()90 {91 87 } 92 88 -
code/trunk/src/modules/objects/Planet.h
r9667 r10624 52 52 virtual ~Planet(); 53 53 54 void init();55 54 virtual void tick(float dt); 56 55 -
code/trunk/src/modules/objects/Script.cc
r9667 r10624 37 37 #include "core/XMLPort.h" 38 38 #include "network/Host.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 41 41 #include "PlayerManager.h" … … 198 198 for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++) 199 199 { 200 callStaticNetworkFunction( Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());200 callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics()); 201 201 if(this->times_ != Script::INF) // Decrement the number of remaining executions. 202 202 { … … 210 210 else 211 211 { 212 callStaticNetworkFunction( Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());212 callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics()); 213 213 if(this->times_ != Script::INF) // Decrement the number of remaining executions. 214 214 this->remainingExecutions_--; … … 248 248 if(GameMode::isServer() && this->isOnLoad()) 249 249 { 250 callStaticNetworkFunction( Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());250 callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics()); 251 251 } 252 252 } -
code/trunk/src/modules/objects/SpaceBoundaries.cc
r9941 r10624 210 210 for( std::list<WeakPtr<Pawn> >::iterator current = pawnsIn_.begin(); current != pawnsIn_.end(); current++ ) 211 211 { 212 Pawn* currentPawn = current->get();212 Pawn* currentPawn = *current; 213 213 if( currentPawn && currentPawn->getNode() ) 214 214 { -
code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc
r10189 r10624 40 40 namespace orxonox 41 41 { 42 RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom (Class(CollisionShape));42 RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom<CollisionShape>(); 43 43 44 44 /** -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc
r9667 r10624 58 58 } 59 59 60 BoxCollisionShape::~BoxCollisionShape()61 {62 // TODO: Move to CollisionShape?63 if (this->isInitialized())64 delete this->collisionShape_;65 }66 67 60 void BoxCollisionShape::registerVariables() 68 61 { -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
r9667 r10624 58 58 public: 59 59 BoxCollisionShape(Context* context); 60 virtual ~BoxCollisionShape();61 60 62 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc
r10189 r10624 54 54 } 55 55 56 ConeCollisionShape::~ConeCollisionShape()57 {58 if (this->isInitialized())59 delete this->collisionShape_;60 }61 62 56 /** 63 57 @brief -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
r10189 r10624 56 56 public: 57 57 ConeCollisionShape(Context* context); 58 virtual ~ConeCollisionShape();59 58 60 59 private: -
code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.cc
r10262 r10624 54 54 } 55 55 56 CylinderCollisionShape::~CylinderCollisionShape()57 {58 if (this->isInitialized())59 delete this->collisionShape_;60 }61 62 56 /** 63 57 @brief -
code/trunk/src/modules/objects/collisionshapes/CylinderCollisionShape.h
r10262 r10624 53 53 public: 54 54 CylinderCollisionShape(Context* context); 55 virtual ~CylinderCollisionShape();56 55 57 56 private: -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc
r9667 r10624 59 59 } 60 60 61 PlaneCollisionShape::~PlaneCollisionShape()62 {63 if (this->isInitialized())64 delete this->collisionShape_;65 }66 67 61 void PlaneCollisionShape::registerVariables() 68 62 { -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
r9667 r10624 58 58 public: 59 59 PlaneCollisionShape(Context* context); 60 virtual ~PlaneCollisionShape();61 60 62 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc
r9667 r10624 58 58 } 59 59 60 SphereCollisionShape::~SphereCollisionShape()61 {62 if (this->isInitialized())63 delete this->collisionShape_;64 }65 66 60 void SphereCollisionShape::registerVariables() 67 61 { -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
r9667 r10624 56 56 public: 57 57 SphereCollisionShape(Context* context); 58 virtual ~SphereCollisionShape();59 58 60 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); -
code/trunk/src/modules/objects/triggers/CheckPoint.cc
r9667 r10624 93 93 DistanceTrigger::triggered(bIsTriggered); 94 94 95 Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype() .get());95 Asteroids* gametype = orxonox_cast<Asteroids*>(this->getGametype()); 96 96 if (gametype) 97 97 { -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
r9667 r10624 100 100 101 101 // Check for objects that were in range but no longer are. Iterate through all objects, that are in range. 102 for(std:: map<WorldEntity*, WeakPtr<WorldEntity>*>::iterator it = this->range_.begin(); it != this->range_.end(); )102 for(std::set<WeakPtr<WorldEntity> >::iterator it = this->range_.begin(); it != this->range_.end(); ) 103 103 { 104 WorldEntity* entity = it->second->get(); 105 WorldEntity* key = it->first; 106 it++; // Incrementing the iterator in advance, since we don't need the current anymore and we potentially are going to delete the current element thus invalidating the iterator. 104 WorldEntity* entity = *it; 105 107 106 // If the entity no longer exists. 108 107 if(entity == NULL) 109 108 { 110 this->r emoveFromRange(key);109 this->range_.erase(it++); 111 110 continue; 112 111 } … … 116 115 if (distanceVec.length() > this->distance_) 117 116 { 118 // If for some reason the entity could not be removed. 119 if(!this->removeFromRange(key)) 120 continue; 117 this->range_.erase(it++); 121 118 122 119 // If no queue has been created, yet. … … 129 126 state->originator = entity; 130 127 queue->push(state); 128 } 129 else 130 { 131 ++it; 131 132 } 132 133 } … … 260 261 bool DistanceMultiTrigger::addToRange(WorldEntity* entity) 261 262 { 262 WeakPtr<WorldEntity>* weakptr = new WeakPtr<WorldEntity>(entity); 263 std::pair<std::map<WorldEntity*, WeakPtr<WorldEntity>* >::iterator, bool> pair = this->range_.insert(std::pair<WorldEntity*, WeakPtr<WorldEntity>* >(entity, weakptr)); 264 265 if(!pair.second) 266 { 267 delete weakptr; 268 return false; 269 } 270 271 return true; 272 } 273 274 /** 275 @brief 276 Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger. 277 @param entity 278 A pointer ot the entity. 279 @return 280 Returns true if successful. 281 */ 282 bool DistanceMultiTrigger::removeFromRange(WorldEntity* entity) 283 { 284 WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second; 285 bool erased = this->range_.erase(entity) > 0; 286 if(erased) 287 delete weakptr; 288 return erased; 289 } 290 263 std::pair<std::set<WeakPtr<WorldEntity> >::iterator, bool> pair = this->range_.insert(entity); 264 return pair.second; 265 } 291 266 } -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
r9667 r10624 140 140 141 141 bool addToRange(WorldEntity* entity); // Add a given entity to the entities, that currently are in range of the DistanceMultiTrigger. 142 bool removeFromRange(WorldEntity* entity); // Remove a given entity from the set of entities, that currently are in range of the DistanceMultiTrigger.143 142 144 143 private: … … 154 153 ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons. 155 154 156 std:: map<WorldEntity*, WeakPtr<WorldEntity>*> range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.155 std::set<WeakPtr<WorldEntity> > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger. 157 156 158 157 }; -
code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
r9667 r10624 147 147 { 148 148 // Check whether there is a cached object, it still exists and whether it is still in range, if so nothing further needs to be done. 149 if(this->cache_ .get()!= NULL)150 { 151 if((this->cache_ .get()->getWorldPosition() - this->getWorldPosition()).length() < this->distance_)149 if(this->cache_ != NULL) 150 { 151 if((this->cache_->getWorldPosition() - this->getWorldPosition()).length() < this->distance_) 152 152 return true; 153 153 else … … 213 213 214 214 // Add the entity to the cache. 215 this->cache_ = WeakPtr<WorldEntity>(entity);215 this->cache_ = entity; 216 216 217 217 return true; -
code/trunk/src/modules/objects/triggers/Trigger.cc
r9667 r10624 38 38 #include "core/GameMode.h" 39 39 #include "core/XMLPort.h" 40 #include "core/command/ConsoleCommand .h"40 #include "core/command/ConsoleCommandIncludes.h" 41 41 42 42 #include "Scene.h" -
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
r9667 r10624 115 115 private: 116 116 WeakPtr<Pawn> owner_; 117 S martPtr<OverlayText> textoverlay_;117 StrongPtr<OverlayText> textoverlay_; 118 118 bool bUseBarColour_; 119 119 ColourValue textColour_; -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r10294 r10624 41 41 #include "util/Math.h" 42 42 #include "util/Convert.h" 43 #include "core/command/ConsoleCommand .h"43 #include "core/command/ConsoleCommandIncludes.h" 44 44 #include "core/CoreIncludes.h" 45 45 #include "core/XMLPort.h" -
code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc
r9667 r10624 87 87 { 88 88 this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner()); 89 this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype() .get());89 this->lms_ = orxonox_cast<LastManStanding*>(this->getOwner()->getGametype()); 90 90 } 91 91 else -
code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc
r9667 r10624 87 87 { 88 88 this->player_ = orxonox_cast<PlayerInfo*>(this->getOwner()); 89 this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype() .get());89 this->lts_ = orxonox_cast<LastTeamStanding*>(this->getOwner()->getGametype()); 90 90 } 91 91 else -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc
r9667 r10624 118 118 119 119 if (this->getOwner() && this->getOwner()->getGametype()) 120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype() .get());120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype()); 121 121 else 122 122 this->owner_ = 0; -
code/trunk/src/modules/pickup/CollectiblePickup.cc
r9667 r10624 40 40 namespace orxonox 41 41 { 42 RegisterAbstractClass(CollectiblePickup).inheritsFrom (Class(Pickupable));42 RegisterAbstractClass(CollectiblePickup).inheritsFrom<Pickupable>(); 43 43 44 44 /** -
code/trunk/src/modules/pickup/PickupManager.cc
r9667 r10624 38 38 #include "core/GUIManager.h" 39 39 #include "core/class/Identifier.h" 40 #include "core/singleton/ScopedSingletonIncludes.h" 40 41 #include "network/Host.h" 41 #include "network/NetworkFunction.h" 42 #include "util/ScopedSingletonManager.h" 42 #include "network/NetworkFunctionIncludes.h" 43 43 44 44 #include "infos/PlayerInfo.h" … … 51 51 namespace orxonox 52 52 { 53 ManageScopedSingleton(PickupManager, ScopeID::R oot, false);53 ManageScopedSingleton(PickupManager, ScopeID::ROOT, false); 54 54 55 55 // Initialization of the name of the PickupInventory GUI. … … 62 62 registerStaticNetworkFunction(PickupManager::usePickupNetworked); 63 63 64 RegisterAbstractClass(PickupManager).inheritsFrom<PickupListener>(); 65 64 66 /** 65 67 @brief … … 94 96 95 97 // Destroying all the WeakPointers that are still there. 96 for(std::map<uint32_t, WeakPtr<Pickupable>*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)97 delete it->second;98 98 this->pickups_.clear(); 99 99 … … 212 212 else 213 213 { 214 callStaticNetworkFunction( PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable());214 callStaticNetworkFunction(&PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable()); 215 215 } 216 216 } … … 286 286 // Add the Pickupable to the indexes_ and pickups_ lists. 287 287 this->indexes_[pickup] = index; 288 this->pickups_[index] = new WeakPtr<Pickupable>(pickup);288 this->pickups_[index] = pickup; 289 289 } 290 290 else // If it was dropped, it is removed from the required lists. … … 294 294 index = it->second; 295 295 296 // Remove the Pickupable form the indexes_ and pickups_ list. 297 WeakPtr<Pickupable>* ptr = this->pickups_[index]; 296 // Remove the Pickupable from the indexes_ and pickups_ list. 298 297 this->indexes_.erase(it); 299 298 this->pickups_.erase(index); 300 delete ptr;301 299 } 302 300 … … 316 314 if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end()) 317 315 { 318 callStaticNetworkFunction( PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);316 callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp); 319 317 } 320 318 else 321 319 { 322 callStaticNetworkFunction( PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);320 callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp); 323 321 } 324 322 } … … 400 398 if(this->pickups_.empty()) 401 399 return; 402 Pickupable* pickupable = this->pickups_.find(pickup)->second ->get();400 Pickupable* pickupable = this->pickups_.find(pickup)->second; 403 401 if(pickupable != NULL) 404 402 pickupable->drop(); … … 407 405 else 408 406 { 409 callStaticNetworkFunction( PickupManager::dropPickupNetworked, 0, pickup);407 callStaticNetworkFunction(&PickupManager::dropPickupNetworked, 0, pickup); 410 408 } 411 409 } … … 443 441 if(this->pickups_.empty()) 444 442 return; 445 Pickupable* pickupable = this->pickups_.find(pickup)->second ->get();443 Pickupable* pickupable = this->pickups_.find(pickup)->second; 446 444 if(pickupable != NULL) 447 445 pickupable->setUsed(use); … … 450 448 else 451 449 { 452 callStaticNetworkFunction( PickupManager::usePickupNetworked, 0, pickup, use);450 callStaticNetworkFunction(&PickupManager::usePickupNetworked, 0, pickup, use); 453 451 } 454 452 } -
code/trunk/src/modules/pickup/PickupManager.h
r9667 r10624 161 161 std::map<uint32_t, PickupInventoryContainer*>::iterator pickupsIterator_; //!< An iterator pointing to the current Pickupable in pickupsList_. 162 162 163 std::map<uint32_t, WeakPtr<Pickupable> *> pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable.163 std::map<uint32_t, WeakPtr<Pickupable> > pickups_; //!< Map linking a number identifying a Pickupable to a weak pointer of a Pickupable. 164 164 std::map<Pickupable*, uint32_t> indexes_;//!< Map linking Pickupable to the number identifying it. 165 165 -
code/trunk/src/modules/pickup/PickupSpawner.cc
r9667 r10624 145 145 if(GameMode::isMaster() && this->isActive()) 146 146 { 147 WeakPtr<PickupSpawner> spawner = this; // Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup) 147 // TODO: why is this a WeakPtr when the comment says StrongPtr? 148 WeakPtr<PickupSpawner> spawner = this; // Create a strong pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup) 148 149 149 150 // Remove PickupCarriers from the blocked list if they have exceeded their time. -
code/trunk/src/modules/pickup/items/ShrinkPickup.cc
r9667 r10624 182 182 183 183 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation. 184 const std::list< S martPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();184 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions(); 185 185 int size = cameraPositions.size(); 186 186 for(int index = 0; index < size; index++) … … 208 208 209 209 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation. 210 const std::list< S martPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();210 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions(); 211 211 int size = cameraPositions.size(); 212 212 for(int index = 0; index < size; index++) … … 263 263 264 264 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation. 265 const std::list< S martPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();265 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions(); 266 266 int size = cameraPositions.size(); 267 267 for(int index = 0; index < size; index++) … … 304 304 305 305 // Iterate over all camera positions and inversely move the camera to create a shrinking sensation. 306 const std::list< S martPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions();306 const std::list< StrongPtr<CameraPosition> >& cameraPositions = pawn->getCameraPositions(); 307 307 int size = cameraPositions.size(); 308 308 for(int index = 0; index < size; index++) -
code/trunk/src/modules/pong/CMakeLists.txt
r8729 r10624 12 12 13 13 ORXONOX_ADD_LIBRARY(pong 14 MODULE14 PLUGIN 15 15 FIND_HEADER_FILES 16 16 LINK_LIBRARIES -
code/trunk/src/modules/pong/PongCenterpoint.cc
r9667 r10624 80 80 /** 81 81 @brief 82 Is called when the gametype has changed.83 */84 void PongCenterpoint::changedGametype()85 {86 SUPER(PongCenterpoint, changedGametype);87 88 // Check, whether it's still Pong.89 this->checkGametype();90 }91 92 /**93 @brief94 82 Checks whether the gametype is Pong and if it is, sets its centerpoint. 95 83 */ … … 98 86 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong))) 99 87 { 100 Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype() .get());88 Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype()); 101 89 pongGametype->setCenterpoint(this); 102 90 } -
code/trunk/src/modules/pong/PongCenterpoint.h
r9667 r10624 126 126 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a PongCenterpoint through XML. 127 127 128 virtual void changedGametype(); //!< Is called when the gametype has changed.129 130 128 /** 131 129 @brief Set the template for the ball. (e.g. to attach the model of the ball, but also to attach an EventListener to it to detect, when it hits the boundaries, and e.g. display some ParticleEffets, when it does.) -
code/trunk/src/modules/pong/PongScore.cc
r9939 r10624 170 170 171 171 if (this->getOwner() != NULL && this->getOwner()->getGametype()) 172 this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype() .get());172 this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype()); 173 173 else 174 174 this->owner_ = 0; -
code/trunk/src/modules/questsystem/Quest.cc
r9667 r10624 45 45 namespace orxonox 46 46 { 47 RegisterAbstractClass(Quest).inheritsFrom (Class(QuestItem));47 RegisterAbstractClass(Quest).inheritsFrom<QuestItem>(); 48 48 49 49 /** -
code/trunk/src/modules/questsystem/QuestEffect.cc
r9667 r10624 37 37 namespace orxonox 38 38 { 39 RegisterAbstractClass(QuestEffect).inheritsFrom (Class(BaseObject));39 RegisterAbstractClass(QuestEffect).inheritsFrom<BaseObject>(); 40 40 41 41 /** -
code/trunk/src/modules/questsystem/QuestManager.cc
r9667 r10624 36 36 #include "util/Exception.h" 37 37 #include "util/OrxAssert.h" 38 #include " util/ScopedSingletonManager.h"38 #include "core/singleton/ScopedSingletonIncludes.h" 39 39 #include "core/command/ConsoleCommand.h" 40 40 #include "core/GUIManager.h" … … 49 49 namespace orxonox 50 50 { 51 ManageScopedSingleton(QuestManager, ScopeID::R oot, false);51 ManageScopedSingleton(QuestManager, ScopeID::ROOT, false); 52 52 53 53 /** -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
r9667 r10624 42 42 namespace orxonox 43 43 { 44 RegisterAbstractClass(ChangeQuestStatus).inheritsFrom (Class(QuestEffect));44 RegisterAbstractClass(ChangeQuestStatus).inheritsFrom<QuestEffect>(); 45 45 46 46 /** -
code/trunk/src/modules/tetris/CMakeLists.txt
r9348 r10624 8 8 9 9 ORXONOX_ADD_LIBRARY(tetris 10 MODULE10 PLUGIN 11 11 FIND_HEADER_FILES 12 12 LINK_LIBRARIES -
code/trunk/src/modules/tetris/Tetris.cc
r9834 r10624 104 104 } 105 105 106 for (std::list<S martPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)106 for (std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 107 107 (*it)->destroy(); 108 108 this->stones_.clear(); … … 136 136 return false; 137 137 138 for(std::list<S martPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)138 for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 139 139 { 140 140 const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone … … 192 192 193 193 // check for collisions with all stones 194 for(std::list<S martPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)194 for(std::list<StrongPtr<TetrisStone> >::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 195 195 { 196 196 //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount()); … … 469 469 { 470 470 stonesPerRow = 0; 471 for(std::list<S martPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )472 { 473 std::list<S martPtr<TetrisStone> >::iterator it_temp = it++;471 for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ) 472 { 473 std::list<StrongPtr<TetrisStone> >::iterator it_temp = it++; 474 474 correctPosition = static_cast<unsigned int>(((*it_temp)->getPosition().y - 5)/this->center_->getStoneSize()); 475 475 if(correctPosition == row) … … 491 491 void Tetris::clearRow(unsigned int row) 492 492 {// clear the full row 493 for(std::list<S martPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); )493 for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ) 494 494 { 495 495 if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) == row) … … 502 502 } 503 503 // adjust height of stones above the deleted row //TODO: check if this could be a source of a bug. 504 for(std::list<S martPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)504 for(std::list<StrongPtr<TetrisStone> >::iterator it = this->stones_.begin(); it != this->stones_.end(); ++it) 505 505 { 506 506 if(static_cast<unsigned int>(((*it)->getPosition().y - 5)/this->center_->getStoneSize()) > row) -
code/trunk/src/modules/tetris/Tetris.h
r10622 r10624 69 69 70 70 PlayerInfo* getPlayer(void) const; //!< Get the player. 71 WeakPtr<TetrisCenterpoint>getCenterpoint(void)71 TetrisCenterpoint* getCenterpoint(void) 72 72 { return this->center_; } 73 73 … … 93 93 94 94 WeakPtr<TetrisCenterpoint> center_; //!< The playing field. 95 std::list<S martPtr<TetrisStone> > stones_; //!< A list of all stones in play.95 std::list<StrongPtr<TetrisStone> > stones_; //!< A list of all stones in play. 96 96 WeakPtr<TetrisBrick> activeBrick_; 97 97 WeakPtr<TetrisBrick> futureBrick_; -
code/trunk/src/modules/tetris/TetrisBrick.cc
r10262 r10624 169 169 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris))) 170 170 { 171 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype() .get());171 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); 172 172 return tetrisGametype; 173 173 } -
code/trunk/src/modules/tetris/TetrisCenterpoint.cc
r9667 r10624 80 80 /** 81 81 @brief 82 Is called when the gametype has changed.83 */84 void TetrisCenterpoint::changedGametype()85 {86 SUPER(TetrisCenterpoint, changedGametype);87 88 // Check, whether it's still Tetris.89 this->checkGametype();90 }91 92 /**93 @brief94 82 Checks whether the gametype is Tetris and if it is, sets its centerpoint. 95 83 */ … … 98 86 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Tetris))) 99 87 { 100 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype() .get());88 Tetris* tetrisGametype = orxonox_cast<Tetris*>(this->getGametype()); 101 89 tetrisGametype->setCenterpoint(this); 102 90 } -
code/trunk/src/modules/tetris/TetrisCenterpoint.h
r9667 r10624 64 64 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a TetrisCenterpoint through XML. 65 65 66 virtual void changedGametype(); //!< Is called when the gametype has changed.67 68 66 /** 69 67 @brief Set the width of the playing field. -
code/trunk/src/modules/tetris/TetrisScore.cc
r10262 r10624 118 118 119 119 if (this->getOwner() != NULL && this->getOwner()->getGametype()) 120 this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype() .get());120 this->owner_ = orxonox_cast<Tetris*>(this->getOwner()->getGametype()); 121 121 else 122 122 this->owner_ = 0; -
code/trunk/src/modules/towerdefense/CMakeLists.txt
r10622 r10624 11 11 12 12 ORXONOX_ADD_LIBRARY(towerdefense 13 MODULE13 PLUGIN 14 14 FIND_HEADER_FILES 15 15 LINK_LIBRARIES -
code/trunk/src/modules/towerdefense/TDCoordinate.h
r10622 r10624 2 2 #define _TDCoordinate_H__ 3 3 4 #include "core/CoreIncludes.h"5 4 #include "TDCoordinate.h" 6 5 //#include "towerdefense/TowerDefense.h" … … 13 12 //Class to save the Coordinates in a class instead of struct 14 13 //Convert 2d coordinates to 3d in order to set waypoints 15 class _TowerDefenseExport TDCoordinate : public OrxonoxClass14 class _TowerDefenseExport TDCoordinate 16 15 { 17 16 public: -
code/trunk/src/modules/towerdefense/TowerDefense.cc
r10622 r10624 85 85 #include "core/CoreIncludes.h" 86 86 /* Part of a temporary hack to allow the player to add towers */ 87 #include "core/command/ConsoleCommand .h"87 #include "core/command/ConsoleCommandIncludes.h" 88 88 #include <cmath> 89 89 -
code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.cc
r10622 r10624 83 83 /** 84 84 @brief 85 Is called when the gametype has changed.86 */87 void TowerDefenseCenterpoint::changedGametype()88 {89 SUPER(TowerDefenseCenterpoint, changedGametype);90 91 // Check, whether it's still TowerDefense.92 this->checkGametype();93 }94 95 /**96 @brief97 85 Checks whether the gametype is TowerDefense and if it is, sets its centerpoint. 98 86 */ … … 102 90 { 103 91 // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point 104 TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype() .get());92 TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype()); 105 93 towerDefenseGametype->setCenterpoint(this); 106 94 } -
code/trunk/src/modules/towerdefense/TowerDefenseCenterpoint.h
r10622 r10624 53 53 54 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 55 virtual void changedGametype();56 55 57 56 /** -
code/trunk/src/modules/towerdefense/TowerDefenseEnemy.cc
r10622 r10624 29 29 this->setCollisionType(WorldEntity::Dynamic); 30 30 //needed to keep track of the PlayerStats coded in TowerDefense.h 31 this->td = orxonox_cast<TowerDefense*>(this->getGametype() .get());31 this->td = orxonox_cast<TowerDefense*>(this->getGametype()); 32 32 once_=false; 33 33 … … 53 53 } 54 54 55 WeakPtr<TowerDefense>TowerDefenseEnemy::getGame()55 TowerDefense* TowerDefenseEnemy::getGame() 56 56 { 57 57 if (game == NULL) -
code/trunk/src/modules/towerdefense/TowerDefenseEnemy.h
r10258 r10624 47 47 48 48 private: 49 WeakPtr<TowerDefense>getGame();49 TowerDefense* getGame(); 50 50 WeakPtr<TowerDefense> game; 51 51 TowerDefense* td; -
code/trunk/src/modules/towerdefense/TowerDefenseHUDController.cc
r10258 r10624 80 80 if (this->getOwner() && this->getOwner()->getGametype()) 81 81 { 82 this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype() .get());82 this->td = orxonox_cast<TowerDefense*>(this->getOwner()->getGametype()); 83 83 } 84 84 else -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc
r9667 r10624 54 54 this->particles_->setKeepParticlesInLocalSpace(0); 55 55 56 this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT); 56 for (unsigned int i = 0; i < this->particles_->getNumEmitters(); ++i) 57 this->particles_->getEmitter(i)->setDirection(-WorldEntity::FRONT); 57 58 } 58 59 else
Note: See TracChangeset
for help on using the changeset viewer.