28 #include "common/language.h" 33 #include "level/level_category.h" 71 : index(-1), axisCount(0), buttonCount(0) {}
99 DEBUG_SYS_EVENTS = 1 << 0,
100 DEBUG_UPDATE_EVENTS = 1 << 1,
101 DEBUG_APP_EVENTS = 1 << 2,
102 DEBUG_EVENTS = DEBUG_SYS_EVENTS | DEBUG_UPDATE_EVENTS | DEBUG_APP_EVENTS,
103 DEBUG_MODELS = 1 << 3,
104 DEBUG_ALL = DEBUG_SYS_EVENTS | DEBUG_APP_EVENTS | DEBUG_MODELS
173 int GetExitCode()
const;
176 const std::string& GetErrorMessage()
const;
179 void GetVideoResolutionList(std::vector<Math::IntPoint> &resolutions,
int display = 0)
const;
188 void SuspendSimulation();
190 void ResumeSimulation();
192 bool GetSimulationSuspended()
const;
195 void ResetTimeAfterLoading();
198 void SetSimulationSpeed(
float speed);
200 float GetSimulationSpeed()
const;
204 float GetAbsTime()
const;
206 long long GetExactAbsTime()
const;
209 long long GetRealAbsTime()
const;
212 float GetRelTime()
const;
214 long long GetExactRelTime()
const;
217 long long GetRealRelTime()
const;
220 std::vector<JoystickDevice> GetJoystickList()
const;
230 void SetJoystickEnabled(
bool enable);
231 bool GetJoystickEnabled()
const;
235 void UpdateJoystick();
248 void SetTextInput(
bool textInputEnabled);
255 void SetDebugModeActive(DebugMode mode,
bool active);
256 bool IsDebugModeActive(DebugMode mode)
const;
257 static bool ParseDebugModes(
const std::string& str,
int& debugModes);
262 Language GetLanguage()
const;
263 char GetLanguageChar()
const;
264 void SetLanguage(Language language);
267 bool GetSceneTestMode();
273 void RenderIfNeeded(
int updateRate);
276 void PlayForceFeedbackEffect(
float strength = 1.0f,
int length = 999999);
278 void StopForceFeedbackEffect();
282 bool CreateVideoSurface();
285 Event ProcessSystemEvent();
287 Event CreateVirtualEvent(
const Event& sourceEvent);
289 TEST_VIRTUAL
Event CreateUpdateEvent();
291 void LogEvent(
const Event& event);
296 void CloseJoystick();
299 void InternalResumeSimulation();
345 long long m_realAbsTimeBase;
346 long long m_realAbsTime;
347 long long m_realRelTime;
349 long long m_absTimeBase;
350 long long m_exactAbsTime;
351 long long m_exactRelTime;
356 float m_simulationSpeed;
357 bool m_simulationSuspended;
364 bool m_graphicsOverride =
false;
365 std::string m_graphics =
"default";
367 bool m_glVersionOverride =
false;
371 bool m_glProfileOverride =
false;
387 LevelCategory m_runSceneCategory;
405 static char m_languageLocale[50];
CSingleton base class for singletons.
std::unique_ptr< CInput > m_input
Input manager.
Definition: app.h:319
std::string m_windowTitle
Text set as window title.
Definition: app.h:337
ParseArgsStatus
State of parsing commandline arguments.
Definition: app.h:78
Class for managing data/lang/save paths.
Definition: pathman.h:37
bool m_sceneTest
Scene test mode.
Definition: app.h:393
bool m_resolutionOverride
Screen resoultion overriden by commandline.
Definition: app.h:399
std::vector< bool > m_joyButtonState
Current state of joystick buttons; may be updated from another thread.
Definition: app.h:384
< all ok
Definition: app.h:81
CSystemUtils * m_systemUtils
System utils instance.
Definition: app.h:303
std::vector< int > m_joyAxeState
Current state of joystick axes; may be updated from another thread.
Definition: app.h:382
< invalid syntax
Definition: app.h:82
Gfx::DeviceConfig m_deviceConfig
Current configuration of OpenGL display device.
Definition: app.h:334
< in-game cursor visible; system cursor hidden
Definition: app.h:93
Definition: singleton.h:30
int index
Device index (-1 = invalid device)
Definition: app.h:62
std::string name
Device name.
Definition: app.h:64
std::unique_ptr< ApplicationPrivate > m_private
Private (SDL-dependent data)
Definition: app.h:305
Global event queue.
Definition: event.h:866
int axisCount
Number of axes (only available after joystick opened)
Definition: app.h:66
SystemTimeStamp * m_baseTimeStamp
Animation time stamps, etc.
Definition: app.h:341
Class for loading config file.
Definition: config_file.h:40
std::unique_ptr< CSoundInterface > m_sound
Sound subsystem.
Definition: app.h:313
General config for graphics device.
Definition: device.h:64
std::unique_ptr< Gfx::CDevice > m_device
Graphics device.
Definition: app.h:311
long m_debugModes
Bit array of active debug modes.
Definition: app.h:328
std::unique_ptr< Gfx::CEngine > m_engine
Graphics engine.
Definition: app.h:309
2D point
Definition: point.h:50
< both cursors visible (only for debug)
Definition: app.h:94
Main application.
Definition: app.h:152
std::unique_ptr< CEventQueue > m_eventQueue
Global event queue.
Definition: app.h:307
Language m_language
Application language.
Definition: app.h:396
std::unique_ptr< CPathManager > m_pathManager
Path manager.
Definition: app.h:321
int m_exitCode
Code to return at exit.
Definition: app.h:324
Entry point into CRobotMain.
Definition: controller.h:39
JoystickDevice m_joystick
Info about current joystick device.
Definition: app.h:378
bool m_joystickEnabled
Whether joystick is enabled.
Definition: app.h:380
std::unique_ptr< CConfigFile > m_configFile
Profile (INI) reader/writer.
Definition: app.h:317
Namespace for (new) graphics code.
Definition: app.h:49
bool m_headless
Headles mode.
Definition: app.h:402
The graphics engine.
Definition: engine.h:585
Event types, structs and event queue.
MouseMode m_mouseMode
Current mode of mouse.
Definition: app.h:375
bool m_active
Whether application window is active.
Definition: app.h:326
std::unique_ptr< CController > m_controller
Game controller - game engine and UI.
Definition: app.h:315
MouseMode
Mode of mouse cursor.
Definition: app.h:89
Platform-specific utils.
Definition: system.h:91
Definition: system_linux.h:31
Abstract graphics device - CDevice class and related structs/enums.
std::string m_errorMessage
Message to be displayed as error to the user.
Definition: app.h:331
< system cursor visible; in-game cursor hidden
Definition: app.h:92
Event sent by system, interface or game.
Definition: event.h:735
int buttonCount
Number of buttons (only available after joystick opened)
Definition: app.h:68
Private data of CApplication class.
Definition: app.cpp:83
Information about a joystick device.
Definition: app.h:59
Sound plugin interface.
Definition: sound.h:60