Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2009, 8:20:07 PM (15 years ago)
Author:
rgrieder
Message:

Merged core5 branch back to the trunk.
Key features include clean level unloading and an extended XML event system.

Two important notes:
Delete your keybindings.ini files! * or you will still get parser errors when loading the key bindings.
Delete build_dir/lib/modules/libgamestates.module! * or orxonox won't start.
Best thing to do is to delete the build folder ;)

Location:
code/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/weapons/MuzzleFlash.cc

    r5781 r5929  
    4141        RegisterObject(MuzzleFlash);
    4242        this->setScale(0.1f);
    43        
    44         this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
    4543
     44        this->delayTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&MuzzleFlash::destroy, this)));
    4645    }
    47 
    48     void MuzzleFlash::destroy()
    49     {
    50         delete this;
    51     }
    52  
    5346}
  • code/trunk/src/modules/weapons/MuzzleFlash.h

    r5781 r5929  
    4343            virtual ~MuzzleFlash() {}
    4444
    45 
    46 
    4745        private:
    48             void destroy();
    49             Timer<MuzzleFlash> delayTimer_;
    50 
     46            Timer delayTimer_;
    5147    };
    5248}
  • code/trunk/src/modules/weapons/WeaponsPrereqs.h

    r5781 r5929  
    2828
    2929/**
    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
    3233*/
    3334
     
    3637
    3738#include "OrxonoxConfig.h"
    38 
    3939#include "OrxonoxPrereqs.h"
    4040
     
    4242// Shared library settings
    4343//-----------------------------------------------------------------------
     44
    4445#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
    4546#  ifdef WEAPONS_SHARED_BUILD
     
    6465namespace orxonox
    6566{
    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;
    6782    class FusionFire;
    6883    class HsW01;
     84    class LaserFire;
    6985    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;
    8286}
    8387
  • code/trunk/src/modules/weapons/munitions/ReplenishingMunition.cc

    r5781 r5929  
    4444        // replenishIntervall_ and replenishMunitionAmount_ will be set in the constructor of the
    4545        // 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)));
    4747    }
    4848
     
    5050    {
    5151        // 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)));
    5353    }
    5454
  • code/trunk/src/modules/weapons/munitions/ReplenishingMunition.h

    r5781 r5929  
    5151            void initializeTimer();
    5252
    53             Timer<ReplenishingMunition> replenishingTimer_;
     53            Timer replenishingTimer_;
    5454    };
    5555}
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r5781 r5929  
    4242        this->textureIndex_ = 1;
    4343        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)));
    4545       
    4646        registerVariables();
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h

    r5781 r5929  
    5050            unsigned int textureIndex_;
    5151            unsigned int maxTextureIndex_;
    52             Timer<LightningGunProjectile> textureTimer_;
     52            Timer textureTimer_;
    5353            std::string materialBase_;
    5454      private:
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc

    r5781 r5929  
    5959        {
    6060            this->detachOgreObject(this->particles_->getParticleSystem());
    61             delete this->particles_;
     61            this->particles_->destroy();
    6262        }
    6363    }
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r5781 r5929  
    6161            this->attachCollisionShape(shape);
    6262
    63             this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
     63            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Projectile::destroyObject, this)));
    6464        }
    6565    }
     
    8484
    8585        if (this->bDestroy_)
    86             delete this;
     86            this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick()
    8787    }
    8888
     
    9090    {
    9191        if (GameMode::isMaster())
    92             delete this;
     92            this->destroy();
    9393    }
    9494
     
    133133    }
    134134
    135     void Projectile::destroyedPawn(Pawn* pawn)
     135    void Projectile::setOwner(Pawn* owner)
    136136    {
    137         if (this->owner_ == pawn)
    138             this->owner_ = 0;
     137        this->owner_ = owner;
    139138    }
    140139}
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r5781 r5929  
    3333
    3434#include "tools/Timer.h"
    35 #include "interfaces/PawnListener.h"
    3635#include "worldentities/MovableEntity.h"
    3736
    3837namespace orxonox
    3938{
    40     class _WeaponsExport Projectile : public MovableEntity, public PawnListener
     39    class _WeaponsExport Projectile : public MovableEntity
    4140    {
    4241        public:
     
    4948            virtual void tick(float dt);
    5049            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    51             virtual void destroyedPawn(Pawn* pawn);
    5250
    5351            inline void setDamage(float damage)
     
    5654                { return this->damage_; }
    5755
    58             inline void setOwner(Pawn* owner)
    59                 { this->owner_ = owner; }
     56            void setOwner(Pawn* owner);
    6057            inline Pawn* getOwner() const
    6158                { return this->owner_; }
    6259
    6360        private:
    64             Pawn* owner_;
     61            WeakPtr<Pawn> owner_;
    6562            float lifetime_;
    6663            float damage_;
    6764            bool bDestroy_;
    68             Timer<Projectile> destroyTimer_;
     65            Timer destroyTimer_;
    6966    };
    7067}
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.cc

    r5781 r5929  
    5454        this->setMunitionName("FusionMunition");
    5555
    56         this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&EnergyDrink::shot)));
     56        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&EnergyDrink::shot, this)));
    5757        this->delayTimer_.stopTimer();
    5858    }
  • code/trunk/src/modules/weapons/weaponmodes/EnergyDrink.h

    r5781 r5929  
    5959            float speed_;
    6060            float delay_;
    61             Timer<EnergyDrink> delayTimer_;
     61            Timer delayTimer_;
    6262    };
    6363}
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r5781 r5929  
    5454        this->setMunitionName("LaserMunition");
    5555
    56         this->delayTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&HsW01::shot)));
     56        this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
    5757        this->delayTimer_.stopTimer();
    5858    }
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r5781 r5929  
    5757            float speed_;
    5858            float delay_;
    59             Timer<HsW01> delayTimer_;
     59            Timer delayTimer_;
    6060    };
    6161}
Note: See TracChangeset for help on using the changeset viewer.