Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 27, 2009, 1:57:28 PM (15 years ago)
Author:
rgrieder
Message:

Moved some GameState code from activate/deactivate to the c'tor and d'tor. This should allow for faster GS switching.
But be careful: Only load in the c'tor what you're sure is available. For instance GSLevel doesn't require graphics, it's just an option. So loading graphical stuff in in the c'tor would be fatal because at this time it is not yet clear whether there will even be graphics (GameMode::showsGraphics() will yield false!).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/orxonox/gamestates/GSGraphics.cc

    r3355 r3357  
    6565        , debugOverlay_(0)
    6666    {
     67        // load master key bindings
     68        masterInputState_ = InputManager::getInstance().createInputState("master", true);
     69        masterKeyBinder_ = new KeyBinder();
    6770    }
    6871
    6972    GSGraphics::~GSGraphics()
    7073    {
     74        InputManager::getInstance().destroyState("master");
     75        delete this->masterKeyBinder_;
    7176    }
    7277
     
    9297        this->debugOverlay_ = new XMLFile(Core::getMediaPathString() + "overlay/debug.oxo");
    9398        Loader::open(debugOverlay_);
    94         // load master key bindings
    95         masterInputState_ = InputManager::getInstance().createInputState("master", true);
    96         masterKeyBinder_ = new KeyBinder();
     99
    97100        masterKeyBinder_->loadBindings("masterKeybindings.ini");
    98101        masterInputState_->setKeyHandler(masterKeyBinder_);
     
    130133        }
    131134*/
    132 
    133         masterInputState_->setHandler(0);
    134         InputManager::getInstance().destroyState("master");
    135         delete this->masterKeyBinder_;
    136135
    137136        delete this->console_;
Note: See TracChangeset for help on using the changeset viewer.