Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:08:50 PM (15 years ago)
Author:
rgrieder
Message:

Heavy clean up in the InputManager; not many real code changes though.
And temporary hack-fixed a problem in the Keybinder with std::vector.reserve(1000) ;)

Location:
code/branches/core4/src/orxonox
Files:
6 edited

Legend:

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

    r3274 r3279  
    150150
    151151        // enable master input
    152         InputManager::getInstance().requestEnterState("master");
     152        InputManager::getInstance().enterState("master");
    153153    }
    154154
     
    170170
    171171        masterInputState_->setHandler(0);
    172         InputManager::getInstance().requestDestroyState("master");
     172        InputManager::getInstance().destroyState("master");
    173173        delete this->masterKeyBinder_;
    174174
  • code/branches/core4/src/orxonox/gamestates/GSLevel.cc

    r3274 r3279  
    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/branches/core4/src/orxonox/gamestates/GSMainMenu.cc

    r3274 r3279  
    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/branches/core4/src/orxonox/objects/pickup/PickupInventory.cc

    r3196 r3279  
    8888            GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
    8989            GUIManager::getInstance().executeCode("hideCursor()");
    90             InputManager::getInstance().requestLeaveState("guiMouseOnly");
     90            InputManager::getInstance().leaveState("guiMouseOnly");
    9191        }
    9292        else
     
    9494            GUIManager::getInstance().showGUI("PickupInventory");
    9595            GUIManager::getInstance().executeCode("showCursor()");
    96             InputManager::getInstance().requestEnterState("guiMouseOnly");
     96            InputManager::getInstance().enterState("guiMouseOnly");
    9797        }
    9898        PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible());
  • code/branches/core4/src/orxonox/overlays/GUIOverlay.cc

    r3196 r3279  
    7070            str = out.str();
    7171            GUIManager::getInstance().executeCode("showCursor()");
    72             InputManager::getInstance().requestEnterState("guiMouseOnly");
     72            InputManager::getInstance().enterState("guiMouseOnly");
    7373            GUIManager::getInstance().executeCode("showGUI(\"" + this->guiName_ + "\", " + str + ")");
    7474        }
     
    7777            GUIManager::getInstance().executeCode("hideGUI(\"" + this->guiName_ + "\")");
    7878            GUIManager::getInstance().executeCode("hideCursor()");
    79             InputManager::getInstance().requestLeaveState("guiMouseOnly");
     79            InputManager::getInstance().leaveState("guiMouseOnly");
    8080        }
    8181    }
  • code/branches/core4/src/orxonox/overlays/console/InGameConsole.cc

    r3274 r3279  
    9898
    9999        // destroy the input state previously created (InputBuffer gets destroyed by the Shell)
    100         InputManager::getInstance().requestDestroyState("console");
     100        InputManager::getInstance().destroyState("console");
    101101
    102102        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
     
    507507        {
    508508            this->bActive_ = true;
    509             InputManager::getInstance().requestEnterState("console");
     509            InputManager::getInstance().enterState("console");
    510510            Shell::getInstance().registerListener(this);
    511511
     
    529529        {
    530530            this->bActive_ = false;
    531             InputManager::getInstance().requestLeaveState("console");
     531            InputManager::getInstance().leaveState("console");
    532532            Shell::getInstance().unregisterListener(this);
    533533
Note: See TracChangeset for help on using the changeset viewer.