Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gamestates/GSClient.h

    r7163 r11071  
    4343        ~GSClient();
    4444
    45         void activate();
    46         void deactivate();
    47         void update(const Clock& time);
     45        virtual void activate() override;
     46        virtual void deactivate() override;
     47        virtual void update(const Clock& time) override;
    4848    };
    4949}
  • code/trunk/src/orxonox/gamestates/GSGraphics.h

    r6417 r11071  
    5353        ~GSGraphics();
    5454
    55         void activate();
    56         void deactivate();
    57         void update(const Clock& time);
     55        virtual void activate() override;
     56        virtual void deactivate() override;
     57        virtual void update(const Clock& time) override;
    5858
    5959    private:
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r10624 r11071  
    6565    GSLevel::GSLevel(const GameStateInfo& info)
    6666        : GameState(info)
    67         , gameInputState_(0)
    68         , guiMouseOnlyInputState_(0)
    69         , guiKeysOnlyInputState_(0)
    70         , startFile_(0)
     67        , gameInputState_(nullptr)
     68        , guiMouseOnlyInputState_(nullptr)
     69        , guiKeysOnlyInputState_(nullptr)
     70        , startFile_(nullptr)
    7171        , bShowIngameGUI_(false)
    7272    {
     
    143143#endif
    144144
    145             gameInputState_->setHandler(0);
    146             guiMouseOnlyInputState_->setHandler(0);
    147             guiKeysOnlyInputState_->setHandler(0);
     145            gameInputState_->setHandler(nullptr);
     146            guiMouseOnlyInputState_->setHandler(nullptr);
     147            guiKeysOnlyInputState_->setHandler(nullptr);
    148148            InputManager::getInstance().destroyState("game");
    149149            InputManager::getInstance().destroyState("guiKeysOnly");
     
    156156        {
    157157            ModifyConsoleCommand(__CC_changeGame_name).deactivate();
    158             ModifyConsoleCommand(__CC_reloadLevel_name).setObject(NULL).deactivate();
     158            ModifyConsoleCommand(__CC_reloadLevel_name).setObject(nullptr).deactivate();
    159159        }
    160160    }
     
    164164        // Note: Temporarily moved to GSRoot.
    165165        //// Call the scene objects
    166         //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
    167         //    it->tick(time.getDeltaTime() * this->timeFactor_);
     166        //for (Tickable* tickable : ObjectList<Tickable>())
     167        //    tickable->tick(time.getDeltaTime() * this->timeFactor_);
    168168    }
    169169
    170170    void GSLevel::prepareObjectTracking()
    171171    {
    172         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    173             this->staticObjects_.insert(*it);
     172        for (BaseObject* baseObject : ObjectList<BaseObject>())
     173            this->staticObjects_.insert(baseObject);
    174174    }
    175175
     
    178178        orxout(internal_info) << "Remaining objects:" << endl;
    179179        unsigned int i = 0;
    180         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    181         {
    182             std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(*it);
     180        for (BaseObject* baseObject : ObjectList<BaseObject>())
     181        {
     182            std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(baseObject);
    183183            if (find == this->staticObjects_.end())
    184184            {
    185                 orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
     185                orxout(internal_warning) << ++i << ": " << baseObject->getIdentifier()->getName() << " (" << baseObject << "), references: " << baseObject->getReferenceCount() << endl;
    186186            }
    187187        }
     
    215215    void GSLevel::unloadLevelAsClient()
    216216    {
    217         for (ObjectList<Level>::iterator it = ObjectList<Level>::begin(); it != ObjectList<Level>::end(); )
     217        ObjectList<Level> listLevel;
     218        for (ObjectList<Level>::iterator it = listLevel.begin(); it != listLevel.end(); )
    218219        {
    219220            StrongPtr<Level> level = *(it++); // StrongPtr prevents that the Level gets destroyed while we loop over it
    220             for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(level); it != ObjectList<BaseObject>::end(level); )
     221            ObjectList<BaseObject> listBaseObject(level);
     222            for (ObjectList<BaseObject>::iterator it = listBaseObject.begin(); it != listBaseObject.end(); )
    221223                (it++)->destroy();
    222224        }
    223225
    224         for (ObjectList<Synchronisable>::iterator it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); )
     226        ObjectList<Synchronisable> listSynchronisable;
     227        for (ObjectList<Synchronisable>::iterator it = listSynchronisable.begin(); it != listSynchronisable.end(); )
    225228        {
    226229            if (it->getSyncMode() != 0x0)
     
    235238        // export all states
    236239        std::vector<GSLevelMementoState*> states;
    237         for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
    238         {
    239             GSLevelMementoState* state = it->exportMementoState();
     240        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
     241        {
     242            GSLevelMementoState* state = memento->exportMementoState();
    240243            if (state)
    241244                states.push_back(state);
     
    247250
    248251        // import all states
    249         for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
    250             it->importMementoState(states);
     252        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
     253            memento->importMementoState(states);
    251254
    252255        // delete states
    253         for (size_t i = 0; i < states.size(); ++i)
    254             delete states[i];
     256        for (GSLevelMementoState* state : states)
     257            delete state;
    255258    }
    256259
  • code/trunk/src/orxonox/gamestates/GSLevel.h

    r10624 r11071  
    4444        ~GSLevel();
    4545
    46         void activate();
    47         void deactivate();
    48         void update(const Clock& time);
     46        virtual void activate() override;
     47        virtual void deactivate() override;
     48        virtual void update(const Clock& time) override;
    4949
    5050        static void startMainMenu(void); //!< Starts the MainMenu
  • code/trunk/src/orxonox/gamestates/GSLevelMemento.h

    r10281 r11071  
    4848        protected:
    4949            /**
    50              * Returns the state of this memento. Returns NULL if no state needed to persist.
     50             * Returns the state of this memento. Returns nullptr if no state needed to persist.
    5151             */
    5252            virtual GSLevelMementoState* exportMementoState() = 0;
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r10624 r11071  
    7373
    7474        // create an empty Scene
    75         this->scene_ = new Scene(NULL);
     75        this->scene_ = new Scene(nullptr);
    7676        this->scene_->setSyncMode( 0x0 );
    7777        // and a Camera
     
    132132        InputManager::getInstance().leaveState("MainMenuHackery");
    133133
    134         GraphicsManager::getInstance().setCamera(0);
     134        GraphicsManager::getInstance().setCamera(nullptr);
    135135        GUIManager::getInstance().setBackgroundImage("");
    136136        GUIManager::hideGUI("MainMenu");
     
    140140        ModifyConsoleCommand(__CC_startClient_name    ).deactivate();
    141141        ModifyConsoleCommand(__CC_startDedicated_name ).deactivate();
    142         ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject(0);
     142        ModifyConsoleCommand(__CC_setMainMenuSoundPath_name).setObject(nullptr);
    143143    }
    144144
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r9667 r11071  
    4444        ~GSMainMenu();
    4545
    46         void activate();
    47         void deactivate();
    48         void update(const Clock& time);
     46        virtual void activate() override;
     47        virtual void deactivate() override;
     48        virtual void update(const Clock& time) override;
    4949
    5050        void setConfigValues();
  • code/trunk/src/orxonox/gamestates/GSMasterServer.h

    r7801 r11071  
    4545      ~GSMasterServer();
    4646
    47       void activate();
    48       void deactivate();
    49       void update(const Clock& time);
     47      virtual void activate() override;
     48      virtual void deactivate() override;
     49      virtual void update(const Clock& time) override;
    5050
    5151    private:
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r10624 r11071  
    3434#include "core/GameMode.h"
    3535#include "core/command/ConsoleCommandIncludes.h"
     36#include "core/object/ObjectList.h"
    3637#include "network/NetworkFunctionIncludes.h"
    3738#include "tools/Timer.h"
     
    7374    {
    7475        unsigned int nr=0;
    75         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
    76         {
    77             Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
     76        for (BaseObject* baseObject : ObjectList<BaseObject>())
     77        {
     78            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(baseObject);
    7879            if (synchronisable)
    79                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
     80                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
    8081            else
    81                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
     82                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << endl;
    8283            nr++;
    8384        }
     
    9899    void GSRoot::deactivate()
    99100    {
    100         ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0);
    101         ModifyConsoleCommand(__CC_getTimeFactor_name).setObject(0);
    102         ModifyConsoleCommand(__CC_setPause_name).setObject(0);
    103         ModifyConsoleCommand(__CC_pause_name).setObject(0);
     101        ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(nullptr);
     102        ModifyConsoleCommand(__CC_getTimeFactor_name).setObject(nullptr);
     103        ModifyConsoleCommand(__CC_setPause_name).setObject(nullptr);
     104        ModifyConsoleCommand(__CC_pause_name).setObject(nullptr);
    104105    }
    105106
     
    112113        }
    113114
    114         for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
     115        ObjectList<Timer> listTimer;
     116        for (ObjectList<Timer>::iterator it = listTimer.begin(); it; )
    115117        {
    116118            Timer* object = *it;
     
    128130        }
    129131        float realdt = leveldt * TimeFactorListener::getTimeFactor();
    130         for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; )
     132        ObjectList<Tickable> listTickable;
     133        for (ObjectList<Tickable>::iterator it = listTickable.begin(); it; )
    131134        {
    132135            Tickable* object = *it;
  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r8706 r11071  
    4444        static void printObjects();
    4545
    46         void activate();
    47         void deactivate();
    48         void update(const Clock& time);
     46        virtual void activate() override;
     47        virtual void deactivate() override;
     48        virtual void update(const Clock& time) override;
    4949
    5050        // this has to be public because proteced triggers a bug in msvc
     
    5959
    6060    protected:
    61         virtual void changedTimeFactor(float factor_new, float factor_old);
     61        virtual void changedTimeFactor(float factor_new, float factor_old) override;
    6262
    6363    private:
  • code/trunk/src/orxonox/gamestates/GSServer.cc

    r10624 r11071  
    4444    GSServer::GSServer(const GameStateInfo& info)
    4545        : GameState(info)
    46         , server_(0)
     46        , server_(nullptr)
    4747    {
    4848    }
  • code/trunk/src/orxonox/gamestates/GSServer.h

    r5929 r11071  
    4343        ~GSServer();
    4444
    45         void activate();
    46         void deactivate();
    47         void update(const Clock& time);
     45        virtual void activate() override;
     46        virtual void deactivate() override;
     47        virtual void update(const Clock& time) override;
    4848
    4949    private:
  • code/trunk/src/orxonox/gamestates/GSStandalone.h

    r5929 r11071  
    4141        ~GSStandalone();
    4242
    43         void activate();
    44         void deactivate();
    45         void update(const Clock& time);
     43        virtual void activate() override;
     44        virtual void deactivate() override;
     45        virtual void update(const Clock& time) override;
    4646
    4747    private:
Note: See TracChangeset for help on using the changeset viewer.