Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 19, 2009, 5:31:02 PM (15 years ago)
Author:
rgrieder
Message:

Merged all remaining revisions from core4 back to the trunk.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r3280 r3327  
    3838#include <OgreRenderWindow.h>
    3939
    40 #include "core/ConfigValueIncludes.h"
     40#include "util/Convert.h"
    4141#include "core/Clock.h"
     42#include "core/CommandExecutor.h"
    4243#include "core/ConsoleCommand.h"
    4344#include "core/Core.h"
    44 #include "core/CoreIncludes.h"
    4545#include "core/Game.h"
    4646#include "core/GameMode.h"
    4747#include "core/input/InputManager.h"
    4848#include "core/input/KeyBinder.h"
    49 #include "core/input/SimpleInputState.h"
     49#include "core/input/InputState.h"
    5050#include "core/Loader.h"
    5151#include "core/XMLFile.h"
     
    7070        , debugOverlay_(0)
    7171    {
    72         RegisterRootObject(GSGraphics);
    7372    }
    7473
    7574    GSGraphics::~GSGraphics()
    76     {
    77     }
    78 
    79     /**
    80     @brief
    81         this function does nothing
    82 
    83         Indeed. Here goes nothing.
    84     */
    85     void GSGraphics::setConfigValues()
    8675    {
    8776    }
     
    10695        GameMode::setShowsGraphics(true);
    10796
    108         setConfigValues();
    109 
    11097        // Load OGRE including the render window
    11198        this->graphicsManager_ = new GraphicsManager();
     
    122109
    123110        // Calls the InputManager which sets up the input devices.
    124         inputManager_ = new InputManager();
    125         inputManager_->initialise(windowHnd, renderWindow->getWidth(), renderWindow->getHeight(), true);
     111        inputManager_ = new InputManager(windowHnd);
    126112
    127113        // load master key bindings
    128         masterInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("master", true);
     114        masterInputState_ = InputManager::getInstance().createInputState("master", true);
    129115        masterKeyBinder_ = new KeyBinder();
    130116        masterKeyBinder_->loadBindings("masterKeybindings.ini");
     
    136122        // Load the InGameConsole
    137123        console_ = new InGameConsole();
    138         console_->initialise(renderWindow->getWidth(), renderWindow->getHeight());
     124        console_->initialise();
    139125
    140126        // load the CEGUI interface
     
    149135
    150136        // enable master input
    151         InputManager::getInstance().requestEnterState("master");
     137        InputManager::getInstance().enterState("master");
    152138    }
    153139
     
    169155
    170156        masterInputState_->setHandler(0);
    171         InputManager::getInstance().requestDestroyState("master");
     157        InputManager::getInstance().destroyState("master");
    172158        delete this->masterKeyBinder_;
    173159
     
    232218        this->graphicsManager_->update(time);
    233219    }
    234 
    235     /**
    236     @brief
    237         Window has resized.
    238     @param rw
    239         The render window it occured in
    240     @note
    241         GraphicsManager has a render window stored itself. This is the same
    242         as rw. But we have to be careful when using multiple render windows!
    243     */
    244     void GSGraphics::windowResized(unsigned int newWidth, unsigned int newHeight)
    245     {
    246         // OIS needs this under linux even if we only use relative input measurement.
    247         if (this->inputManager_)
    248             this->inputManager_->setWindowExtents(newWidth, newHeight);
    249     }
    250 
    251     /**
    252     @brief
    253         Window focus has changed.
    254     @param rw
    255         The render window it occured in
    256     */
    257     void GSGraphics::windowFocusChanged()
    258     {
    259         // instruct InputManager to clear the buffers (core library so we cannot use the interface)
    260         if (this->inputManager_)
    261             this->inputManager_->clearBuffers();
    262     }
    263 
    264220}
Note: See TracChangeset for help on using the changeset viewer.