Changeset 10557 for code/branches/core7/src
- Timestamp:
- Aug 29, 2015, 6:18:30 PM (9 years ago)
- Location:
- code/branches/core7/src
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/modules/dodgerace/DodgeRace.cc
r10357 r10557 75 75 for (int i = 0; i < 7; i++) 76 76 { 77 WeakPtr<BigExplosion>chunk = new BigExplosion(this->center_->getContext());77 BigExplosion* chunk = new BigExplosion(this->center_->getContext()); 78 78 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 79 79 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() … … 91 91 if (getPlayer() != NULL) 92 92 { 93 //WeakPtr<DodgeRaceShip> ship = getPlayer();94 95 93 currentPosition = getPlayer()->getWorldPosition().x; 96 94 counter = counter + (currentPosition - lastPosition); … … 113 111 for(int i = 0; i<6; i++) 114 112 { 115 WeakPtr<DodgeRaceCube>cube = new DodgeRaceCube(this->center_->getContext());113 DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext()); 116 114 cubeList.push_back(cube); 117 115 switch(pattern) … … 138 136 } 139 137 140 WeakPtr<DodgeRaceShip>DodgeRace::getPlayer()138 DodgeRaceShip* DodgeRace::getPlayer() 141 139 { 142 140 if (player == NULL) -
code/branches/core7/src/modules/dodgerace/DodgeRace.h
r10357 r10557 105 105 Timer endGameTimer; 106 106 107 WeakPtr<DodgeRaceShip>getPlayer();107 DodgeRaceShip* getPlayer(); 108 108 WeakPtr<DodgeRaceShip> player; 109 109 std::vector<DodgeRaceCube*> cubeList; -
code/branches/core7/src/modules/dodgerace/DodgeRaceShip.cc
r10357 r10557 90 90 91 91 // Camera 92 WeakPtr<Camera>camera = this->getCamera();92 Camera* camera = this->getCamera(); 93 93 if (camera != NULL) 94 94 { … … 150 150 } 151 151 152 WeakPtr<DodgeRace>DodgeRaceShip::getGame()152 DodgeRace* DodgeRaceShip::getGame() 153 153 { 154 154 if (game == NULL) -
code/branches/core7/src/modules/dodgerace/DodgeRaceShip.h
r10357 r10557 78 78 private: 79 79 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 80 WeakPtr<DodgeRace>getGame();80 DodgeRace* getGame(); 81 81 WeakPtr<DodgeRace> game; 82 82 WeakPtr<WorldEntity> lastEntity; -
code/branches/core7/src/modules/invader/Invader.cc
r9961 r10557 87 87 for (int i = 0; i < 7; i++) 88 88 { 89 WeakPtr<BigExplosion>chunk = new BigExplosion(this->center_->getContext());89 BigExplosion* chunk = new BigExplosion(this->center_->getContext()); 90 90 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 91 91 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() … … 99 99 } 100 100 101 WeakPtr<InvaderShip>Invader::getPlayer()101 InvaderShip* Invader::getPlayer() 102 102 { 103 103 if (player == NULL) … … 116 116 for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++) 117 117 { 118 WeakPtr<InvaderEnemy>newPawn;118 InvaderEnemy* newPawn; 119 119 if (rand() % 42/(1 + level*level) == 0) 120 120 { -
code/branches/core7/src/modules/invader/Invader.h
r9943 r10557 78 78 private: 79 79 void toggleShowLevel(){bShowLevel = !bShowLevel;} 80 WeakPtr<InvaderShip>getPlayer();80 InvaderShip* getPlayer(); 81 81 WeakPtr<InvaderCenterPoint> center_; 82 82 WeakPtr<InvaderShip> player; -
code/branches/core7/src/modules/invader/InvaderEnemy.cc
r9961 r10557 69 69 } 70 70 71 WeakPtr<Invader>InvaderEnemy::getGame()71 Invader* InvaderEnemy::getGame() 72 72 { 73 73 if (game == NULL) -
code/branches/core7/src/modules/invader/InvaderEnemy.h
r9943 r10557 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/branches/core7/src/modules/invader/InvaderShip.cc
r9943 r10557 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/branches/core7/src/modules/invader/InvaderShip.h
r9943 r10557 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/branches/core7/src/modules/invader/InvaderWeapon.cc
r10216 r10557 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/branches/core7/src/modules/jump/JumpEnemy.cc
r10262 r10557 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/branches/core7/src/modules/jump/JumpEnemy.h
r10262 r10557 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/branches/core7/src/modules/jump/JumpItem.cc
r10262 r10557 109 109 } 110 110 111 void JumpItem::setFigure( WeakPtr<JumpFigure>newFigure)111 void JumpItem::setFigure(JumpFigure* newFigure) 112 112 { 113 113 figure_ = newFigure; -
code/branches/core7/src/modules/jump/JumpItem.h
r10262 r10557 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/branches/core7/src/modules/jump/JumpPlatform.cc
r10262 r10557 125 125 } 126 126 127 void JumpPlatform::setFigure( WeakPtr<JumpFigure>newFigure)127 void JumpPlatform::setFigure(JumpFigure* newFigure) 128 128 { 129 129 figure_ = newFigure; -
code/branches/core7/src/modules/jump/JumpPlatform.h
r10262 r10557 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/branches/core7/src/modules/jump/JumpProjectile.cc
r10262 r10557 84 84 } 85 85 86 void JumpProjectile::setFigure( WeakPtr<JumpFigure>figure)86 void JumpProjectile::setFigure(JumpFigure* figure) 87 87 { 88 88 figure_ = figure; -
code/branches/core7/src/modules/jump/JumpProjectile.h
r10262 r10557 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/branches/core7/src/modules/objects/triggers/DistanceTrigger.cc
r9667 r10557 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/branches/core7/src/modules/tetris/Tetris.h
r10555 r10557 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 -
code/branches/core7/src/modules/towerdefense/TowerDefenseEnemy.cc
r10258 r10557 49 49 } 50 50 51 WeakPtr<TowerDefense>TowerDefenseEnemy::getGame()51 TowerDefense* TowerDefenseEnemy::getGame() 52 52 { 53 53 if (game == NULL) -
code/branches/core7/src/modules/towerdefense/TowerDefenseEnemy.h
r10258 r10557 47 47 48 48 private: 49 WeakPtr<TowerDefense>getGame();49 TowerDefense* getGame(); 50 50 WeakPtr<TowerDefense> game; 51 51 TowerDefense* td; -
code/branches/core7/src/orxonox/gametypes/Dynamicmatch.cc
r9945 r10557 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/branches/core7/src/orxonox/gametypes/Dynamicmatch.h
r9676 r10557 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/branches/core7/src/orxonox/infos/PlayerInfo.cc
r10362 r10557 186 186 187 187 this->controllableEntity_->destroyHud(); // HACK-ish 188 this->previousControllableEntity_.push_back( WeakPtr<ControllableEntity>(this->controllableEntity_));188 this->previousControllableEntity_.push_back(this->controllableEntity_); 189 189 this->controllableEntity_ = entity; 190 190 this->controllableEntityID_ = entity->getObjectID(); -
code/branches/core7/src/orxonox/interfaces/InterfaceCompilation.cc
r10362 r10557 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 -
code/branches/core7/src/orxonox/sound/SoundManager.cc
r10555 r10557 419 419 } 420 420 421 void SoundManager::fadeIn( const StrongPtr<AmbientSound>&sound)421 void SoundManager::fadeIn(AmbientSound* sound) 422 422 { 423 423 // If we're already fading out --> remove that … … 435 435 } 436 436 437 void SoundManager::fadeOut( const StrongPtr<AmbientSound>&sound)437 void SoundManager::fadeOut(AmbientSound* sound) 438 438 { 439 439 // If we're already fading in --> remove that -
code/branches/core7/src/orxonox/sound/SoundManager.h
r10555 r10557 106 106 private: 107 107 void processCrossFading(float dt); 108 void fadeIn( const StrongPtr<AmbientSound>&sound);109 void fadeOut( const StrongPtr<AmbientSound>&sound);108 void fadeIn(AmbientSound* sound); 109 void fadeOut(AmbientSound* sound); 110 110 111 111 void checkFadeStepValidity();
Note: See TracChangeset
for help on using the changeset viewer.