Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 16, 2010, 2:50:16 PM (15 years ago)
Author:
rgrieder
Message:

Merged gamestates2 branch back to trunk.
This brings in some heavy changes in the GUI framework.
It should also fix problems with triggered asserts in the InputManager.

Note: PickupInventory does not seem to work —> Segfault when showing because before, the owner in GUIOverlay::setGUIName is already NULL.
I haven't tested it before, so I can't tell whether it's my changes.

Location:
code/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

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

    r6417 r6746  
    6969        {
    7070            gameInputState_ = InputManager::getInstance().createInputState("game");
    71             gameInputState_->setMouseMode(MouseMode::Exclusive);
     71            gameInputState_->setMouseExclusive(TriBool::True);
    7272            gameInputState_->setHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    7373            KeyBinderManager::getInstance().setToDefault();
    7474
    7575            guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly");
    76             guiMouseOnlyInputState_->setMouseMode(MouseMode::Exclusive);
    77             guiMouseOnlyInputState_->setMouseHandler(GUIManager::getInstancePtr());
     76            guiMouseOnlyInputState_->setMouseExclusive(TriBool::True);
     77            guiMouseOnlyInputState_->setMouseHandler(&GUIManager::getInstance());
    7878
    7979            guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
    80             guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
     80            guiKeysOnlyInputState_->setKeyHandler(&GUIManager::getInstance());
    8181        }
    8282
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r6417 r6746  
    3131#include <OgreSceneManager.h>
    3232
    33 #include "core/input/InputManager.h"
    34 #include "core/input/InputState.h"
    3533#include "core/input/KeyBinderManager.h"
    3634#include "core/Game.h"
     
    4240#include "Scene.h"
    4341#include "sound/AmbientSound.h"
     42// HACK
     43#include "core/input/InputManager.h"
     44#include "core/input/InputState.h"
    4445
    4546namespace orxonox
     
    4950    GSMainMenu::GSMainMenu(const GameStateInfo& info)
    5051        : GameState(info)
    51         , inputState_(0)
    5252    {
    5353        RegisterRootObject(GSMainMenu);
    54         inputState_ = InputManager::getInstance().createInputState("mainMenu");
    55         inputState_->setMouseMode(MouseMode::Nonexclusive);
    56         inputState_->setHandler(GUIManager::getInstancePtr());
    57         inputState_->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    58         inputState_->setJoyStickHandler(&InputHandler::EMPTY);
     54
     55        InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    5956
    6057        // create an empty Scene
     
    7673            this->ambient_->destroy();
    7774
    78         InputManager::getInstance().destroyState("mainMenu");
     75        InputManager::getInstance().destroyState("MainMenuHackery");
    7976
    8077        this->scene_->getSceneManager()->destroyCamera(this->camera_);
     
    8582    {
    8683        // show main menu
    87         GUIManager::getInstance().showGUI("MainMenu", true, GraphicsManager::getInstance().isFullScreen());
     84        GUIManager::getInstance().showGUI("MainMenu", true);
    8885        GUIManager::getInstance().setCamera(this->camera_);
    89         GUIManager::getInstance().setBackground("MainMenuBackground");
    90 //         GUIManager::getInstance().setBackground("");
     86        GUIManager::getInstance().setBackgroundImage("MainMenuBackground", "Background");
    9187        GraphicsManager::getInstance().setCamera(this->camera_);
     88
     89        InputManager::getInstance().enterState("MainMenuHackery");
    9290
    9391        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startStandalone), "startGame"));
     
    10199
    102100        KeyBinderManager::getInstance().setToDefault();
    103         InputManager::getInstance().enterState("mainMenu");
    104101
    105102        this->setConfigValues();
     
    119116        }
    120117
    121         InputManager::getInstance().leaveState("mainMenu");
     118        InputManager::getInstance().leaveState("MainMenuHackery");
    122119
    123120        GUIManager::getInstance().setCamera(0);
    124         GUIManager::getInstance().setBackground("");
     121        GUIManager::getInstance().setBackgroundImage("");
    125122        GUIManager::hideGUI("MainMenu");
    126123        GraphicsManager::getInstance().setCamera(0);
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r6417 r6746  
    6161
    6262    private:
    63         InputState*       inputState_;
    6463        Scene*            scene_;
    6564        Ogre::Camera*     camera_;
Note: See TracChangeset for help on using the changeset viewer.