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:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/CameraManager.h

    r5929 r6746  
    6161            void useCamera(Ogre::Camera* camera);
    6262
    63             static CameraManager* getInstancePtr() { return singletonPtr_s; }
    64 
    6563        private:
    6664            CameraManager(const CameraManager&); // don't use
  • code/trunk/src/orxonox/Level.cc

    r6417 r6746  
    5858        if (this->isInitialized())
    5959        {
    60             if (LevelManager::getInstancePtr())
     60            if (LevelManager::exists())
    6161                LevelManager::getInstance().releaseActivity(this);
    6262
     
    116116            (*it)->setGametype(rootgametype);
    117117
    118         if (LevelManager::getInstancePtr())
     118        if (LevelManager::exists())
    119119            LevelManager::getInstance().requestActivity(this);
    120120    }
  • code/trunk/src/orxonox/LevelManager.h

    r6417 r6746  
    6262            const std::string& getAvailableLevelListItem(unsigned int index) const; //tolua_export
    6363
    64             static LevelManager* getInstancePtr() { return singletonPtr_s; }
    6564            static LevelManager& getInstance()    { return Singleton<LevelManager>::getInstance(); } // tolua_export
    6665
  • code/trunk/src/orxonox/PlayerManager.cc

    r6417 r6746  
    6666            this->clients_[clientID] = player;
    6767
    68             if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
     68            if (LevelManager::exists() && LevelManager::getInstance().getActiveLevel())
    6969                LevelManager::getInstance().getActiveLevel()->playerEntered(player);
    7070        }
     
    8282            this->clients_.erase(clientID);
    8383
    84             if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
     84            if (LevelManager::exists() && LevelManager::getInstance().getActiveLevel())
    8585                LevelManager::getInstance().getActiveLevel()->playerLeft(player);
    8686
  • 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_;
  • code/trunk/src/orxonox/overlays/CMakeLists.txt

    r5929 r6746  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     2  GUISheet.cc
    23  OrxonoxOverlay.cc
    34  OverlayGroup.cc
Note: See TracChangeset for help on using the changeset viewer.