Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2010, 1:05:28 AM (15 years ago)
Author:
rgrieder
Message:

Merged revisions 6621-6661 to gamestates2.

Location:
code/branches/gamestates2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2

  • code/branches/gamestates2/src/libraries/core/input/InputManager.h

    r6595 r6662  
    3636#include <string>
    3737#include <vector>
     38#include <boost/function.hpp>
    3839
    3940#include "util/Singleton.h"
    4041#include "util/TriBool.h"
    4142#include "core/WindowEventListener.h"
    42 #include "InputState.h"
    4343
    4444// tolua_begin
     
    7676            Nothing       = 0x00,
    7777            Bad           = 0x02,
    78             Ticking       = 0x04,
    79             Calibrating   = 0x08,
    80             ReloadRequest = 0x10,
     78            Calibrating   = 0x04,
    8179        };
    8280
     
    170168        //! Returns a pointer to the OIS InputManager. Only you if you know what you're doing!
    171169        OIS::InputManager* getOISInputManager() { return this->oisInputManager_; }
     170        //! Returns the position of the cursor as std::pair of ints
    172171        std::pair<int, int> getMousePosition() const;
     172        //! Tells whether the mouse is used exclusively to the game
     173        bool isMouseExclusive() const { return this->exclusiveMouse_; } // tolua_export
     174
     175        //-------------------------------
     176        // Function call caching
     177        //-------------------------------
     178        void pushCall(const boost::function<void ()>& function)
     179            { this->callBuffer_.push_back(function); }
    173180
    174181        static InputManager& getInstance() { return Singleton<InputManager>::getInstance(); } // tolua_export
     
    208215        std::vector<InputState*>            activeStatesTicked_;   //!< Like activeStates_, but only contains the ones that currently receive events
    209216
    210         std::set<InputState*>               stateEnterRequests_;   //!< Requests to enter a new state
    211         std::set<InputState*>               stateLeaveRequests_;   //!< Requests to leave a running state
    212         std::set<InputState*>               stateDestroyRequests_; //!< Requests to destroy a state
     217        std::vector<boost::function<void ()> > callBuffer_;        //!< Caches all calls from InputStates to be executed afterwards (see preUpdate)
    213218
    214219        static InputManager*                singletonPtr_s;        //!< Pointer reference to the singleton
Note: See TracChangeset for help on using the changeset viewer.