Changeset 5929 for code/trunk/src/modules/weapons
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/modules/weapons/MuzzleFlash.cc
r5781 r5929 41 41 RegisterObject(MuzzleFlash); 42 42 this->setScale(0.1f); 43 44 this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));45 43 44 this->delayTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&MuzzleFlash::destroy, this))); 46 45 } 47 48 void MuzzleFlash::destroy()49 {50 delete this;51 }52 53 46 } -
code/trunk/src/modules/weapons/MuzzleFlash.h
r5781 r5929 43 43 virtual ~MuzzleFlash() {} 44 44 45 46 47 45 private: 48 void destroy(); 49 Timer<MuzzleFlash> delayTimer_; 50 46 Timer delayTimer_; 51 47 }; 52 48 } -
code/trunk/src/modules/weapons/WeaponsPrereqs.h
r5781 r5929 28 28 29 29 /** 30 @file 31 @brief Contains all the necessary forward declarations for all classes and structs. 30 @file 31 @brief 32 Shared library macros, enums, constants and forward declarations for the weapons module 32 33 */ 33 34 … … 36 37 37 38 #include "OrxonoxConfig.h" 38 39 39 #include "OrxonoxPrereqs.h" 40 40 … … 42 42 // Shared library settings 43 43 //----------------------------------------------------------------------- 44 44 45 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD) 45 46 # ifdef WEAPONS_SHARED_BUILD … … 64 65 namespace orxonox 65 66 { 66 class LaserFire; 67 class MuzzleFlash; 68 69 // munitions 70 class FusionMunition; 71 class LaserMunition; 72 class ReplenishingMunition; 73 74 // projectiles 75 class BillboardProjectile; 76 class LightningGunProjectile; 77 class ParticleProjectile; 78 class Projectile; 79 80 // weaponmodes 81 class EnergyDrink; 67 82 class FusionFire; 68 83 class HsW01; 84 class LaserFire; 69 85 class LightningGun; 70 class EnergyDrink;71 72 class Projectile;73 class BillboardProjectile;74 class ParticleProjectile;75 class LightningGunProjectile;76 77 class ReplenishingMunition;78 class LaserMunition;79 class FusionMunition;80 81 class MuzzleFlash;82 86 } 83 87 -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc
r5781 r5929 44 44 // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the 45 45 // inheriting class, which comes after this constructor) 46 this->replenishingTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer)));46 this->replenishingTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&ReplenishingMunition::initializeTimer, this))); 47 47 } 48 48 … … 50 50 { 51 51 // Initialize the timer 52 this->replenishingTimer_.setTimer(this->replenishIntervall_, true, this, createExecutor(createFunctor(&ReplenishingMunition::replenish)));52 this->replenishingTimer_.setTimer(this->replenishIntervall_, true, createExecutor(createFunctor(&ReplenishingMunition::replenish, this))); 53 53 } 54 54 -
code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h
r5781 r5929 51 51 void initializeTimer(); 52 52 53 Timer <ReplenishingMunition>replenishingTimer_;53 Timer replenishingTimer_; 54 54 }; 55 55 } -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc
r5781 r5929 42 42 this->textureIndex_ = 1; 43 43 this->maxTextureIndex_ = 8; 44 this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));44 this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this))); 45 45 46 46 registerVariables(); -
code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h
r5781 r5929 50 50 unsigned int textureIndex_; 51 51 unsigned int maxTextureIndex_; 52 Timer <LightningGunProjectile>textureTimer_;52 Timer textureTimer_; 53 53 std::string materialBase_; 54 54 private: -
code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc
r5781 r5929 59 59 { 60 60 this->detachOgreObject(this->particles_->getParticleSystem()); 61 delete this->particles_;61 this->particles_->destroy(); 62 62 } 63 63 } -
code/trunk/src/modules/weapons/projectiles/Projectile.cc
r5781 r5929 61 61 this->attachCollisionShape(shape); 62 62 63 this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));63 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Projectile::destroyObject, this))); 64 64 } 65 65 } … … 84 84 85 85 if (this->bDestroy_) 86 delete this;86 this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick() 87 87 } 88 88 … … 90 90 { 91 91 if (GameMode::isMaster()) 92 delete this;92 this->destroy(); 93 93 } 94 94 … … 133 133 } 134 134 135 void Projectile:: destroyedPawn(Pawn* pawn)135 void Projectile::setOwner(Pawn* owner) 136 136 { 137 if (this->owner_ == pawn) 138 this->owner_ = 0; 137 this->owner_ = owner; 139 138 } 140 139 } -
code/trunk/src/modules/weapons/projectiles/Projectile.h
r5781 r5929 33 33 34 34 #include "tools/Timer.h" 35 #include "interfaces/PawnListener.h"36 35 #include "worldentities/MovableEntity.h" 37 36 38 37 namespace orxonox 39 38 { 40 class _WeaponsExport Projectile : public MovableEntity , public PawnListener39 class _WeaponsExport Projectile : public MovableEntity 41 40 { 42 41 public: … … 49 48 virtual void tick(float dt); 50 49 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 51 virtual void destroyedPawn(Pawn* pawn);52 50 53 51 inline void setDamage(float damage) … … 56 54 { return this->damage_; } 57 55 58 inline void setOwner(Pawn* owner) 59 { this->owner_ = owner; } 56 void setOwner(Pawn* owner); 60 57 inline Pawn* getOwner() const 61 58 { return this->owner_; } 62 59 63 60 private: 64 Pawn*owner_;61 WeakPtr<Pawn> owner_; 65 62 float lifetime_; 66 63 float damage_; 67 64 bool bDestroy_; 68 Timer <Projectile>destroyTimer_;65 Timer destroyTimer_; 69 66 }; 70 67 } -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc
r5781 r5929 54 54 this->setMunitionName("FusionMunition"); 55 55 56 this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));56 this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this))); 57 57 this->delayTimer_.stopTimer(); 58 58 } -
code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h
r5781 r5929 59 59 float speed_; 60 60 float delay_; 61 Timer <EnergyDrink>delayTimer_;61 Timer delayTimer_; 62 62 }; 63 63 } -
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
r5781 r5929 54 54 this->setMunitionName("LaserMunition"); 55 55 56 this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));56 this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this))); 57 57 this->delayTimer_.stopTimer(); 58 58 } -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r5781 r5929 57 57 float speed_; 58 58 float delay_; 59 Timer <HsW01>delayTimer_;59 Timer delayTimer_; 60 60 }; 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.