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:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • 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}
Note: See TracChangeset for help on using the changeset viewer.