Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 10:08:37 PM (15 years ago)
Author:
landauf
Message:

moved setTimeFactor to GSRoot because tickables are currently ticked there

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc

    r2396 r2400  
    4141#include "core/CoreIncludes.h"
    4242#include "core/Core.h"
    43 //#include "objects/Backlight.h"
    4443#include "objects/Tickable.h"
    4544#include "objects/Radar.h"
    46 //#include "tools/ParticleInterface.h"
    4745#include "CameraManager.h"
    4846#include "LevelManager.h"
     
    5654    GSLevel::GSLevel()
    5755//        : GameState<GSGraphics>(name)
    58         : timeFactor_(1.0f)
    59         , keyBinder_(0)
     56        : keyBinder_(0)
    6057        , inputState_(0)
    6158        , radar_(0)
     
    6865        this->ccKeybind_ = 0;
    6966        this->ccTkeybind_ = 0;
    70         this->ccSetTimeFactor_ = 0;
    7167
    7268        setConfigValues();
     
    107103            // create the global LevelManager
    108104            this->levelManager_ = new LevelManager();
    109 
    110             // reset game speed to normal
    111             timeFactor_ = 1.0f;
    112105
    113106            this->loadLevel();
     
    134127            InputManager::getInstance().requestEnterState("game");
    135128        }
    136 
    137         if (Core::isMaster())
    138         {
    139             // time factor console command
    140             FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::setTimeFactor);
    141             functor->setObject(this);
    142             ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");
    143             CommandExecutor::addConsoleCommandShortcut(ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);;
    144         }
    145129    }
    146130
     
    152136            delete this->ccKeybind_;
    153137            this->ccKeybind_ = 0;
    154         }
    155         if (this->ccSetTimeFactor_)
    156         {
    157             delete this->ccSetTimeFactor_;
    158             this->ccSetTimeFactor_ = 0;
    159138        }
    160139        if (this->ccTkeybind_)
     
    218197        //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
    219198        //    it->tick(time.getDeltaTime() * this->timeFactor_);
    220     }
    221 
    222     /**
    223     @brief
    224         Changes the speed of Orxonox
    225     */
    226     void GSLevel::setTimeFactor(float factor)
    227     {
    228 /*
    229         float change = factor / this->timeFactor_;
    230 */
    231         this->timeFactor_ = factor;
    232 /*
    233         for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)
    234             it->setSpeedFactor(it->getSpeedFactor() * change);
    235 
    236         for (ObjectList<Backlight>::iterator it = ObjectList<Backlight>::begin(); it; ++it)
    237             it->setTimeFactor(timeFactor_);
    238 */
    239199    }
    240200
Note: See TracChangeset for help on using the changeset viewer.