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:
7 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}
  • code/trunk/src/orxonox/gamestates/GSGraphics.h

    r3280 r3327  
    3737
    3838#include "OrxonoxPrereqs.h"
    39 
    4039#include "core/GameState.h"
    41 #include "interfaces/WindowEventListener.h"
    4240
    4341namespace orxonox
     
    4947        This game state is only left out if we start a dedicated server where no graphics are present.
    5048    */
    51     class _OrxonoxExport GSGraphics : public GameState, public WindowEventListener
     49    class _OrxonoxExport GSGraphics : public GameState
    5250    {
    5351    public:
    5452        GSGraphics(const GameStateConstrParams& params);
    5553        ~GSGraphics();
    56         void setConfigValues();
    5754
    5855        void activate();
     
    6360
    6461    private:
    65         // Window events from WindowEventListener
    66         void windowResized(unsigned int newWidth, unsigned int newHeight);
    67         void windowFocusChanged();
    68 
    6962        // managed singletons
    7063        InputManager*         inputManager_;        //!< Reference to input management
     
    7568
    7669        KeyBinder*            masterKeyBinder_;     //!< Key binder for master key bindings
    77         SimpleInputState*     masterInputState_;    //!< Special input state for master input
     70        InputState*           masterInputState_;    //!< Special input state for master input
    7871        XMLFile*              debugOverlay_;
    7972        ConsoleCommand*       ccToggleGUI_;         //!< Console command to toggle GUI
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r3280 r3327  
    3131
    3232#include "core/input/InputManager.h"
    33 #include "core/input/SimpleInputState.h"
     33#include "core/input/InputState.h"
    3434#include "core/input/KeyBinder.h"
    3535#include "core/Clock.h"
     
    9090        if (GameMode::showsGraphics())
    9191        {
    92             gameInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game");
     92            gameInputState_ = InputManager::getInstance().createInputState("game");
    9393            keyBinder_ = new KeyBinder();
    9494            keyBinder_->loadBindings("keybindings.ini");
    9595            gameInputState_->setHandler(keyBinder_);
    9696
    97             guiMouseOnlyInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("guiMouseOnly");
     97            guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly");
    9898            guiMouseOnlyInputState_->setMouseHandler(GUIManager::getInstancePtr());
    9999
    100             guiKeysOnlyInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("guiKeysOnly");
     100            guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
    101101            guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
    102102
     
    134134
    135135            // level is loaded: we can start capturing the input
    136             InputManager::getInstance().requestEnterState("game");
     136            InputManager::getInstance().enterState("game");
    137137        }
    138138    }
     
    144144            GUIManager::getInstance().showGUI("inGameTest");
    145145            GUIManager::getInstance().executeCode("showCursor()");
    146             InputManager::getInstance().requestEnterState("guiMouseOnly");
     146            InputManager::getInstance().enterState("guiMouseOnly");
    147147        }
    148148        else
     
    150150            GUIManager::getInstance().executeCode("hideGUI(\"inGameTest\")");
    151151            GUIManager::getInstance().executeCode("hideCursor()");
    152             InputManager::getInstance().requestLeaveState("guiMouseOnly");
     152            InputManager::getInstance().leaveState("guiMouseOnly");
    153153        }
    154154    }
     
    178178
    179179        if (GameMode::showsGraphics())
    180             InputManager::getInstance().requestLeaveState("game");
     180            InputManager::getInstance().leaveState("game");
    181181
    182182        if (GameMode::isMaster())
     
    218218            guiMouseOnlyInputState_->setHandler(0);
    219219            guiKeysOnlyInputState_->setHandler(0);
    220             InputManager::getInstance().requestDestroyState("game");
     220            InputManager::getInstance().destroyState("game");
    221221            if (this->keyBinder_)
    222222            {
     
    286286                {
    287287                    COUT(0) << "Press any button/key or move a mouse/joystick axis" << std::endl;
    288                     InputManager::getInstance().requestEnterState("detector");
     288                    InputManager::getInstance().enterState("detector");
    289289                    bindingString = command;
    290290                    bTemporarySaved = bTemporary;
     
    301301                    COUT(0) << "Binding string \"" << bindingString << "\" on key '" << name << "'" << std::endl;
    302302                    this->keyBinder_->setBinding(bindingString, name, bTemporarySaved);
    303                     InputManager::getInstance().requestLeaveState("detector");
     303                    InputManager::getInstance().leaveState("detector");
    304304                    bound = true;
    305305                }
  • code/trunk/src/orxonox/gamestates/GSLevel.h

    r3280 r3327  
    6363
    6464        KeyBinder*            keyBinder_;               //!< tool that loads and manages the input bindings
    65         SimpleInputState*     gameInputState_;          //!< input state for normal ingame playing
    66         SimpleInputState*     guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
    67         SimpleInputState*     guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
     65        InputState*           gameInputState_;          //!< input state for normal ingame playing
     66        InputState*           guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
     67        InputState*           guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
    6868        Radar*                radar_;                   //!< represents the Radar (not the HUD part)
    6969        CameraManager*        cameraManager_;           //!< camera manager for this level
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r3280 r3327  
    3232
    3333#include "core/input/InputManager.h"
    34 #include "core/input/SimpleInputState.h"
     34#include "core/input/InputState.h"
    3535#include "core/Game.h"
    3636#include "core/Clock.h"
     
    5757    void GSMainMenu::activate()
    5858    {
    59         inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("mainMenu");
     59        inputState_ = InputManager::getInstance().createInputState("mainMenu");
    6060        inputState_->setHandler(GUIManager::getInstancePtr());
    61         inputState_->setJoyStickHandler(&InputManager::EMPTY_HANDLER);
     61        inputState_->setJoyStickHandler(&InputHandler::EMPTY);
    6262
    6363        // create an empty Scene
     
    9696        }
    9797
    98         InputManager::getInstance().requestEnterState("mainMenu");
     98        InputManager::getInstance().enterState("mainMenu");
    9999
    100100        this->ambient_ = new SoundMainMenu();
     
    106106        delete this->ambient_;
    107107
    108         InputManager::getInstance().requestLeaveState("mainMenu");
    109         InputManager::getInstance().requestDestroyState("mainMenu");
     108        InputManager::getInstance().leaveState("mainMenu");
     109        InputManager::getInstance().destroyState("mainMenu");
    110110
    111111        GUIManager::getInstance().setCamera(0);
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r3280 r3327  
    5353
    5454    private:
    55         SimpleInputState* inputState_;
     55        InputState*      inputState_;
    5656        Scene*            scene_;
    5757        Ogre::Camera*     camera_;
Note: See TracChangeset for help on using the changeset viewer.