Changeset 11083 for code/trunk/src/modules
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/modules
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/gametypes/SpaceRaceController.cc
r11071 r11083 397 397 bool SpaceRaceController::vergleicheQuader(const Vector3& pointToPoint, const Vector3& groesse) 398 398 { 399 if( abs(pointToPoint.x) < groesse.x)399 if(std::abs(pointToPoint.x) < groesse.x) 400 400 return true; 401 if( abs(pointToPoint.y) < groesse.y)401 if(std::abs(pointToPoint.y) < groesse.y) 402 402 return true; 403 if( abs(pointToPoint.z) < groesse.z)403 if(std::abs(pointToPoint.z) < groesse.z) 404 404 return true; 405 405 return false; -
code/trunk/src/modules/hover/TimeHUD.cc
r11071 r11083 82 82 { 83 83 this->setCaption(getTimeString(this->time_)); 84 if (this->hoverGame_->getNumberOfFlags() == 0) 85 setRunning(false); 84 86 } 85 if(this->hoverGame_->getNumberOfFlags() == 0)86 setRunning(false);87 87 88 88 } -
code/trunk/src/modules/invader/Invader.cc
r11071 r11083 129 129 newPawn->addTemplate("enemyinvader"); 130 130 } 131 newPawn->set Player(player);131 newPawn->setInvaderPlayer(player); 132 132 newPawn->level = level; 133 133 // spawn enemy at random points in front of player. -
code/trunk/src/modules/invader/InvaderEnemy.cc
r11071 r11083 58 58 if (player != nullptr) 59 59 { 60 float newZ = 2/(pow( abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);60 float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); 61 61 setVelocity(Vector3(1000.f - level * 100 , 0, newZ)); 62 62 } -
code/trunk/src/modules/invader/InvaderEnemy.h
r11071 r11083 49 49 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 50 50 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override; 51 virtual void set Player(InvaderShip* player){this->player = player;}51 virtual void setInvaderPlayer(InvaderShip* player){this->player = player;} 52 52 53 53 int level; -
code/trunk/src/modules/invader/InvaderEnemyShooter.cc
r11071 r11083 63 63 float distPlayer = player->getPosition().z - getPosition().z; 64 64 // orxout() << "i'm different!" << endl; 65 float newZ = 2/(pow( abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;66 setVelocity(Vector3(950 - abs(distPlayer), 0, newZ));65 float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer; 66 setVelocity(Vector3(950 - std::abs(distPlayer), 0, newZ)); 67 67 } 68 68 Pawn::tick(dt); -
code/trunk/src/modules/objects/ForceField.cc
r11071 r11083 63 63 //Standard Values 64 64 this->setDirection(Vector3::ZERO); 65 this->set Velocity(100);65 this->setFieldVelocity(100); 66 66 this->setDiameter(500); 67 67 this->setMassDiameter(0); //! We allow point-masses … … 88 88 SUPER(ForceField, XMLPort, xmlelement, mode); 89 89 90 XMLPortParam(ForceField, "velocity", set Velocity, getVelocity, xmlelement, mode).defaultValues(100);90 XMLPortParam(ForceField, "velocity", setFieldVelocity, getFieldVelocity, xmlelement, mode).defaultValues(100); 91 91 XMLPortParam(ForceField, "diameter", setDiameter, getDiameter, xmlelement, mode).defaultValues(500); 92 92 XMLPortParam(ForceField, "massDiameter", setMassDiameter, getMassDiameter, xmlelement, mode).defaultValues(0); -
code/trunk/src/modules/objects/ForceField.h
r11071 r11083 98 98 @param vel The velocity to be set. 99 99 */ 100 inline void set Velocity(float vel)100 inline void setFieldVelocity(float vel) 101 101 { this->velocity_ = vel; } 102 102 /** … … 104 104 @return Returns the velocity of the ForceField. 105 105 */ 106 inline float get Velocity()106 inline float getFieldVelocity() 107 107 { return this->velocity_; } 108 108 -
code/trunk/src/modules/objects/SpaceBoundaries.cc
r11071 r11083 221 221 } 222 222 } 223 if(/* humanItem &&*/ abs(this->maxDistance_ - distance) < this->showDistance_ )223 if(/* humanItem &&*/ std::abs(this->maxDistance_ - distance) < this->showDistance_ ) 224 224 { 225 225 this->displayBoundaries(currentPawn, 1.0f - fabs(this->maxDistance_ - distance) / this->showDistance_); // Show the boundary -
code/trunk/src/modules/objects/triggers/DistanceTrigger.h
r11071 r11083 97 97 virtual ~DistanceTrigger(); 98 98 99 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ; // Method for creating a DistanceTrigger object through XML.99 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; // Method for creating a DistanceTrigger object through XML. 100 100 101 101 void addTarget(const std::string& targets); // Add some target to the DistanceTrigger. -
code/trunk/src/modules/objects/triggers/EventTrigger.h
r11071 r11083 73 73 virtual ~EventTrigger(); 74 74 75 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) ; // Creates an event port.75 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; // Creates an event port. 76 76 77 77 /** -
code/trunk/src/modules/overlays/hud/ChatOverlay.cc
r11071 r11083 73 73 Timer* timer = new Timer(); 74 74 this->timers_.insert(timer); // store the timer in a set to destroy it in the destructor 75 const ExecutorPtr &executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this));75 const ExecutorPtr executor = createExecutor(createFunctor(&ChatOverlay::dropMessage, this)); 76 76 executor->setDefaultValues(timer); 77 77 timer->setTimer(this->displayTime_, false, executor, true); -
code/trunk/src/modules/pickup/items/ShrinkPickup.cc
r11071 r11083 277 277 { 278 278 Pawn* pawn = this->carrierToPawnHelper(); 279 if(pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 279 if (pawn == nullptr) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 280 { 280 281 this->Pickupable::destroy(); 282 return; 283 } 281 284 282 285 this->timeRemainig_ -= dt; -
code/trunk/src/modules/pong/Pong.cc
r11071 r11083 326 326 PlayerInfo* Pong::getLeftPlayer() const 327 327 { 328 if (this->bat_ != nullptr && this->bat_[0] != nullptr)328 if (this->bat_[0] != nullptr) 329 329 return this->bat_[0]->getPlayer(); 330 330 else … … 340 340 PlayerInfo* Pong::getRightPlayer() const 341 341 { 342 if (this->bat_ != nullptr && this->bat_[1] != nullptr)342 if (this->bat_[1] != nullptr) 343 343 return this->bat_[1]->getPlayer(); 344 344 else -
code/trunk/src/modules/questsystem/QuestListener.cc
r11071 r11083 81 81 XMLPortParam(QuestListener, "mode", setMode, getMode, xmlelement, mode); 82 82 83 if(this->quest_ != nullptr) 83 std::string questid; 84 85 if (this->quest_ != nullptr) 86 { 84 87 this->quest_->addListener(this); // Adds the QuestListener to the Quests list of listeners. 85 86 orxout(verbose, context::quests) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << endl; 88 questid = this->quest_->getId(); 89 } 90 91 orxout(verbose, context::quests) << "QuestListener created for quest: {" << questid << "} with mode '" << this->getMode() << "'." << endl; 87 92 } 88 93 -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h
r11071 r11083 61 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method for creating a ChangeQuestStatus object through XML. 62 62 63 virtual bool invoke(PlayerInfo* player) = 0; //!< Invokes the QuestEffect.64 65 63 protected: 66 64 /** -
code/trunk/src/modules/tetris/Tetris.cc
r11071 r11083 140 140 const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone 141 141 142 if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())142 if((position.x == currentStonePosition.x) && std::abs(position.y-currentStonePosition.y) < this->center_->getStoneSize()) 143 143 return false; 144 144 } … … 222 222 if(position.y < this->center_->getStoneSize()/2.0f) //!< If the stone has reached the bottom of the level 223 223 { 224 float baseOffset = abs(stone->getPosition().y);224 float baseOffset = std::abs(stone->getPosition().y); 225 225 if (this->activeBrick_->getRotationCount() == 1 || this->activeBrick_->getRotationCount() == 3) 226 baseOffset = abs(stone->getPosition().x);226 baseOffset = std::abs(stone->getPosition().x); 227 227 float yOffset = baseOffset + this->center_->getStoneSize()/2.0f;//calculate offset 228 228 if(yOffset < 0) //catch brake-throughs -
code/trunk/src/modules/tetris/TetrisBrick.cc
r11071 r11083 213 213 { 214 214 const Vector3& position = this->getPosition(); 215 Vector3 newPos = Vector3(position.x+value.x/ abs(value.x)*this->size_, position.y, position.z);215 Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z); 216 216 if(!this->isValidMove(newPos)) 217 217 return; -
code/trunk/src/modules/tetris/TetrisStone.cc
r9667 r11083 92 92 { 93 93 const Vector3& position = this->getPosition(); 94 Vector3 newPos = Vector3(position.x+value.x/ abs(value.x)*this->size_, position.y, position.z);94 Vector3 newPos = Vector3(position.x+value.x/std::abs(value.x)*this->size_, position.y, position.z); 95 95 if(!this->tetris_->isValidMove(this, newPos)) 96 96 return; -
code/trunk/src/modules/towerdefense/TDCoordinate.cc
r10629 r11083 66 66 float tileScale = 100; 67 67 68 Vector3 *coord = new Vector3();69 coord ->x= (_x-8) * tileScale;70 coord ->y= (_y-8) * tileScale;71 coord ->z=0;68 Vector3 coord; 69 coord.x= (_x-8) * tileScale; 70 coord.y= (_y-8) * tileScale; 71 coord.z=0; 72 72 73 return *coord;73 return coord; 74 74 } 75 75 } -
code/trunk/src/modules/towerdefense/TowerDefense.cc
r11071 r11083 377 377 { 378 378 TowerDefenseField* thisField = fields_[thisCoord->GetX()][thisCoord->GetY()]; 379 TDCoordinate* nextCoord = new TDCoordinate(0,0);380 379 381 380 if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START) … … 384 383 } 385 384 385 TDCoordinate* nextCoord = new TDCoordinate(0, 0); 386 386 387 if (thisField->getAngle() == 0) 387 388 { … … 406 407 } 407 408 409 delete nextCoord; 408 410 return nullptr; 409 411 } -
code/trunk/src/modules/weapons/projectiles/GravityBombField.cc
r11071 r11083 34 34 fieldExploded_ = false; 35 35 36 set Velocity(FORCE_SPHERE_START_STRENGTH);36 setFieldVelocity(FORCE_SPHERE_START_STRENGTH); 37 37 setDiameter(2*FORCE_SPHERE_START_RADIUS); 38 38 setMode(modeSphere_s); … … 158 158 159 159 setDiameter(forceSphereRadius_*2); 160 set Velocity(forceStrength_);160 setFieldVelocity(forceStrength_); 161 161 if(lifetime_>0) particleSphere_->setScale(forceSphereRadius_/FORCE_SPHERE_START_RADIUS); 162 162 bombModel_->setScale(modelScaling_);
Note: See TracChangeset
for help on using the changeset viewer.