diff options
Diffstat (limited to 'src/object/robotmain.h')
-rw-r--r-- | src/object/robotmain.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 25c55f6..bce8e17 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -19,8 +19,10 @@ #pragma once #include "common/global.h" -#include "common/misc.h" +#include "common/singleton.h" + #include "graphics/engine/particle.h" + #include "object/object.h" #include "object/mainmovie.h" @@ -140,8 +142,22 @@ const int SATCOM_SOLUCE = 5; const int SATCOM_MAX = 6; +/** + * \enum InputBinding + * \brief Binding for input slot + */ +struct InputBinding +{ + //! Keyboard binding code (can be regular or virtual) + unsigned int key; + //! Joystick binding code (virtual) + unsigned int joy; + + InputBinding() : key(KEY_INVALID), joy(KEY_INVALID) {} +}; -class CRobotMain + +class CRobotMain : public CSingleton<CRobotMain> { public: CRobotMain(CInstanceManager* iMan, CApplication* app); @@ -149,6 +165,15 @@ public: void CreateIni(); + //! Sets the default input bindings + void SetDefaultInputBindings(); + + //! Management of input bindings + //@{ + void SetInputBinding(InputSlot slot, InputBinding binding); + const InputBinding& GetInputBinding(InputSlot slot); + //@} + void ChangePhase(Phase phase); bool EventProcess(const Event &event); @@ -352,6 +377,9 @@ protected: Ui::CDisplayInfo* m_displayInfo; CSoundInterface* m_sound; + //! Bindings for user inputs + InputBinding m_inputBindings[INPUT_SLOT_MAX]; + float m_time; float m_gameTime; float m_checkEndTime; |