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

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r5781 r5929  
    9090            this->setVelocity(velocity);
    9191
    92             this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));
     92            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
    9393        }
    9494        this->registerVariables();
     
    226226            {
    227227                this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
    228                 delete this->debrisFire1_;
     228                this->debrisFire1_->destroy();
    229229            }
    230230            if (this->debrisSmoke1_)
    231231            {
    232232                this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
    233                 delete this->debrisSmoke1_;
     233                this->debrisSmoke1_->destroy();
    234234            }
    235235
     
    237237            {
    238238                this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
    239                 delete this->debrisFire2_;
     239                this->debrisFire2_->destroy();
    240240            }
    241241            if (this->debrisSmoke2_)
    242242            {
    243243                this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
    244                 delete this->debrisSmoke2_;
     244                this->debrisSmoke2_->destroy();
    245245            }
    246246
     
    248248            {
    249249                this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
    250                 delete this->debrisFire3_;
     250                this->debrisFire3_->destroy();
    251251            }
    252252            if (this->debrisSmoke3_)
    253253            {
    254254                this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
    255                 delete this->debrisSmoke3_;
     255                this->debrisSmoke3_->destroy();
    256256            }
    257257
     
    259259            {
    260260                this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
    261                 delete this->debrisFire4_;
     261                this->debrisFire4_->destroy();
    262262            }
    263263            if (this->debrisSmoke4_)
    264264            {
    265265                this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
    266                 delete this->debrisSmoke4_;
     266                this->debrisSmoke4_->destroy();
    267267            }
    268268        }
     
    329329        {
    330330            this->bStop_ = true;
    331             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy)));
    332         }
    333     }
    334 
    335     void BigExplosion::destroy()
    336     {
    337         delete this;
     331            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
     332        }
    338333    }
    339334
  • code/trunk/src/orxonox/worldentities/BigExplosion.h

    r5781 r5929  
    5757            void checkStop();
    5858            void stop();
    59             void destroy();
    6059            void init();
    6160            void initZero();
     
    9897            ParticleInterface*    explosionFire_;
    9998
    100             LODParticle::Value      LOD_;
    101             Timer<BigExplosion> destroyTimer_;
     99            LODParticle::Value    LOD_;
     100            Timer                destroyTimer_;
    102101    };
    103102}
  • code/trunk/src/orxonox/worldentities/CameraPosition.cc

    r5781 r5929  
    4646        this->bRenderCamera_ = false;
    4747
    48         this->setObjectMode(0x0);
     48        this->setSyncMode(0x0);
    4949    }
    5050
  • code/trunk/src/orxonox/worldentities/ControllableEntity.cc

    r5781 r5929  
    9696
    9797            if (this->xmlcontroller_)
    98                 delete this->xmlcontroller_;
     98                this->xmlcontroller_->destroy();
    9999
    100100            if (this->hud_)
    101                 delete this->hud_;
     101                this->hud_->destroy();
    102102
    103103            if (this->camera_)
    104                 delete this->camera_;
    105 
    106             for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    107                 delete (*it);
     104                this->camera_->destroy();
     105
     106            for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     107                (*it)->destroy();
    108108
    109109            if (this->getScene()->getSceneManager())
     
    153153    {
    154154        unsigned int i = 0;
    155         for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     155        for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    156156        {
    157157            if (i == index)
     
    172172            else if (this->cameraPositions_.size() > 0)
    173173            {
    174                 for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     174                for (std::list<SmartPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    175175                {
    176176                    if ((*it) == this->camera_->getParent())
     
    238238            {
    239239                this->client_overwrite_ = this->server_overwrite_;
    240                 this->setObjectMode(ObjectDirection::Bidirectional);
     240                this->setSyncMode(ObjectDirection::Bidirectional);
    241241            }
    242242        }
     
    254254        this->bHasLocalController_ = false;
    255255        this->bHasHumanController_ = false;
    256         this->setObjectMode(ObjectDirection::ToClient);
     256        this->setSyncMode(ObjectDirection::ToClient);
    257257
    258258        this->changedPlayer();
    259259
    260260        if (this->bDestroyWhenPlayerLeft_)
    261             delete this;
     261            this->destroy();
    262262    }
    263263
     
    275275    void ControllableEntity::startLocalHumanControl()
    276276    {
    277         if (!this->camera_)
     277        if (!this->camera_ && GameMode::showsGraphics())
    278278        {
    279279            this->camera_ = new Camera(this);
     
    287287        }
    288288
    289         if (!this->hud_)
     289        if (!this->hud_ && GameMode::showsGraphics())
    290290        {
    291291            if (this->hudtemplate_ != "")
     
    303303        {
    304304            this->camera_->detachFromParent();
    305             delete this->camera_;
     305            this->camera_->destroy();
    306306            this->camera_ = 0;
    307307        }
     
    309309        if (this->hud_)
    310310        {
    311             delete this->hud_;
     311            this->hud_->destroy();
    312312            this->hud_ = 0;
    313313        }
     
    333333        if (parent)
    334334        {
    335             for (std::list<CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
     335            for (std::list<SmartPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    336336                if ((*it)->getIsAbsolute())
    337337                    parent->attach((*it));
  • code/trunk/src/orxonox/worldentities/ControllableEntity.h

    r5781 r5929  
    104104            void addCameraPosition(CameraPosition* position);
    105105            CameraPosition* getCameraPosition(unsigned int index) const;
    106             inline const std::list<CameraPosition*>& getCameraPositions() const
     106            inline const std::list<SmartPtr<CameraPosition> >& getCameraPositions() const
    107107                { return this->cameraPositions_; }
    108108
     
    198198            float mouseLookSpeed_;
    199199            Ogre::SceneNode* cameraPositionRootNode_;
    200             std::list<CameraPosition*> cameraPositions_;
     200            std::list<SmartPtr<CameraPosition> > cameraPositions_;
    201201            std::string cameraPositionTemplate_;
    202202            Controller* xmlcontroller_;
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.cc

    r5781 r5929  
    7979            this->setVelocity(velocity);
    8080
    81             this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));
     81            this->destroyTimer_.setTimer(rnd(1, 2), false, createExecutor(createFunctor(&ExplosionChunk::stop, this)));
    8282        }
    8383
     
    9292            {
    9393                this->detachOgreObject(this->fire_->getParticleSystem());
    94                 delete this->fire_;
     94                this->fire_->destroy();
    9595            }
    9696            if (this->smoke_)
    9797            {
    9898                this->detachOgreObject(this->smoke_->getParticleSystem());
    99                 delete this->smoke_;
     99                this->smoke_->destroy();
    100100            }
    101101        }
     
    132132        {
    133133            this->bStop_ = true;
    134             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
     134            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionChunk::destroy, this)));
    135135        }
    136     }
    137 
    138     void ExplosionChunk::destroy()
    139     {
    140         delete this;
    141136    }
    142137
  • code/trunk/src/orxonox/worldentities/ExplosionChunk.h

    r5781 r5929  
    5555            void checkStop();
    5656            void stop();
    57             void destroy();
    5857
    5958            bool                  bStop_;
    6059            ParticleInterface*    fire_;
    6160            ParticleInterface*    smoke_;
    62             LODParticle::Value      LOD_;
    63             Timer<ExplosionChunk> destroyTimer_;
     61            LODParticle::Value    LOD_;
     62            Timer                destroyTimer_;
    6463    };
    6564}
  • code/trunk/src/orxonox/worldentities/MovableEntity.cc

    r5781 r5929  
    6161        if (this->isInitialized())
    6262            if (this->continuousResynchroTimer_)
    63                 delete this->continuousResynchroTimer_;
     63                this->continuousResynchroTimer_->destroy();
    6464    }
    6565
     
    9898    void MovableEntity::clientConnected(unsigned int clientID)
    9999    {
    100         this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));
     100        this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, createExecutor(createFunctor(&MovableEntity::resynchronize, this)));
    101101    }
    102102
     
    110110        {
    111111            // Resynchronise every few seconds because we only work with velocities (no positions)
    112             continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
    113                 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);
     112            continuousResynchroTimer_ = new Timer(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
     113                true, createExecutor(createFunctor(&MovableEntity::resynchronize, this)), false);
    114114        }
    115115
  • code/trunk/src/orxonox/worldentities/MovableEntity.h

    r5781 r5929  
    9696            Quaternion overwrite_orientation_;
    9797
    98             Timer<MovableEntity> resynchronizeTimer_;
    99             Timer<MovableEntity>* continuousResynchroTimer_;
     98            Timer resynchronizeTimer_;
     99            Timer* continuousResynchroTimer_;
    100100
    101101            Pawn* owner_;
  • code/trunk/src/orxonox/worldentities/SpawnPoint.cc

    r5781 r5929  
    5050            COUT(1) << "Error: SpawnPoint has no Gametype" << std::endl;
    5151
    52         this->setObjectMode(0x0);
     52        this->setSyncMode(0x0);
    5353    }
    5454
  • code/trunk/src/orxonox/worldentities/SpawnPoint.h

    r5781 r5929  
    3333
    3434#include <string>
    35 #include "core/Identifier.h"
     35#include "core/SubclassIdentifier.h"
    3636#include "worldentities/StaticEntity.h"
    3737
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r5781 r5929  
    119119            {
    120120                if ((*it)->getDeleteWithParent())
    121                     delete (*(it++));
     121                    (*(it++))->destroy();
    122122                else
    123123                {
     
    132132                delete this->physicalBody_;
    133133            }
    134             delete this->collisionShape_;
     134            this->collisionShape_->destroy();
    135135
    136136            this->node_->detachAllObjects();
     
    175175    void WorldEntity::registerVariables()
    176176    {
    177         registerVariable(this->mainStateName_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));
     177        registerVariable(this->mainStateName_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainStateName));
    178178
    179179        registerVariable(this->bActive_,        VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
  • code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc

    r5781 r5929  
    4040        RegisterObject(Destroyer);
    4141
    42         UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype());
     42        UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype().get());
    4343        if (gametype)
    4444        {
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r5781 r5929  
    3636#include "network/NetworkFunction.h"
    3737
    38 #include "interfaces/PawnListener.h"
    3938#include "PawnManager.h"
    4039#include "infos/PlayerInfo.h"
     
    9392        if (this->isInitialized())
    9493        {
    95             for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)
    96                 it->destroyedPawn(this);
    97 
    9894            if (this->weaponSystem_)
    99                 delete this->weaponSystem_;
     95                this->weaponSystem_->destroy();
    10096        }
    10197    }
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r5781 r5929  
    7575    {
    7676        if (this->isInitialized() && this->engine_)
    77             delete this->engine_;
     77            this->engine_->destroy();
    7878    }
    7979
     
    207207                    else
    208208                    {
    209                         delete object;
     209                        object->destroy();
    210210                    }
    211211                }
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.cc

    r5781 r5929  
    145145        ControllableEntity::setPlayer(player);
    146146
    147 //        this->setObjectMode(ObjectDirection::ToClient);
     147//        this->setSyncMode(ObjectDirection::ToClient);
    148148    }
    149149
  • code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r5781 r5929  
    3131
    3232#include "core/CoreIncludes.h"
    33 #include "interfaces/PawnListener.h"
     33#include "controllers/ArtificialController.h"
    3434#include "interfaces/TeamColourable.h"
    3535#include "gametypes/TeamBaseMatch.h"
     
    4545        this->state_ = BaseState::Uncontrolled;
    4646
    47         TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype());
     47        TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype().get());
    4848        if (gametype)
    4949        {
     
    5858        this->fireEvent();
    5959
    60         TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype());
     60        TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype().get());
    6161        if (!gametype)
    6262            return;
     
    9292
    9393        // Call this so bots stop shooting at the base after they converted it
    94         for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)
    95             it->destroyedPawn(this);
     94        for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
     95            it->abandonTarget(this);
    9696    }
    9797}
Note: See TracChangeset for help on using the changeset viewer.