summaryrefslogtreecommitdiffstats
path: root/src/app/app.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-30 00:12:04 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-30 00:12:04 +0200
commite37019943cb77d8c0735b330339a139430202fd8 (patch)
tree705c83d2774db76c58dd9853b2beb25fa03968d7 /src/app/app.h
parentdb5c6b5e45134f3cce21ee7b9b5ba4ca8d1e909c (diff)
downloadcolobot-e37019943cb77d8c0735b330339a139430202fd8.tar.gz
colobot-e37019943cb77d8c0735b330339a139430202fd8.tar.bz2
colobot-e37019943cb77d8c0735b330339a139430202fd8.zip
Event handling, CApplication and switch to c++-11
- added/changed event structs and event queue in common/event.h - added event handling and some minor functions in CApplication - switched to --std=c++11 because of union in Event struct
Diffstat (limited to 'src/app/app.h')
-rw-r--r--src/app/app.h80
1 files changed, 50 insertions, 30 deletions
diff --git a/src/app/app.h b/src/app/app.h
index e83652c..9d689e2 100644
--- a/src/app/app.h
+++ b/src/app/app.h
@@ -60,44 +60,55 @@ public:
//! Main event loop
int Run();
-protected:
- //! Cleans up before exit
- void Destroy();
- //! Processes an SDL event to Event struct
- void ParseEvent();
- //! Handles some incoming events
- void ProcessEvent(Event event);
- //! Renders the image in window
- bool Render();
-
-public:
+ //! Enters the pause mode
void Pause(bool pause);
- void StepSimulation(float rTime);
- void SetMousePos(Math::Point pos);
+ //! Updates the simulation state
+ void StepSimulation(float rTime);
void SetShowStat(bool show);
bool RetShowStat();
+
void SetDebugMode(bool mode);
bool RetDebugMode();
+
bool RetSetupMode();
+ void SetJoystickEnabled(bool enable);
+ bool RetJoystickEnabled();
+
void FlushPressKey();
void ResetKey();
void SetKey(int keyRank, int option, int key);
int RetKey(int keyRank, int option);
- void SetJoystick(bool enable);
- bool RetJoystick();
-
void SetMouseType(Gfx::MouseType type);
- void SetNiceMouse(bool nice);
- bool RetNiceMouse();
- bool RetNiceMouseCap();
+ void SetMousePos(Math::Point pos);
+
+ //? void SetNiceMouse(bool nice);
+ //? bool RetNiceMouse();
+ //? bool RetNiceMouseCap();
bool WriteScreenShot(char *filename, int width, int height);
protected:
+ //! Cleans up before exit
+ void Destroy();
+ //! Processes an SDL event to Event struct
+ void ParseEvent();
+ //! Handles some incoming events
+ void ProcessEvent(Event event);
+ //! Renders the image in window
+ bool Render();
+
+ //! Opens the joystick device
+ bool OpenJoystick();
+ //! Closes the joystick device
+ void CloseJoystick();
+
+ //! Converts window coords to interface coords
+ Math::Point WindowToInterfaceCoords(int x, int y);
+
//HRESULT ConfirmDevice( DDCAPS* pddDriverCaps, D3DDEVICEDESC7* pd3dDeviceDesc );
//HRESULT Initialize3DEnvironment();
//HRESULT Change3DEnvironment();
@@ -113,14 +124,20 @@ protected:
void OutputText(long x, long y, char* str);
protected:
+ CInstanceManager* m_iMan;
//! Private (SDL-dependent data)
ApplicationPrivate* m_private;
- CInstanceManager* m_iMan;
+ //! Global event queue
+ CEventQueue* m_eventQueue;
+ //! Current configuration of display device
Gfx::DeviceConfig m_deviceConfig;
+ //! Graphics engine
Gfx::CEngine* m_engine;
- CEvent* m_event;
- CRobotMain* m_robotMain;
+ //! Sound subsystem
CSound* m_sound;
+ //! Main class of the proper game engine
+ CRobotMain* m_robotMain;
+
//! Code to return at exit
int m_exitCode;
@@ -128,19 +145,22 @@ protected:
bool m_active;
bool m_activateApp;
bool m_ready;
- bool m_joystick;
- std::string m_windowTitle;
- long m_vidMemTotal;
- bool m_appUseZBuffer;
- bool m_appUseStereo;
bool m_showStats;
bool m_debugMode;
- bool m_audioState;
- bool m_audioTrack;
- bool m_niceMouse;
bool m_setupMode;
+ bool m_joystickEnabled;
+
+ std::string m_windowTitle;
+
+ //? long m_vidMemTotal;
+ //? bool m_appUseZBuffer;
+ //? bool m_appUseStereo;
+ //? bool m_audioState;
+ //? bool m_audioTrack;
+ //? bool m_niceMouse;
+
int m_keyState;
Math::Vector m_axeKey;
Math::Vector m_axeJoy;