2012-06-22 14:31:55 +00:00
|
|
|
// * This file is part of the COLOBOT source code
|
|
|
|
// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
|
|
|
|
// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
|
|
|
|
// *
|
|
|
|
// * This program is free software: you can redistribute it and/or modify
|
|
|
|
// * it under the terms of the GNU General Public License as published by
|
|
|
|
// * the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// * (at your option) any later version.
|
|
|
|
// *
|
|
|
|
// * This program is distributed in the hope that it will be useful,
|
|
|
|
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// * GNU General Public License for more details.
|
|
|
|
// *
|
|
|
|
// * You should have received a copy of the GNU General Public License
|
|
|
|
// * along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
|
|
2012-08-11 16:39:16 +00:00
|
|
|
/**
|
|
|
|
* \file app/app.h
|
|
|
|
* \brief CApplication class
|
|
|
|
*/
|
2012-06-22 14:31:55 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-09-09 15:51:10 +00:00
|
|
|
#include "common/global.h"
|
2012-07-22 20:05:12 +00:00
|
|
|
#include "common/singleton.h"
|
2012-07-26 20:26:19 +00:00
|
|
|
#include "graphics/core/device.h"
|
|
|
|
#include "graphics/engine/engine.h"
|
2012-07-29 13:09:53 +00:00
|
|
|
#include "graphics/opengl/gldevice.h"
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-06-25 17:59:17 +00:00
|
|
|
#include <string>
|
2012-06-30 10:26:40 +00:00
|
|
|
#include <vector>
|
2012-06-25 17:59:17 +00:00
|
|
|
|
2012-06-24 13:41:56 +00:00
|
|
|
|
|
|
|
class CInstanceManager;
|
|
|
|
class CEvent;
|
|
|
|
class CRobotMain;
|
2012-09-15 20:19:32 +00:00
|
|
|
class CSoundInterface;
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
/**
|
2012-09-12 21:43:04 +00:00
|
|
|
* \struct JoystickDevice
|
|
|
|
* \brief Information about a joystick device
|
|
|
|
*/
|
2012-07-29 13:09:53 +00:00
|
|
|
struct JoystickDevice
|
|
|
|
{
|
|
|
|
//! Device index (-1 = invalid device)
|
|
|
|
int index;
|
|
|
|
//! Device name
|
|
|
|
std::string name;
|
|
|
|
//! Number of axes (only available after joystick opened)
|
|
|
|
int axisCount;
|
|
|
|
//! Number of buttons (only available after joystick opened)
|
|
|
|
int buttonCount;
|
|
|
|
|
|
|
|
JoystickDevice()
|
|
|
|
: index(-1), axisCount(0), buttonCount(0) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2012-09-12 21:43:04 +00:00
|
|
|
* \enum VideoQueryResult
|
|
|
|
* \brief Result of querying for available video resolutions
|
|
|
|
*/
|
2012-07-29 13:09:53 +00:00
|
|
|
enum VideoQueryResult
|
|
|
|
{
|
|
|
|
VIDEO_QUERY_ERROR,
|
|
|
|
VIDEO_QUERY_NONE,
|
|
|
|
VIDEO_QUERY_ALL,
|
|
|
|
VIDEO_QUERY_OK
|
|
|
|
};
|
|
|
|
|
2012-06-25 17:59:17 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
/**
|
|
|
|
* \enum TrackedKeys
|
|
|
|
* \brief Keys (or kmods) whose state (pressed/released) is tracked by CApplication
|
|
|
|
*/
|
|
|
|
enum TrackedKey
|
|
|
|
{
|
|
|
|
TRKEY_SHIFT,
|
|
|
|
TRKEY_CONTROL,
|
|
|
|
TRKEY_NUM_UP,
|
|
|
|
TRKEY_NUM_DOWN,
|
|
|
|
TRKEY_NUM_LEFT,
|
|
|
|
TRKEY_NUM_RIGHT,
|
|
|
|
TRKEY_NUM_PLUS,
|
|
|
|
TRKEY_NUM_MINUS,
|
|
|
|
TRKEY_PAGE_UP,
|
|
|
|
TRKEY_PAGE_DOWN,
|
|
|
|
TRKEY_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \enum InputSlot
|
|
|
|
* \brief Available slots for input bindings
|
|
|
|
*/
|
|
|
|
enum InputSlot
|
|
|
|
{
|
|
|
|
INPUT_SLOT_LEFT = 0,
|
|
|
|
INPUT_SLOT_RIGHT = 1,
|
|
|
|
INPUT_SLOT_UP = 2,
|
|
|
|
INPUT_SLOT_DOWN = 3,
|
|
|
|
INPUT_SLOT_GUP = 4,
|
|
|
|
INPUT_SLOT_GDOWN = 5,
|
|
|
|
INPUT_SLOT_CAMERA = 6,
|
|
|
|
INPUT_SLOT_DESEL = 7,
|
|
|
|
INPUT_SLOT_ACTION = 8,
|
|
|
|
INPUT_SLOT_NEAR = 9,
|
|
|
|
INPUT_SLOT_AWAY = 10,
|
|
|
|
INPUT_SLOT_NEXT = 11,
|
|
|
|
INPUT_SLOT_HUMAN = 12,
|
|
|
|
INPUT_SLOT_QUIT = 13,
|
|
|
|
INPUT_SLOT_HELP = 14,
|
|
|
|
INPUT_SLOT_PROG = 15,
|
|
|
|
INPUT_SLOT_VISIT = 16,
|
|
|
|
INPUT_SLOT_SPEED10 = 17,
|
|
|
|
INPUT_SLOT_SPEED15 = 18,
|
|
|
|
INPUT_SLOT_SPEED20 = 19,
|
|
|
|
INPUT_SLOT_SPEED30 = 20,
|
|
|
|
INPUT_SLOT_AIMUP = 21,
|
|
|
|
INPUT_SLOT_AIMDOWN = 22,
|
|
|
|
INPUT_SLOT_CBOT = 23,
|
|
|
|
|
|
|
|
INPUT_SLOT_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \struct InputBinding
|
|
|
|
* \brief Settable binding for user input
|
|
|
|
*/
|
|
|
|
struct InputBinding
|
|
|
|
{
|
|
|
|
//! Key
|
2012-09-17 22:01:00 +00:00
|
|
|
unsigned int key;
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Key modifier (e.g. shift, control)
|
2012-09-17 22:01:00 +00:00
|
|
|
unsigned int kmod;
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Joystick button
|
2012-09-17 22:01:00 +00:00
|
|
|
unsigned int joy;
|
2012-09-12 21:43:04 +00:00
|
|
|
|
|
|
|
inline InputBinding()
|
|
|
|
{
|
|
|
|
Reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void Reset()
|
|
|
|
{
|
2012-09-17 22:01:00 +00:00
|
|
|
key = kmod = joy = static_cast<unsigned int>(-1);
|
2012-09-12 21:43:04 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-09-17 21:41:53 +00:00
|
|
|
/**
|
|
|
|
* \enum ParseArgsStatus
|
|
|
|
* \brief State of parsing commandline arguments
|
|
|
|
*/
|
|
|
|
enum ParseArgsStatus
|
|
|
|
{
|
|
|
|
PARSE_ARGS_OK = 1, //! < all ok
|
|
|
|
PARSE_ARGS_FAIL = 2, //! < invalid syntax
|
|
|
|
PARSE_ARGS_HELP = 3 //! < -help requested
|
|
|
|
};
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
struct ApplicationPrivate;
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-06-25 17:59:17 +00:00
|
|
|
/**
|
2012-06-26 20:50:55 +00:00
|
|
|
* \class CApplication
|
|
|
|
* \brief Main application
|
2012-06-25 17:59:17 +00:00
|
|
|
*
|
2012-06-30 10:26:40 +00:00
|
|
|
* This class is responsible for main application execution, including creating
|
|
|
|
* and handling main application window, receiving events, etc.
|
|
|
|
*
|
|
|
|
* It is a singleton class with only one instance that can be created.
|
|
|
|
*
|
2012-07-29 13:09:53 +00:00
|
|
|
* \section Creation Creation of other main objects
|
2012-06-30 10:26:40 +00:00
|
|
|
*
|
|
|
|
* The class creates the only instance of CInstanceManager, CEventQueue, CEngine,
|
|
|
|
* CRobotMain and CSound classes.
|
|
|
|
*
|
2012-07-29 13:09:53 +00:00
|
|
|
* \section Window Window management
|
2012-06-30 10:26:40 +00:00
|
|
|
*
|
|
|
|
* The class is responsible for creating app window, setting and changing the video mode,
|
2012-07-29 13:09:53 +00:00
|
|
|
* joystick management, grabbing input and changing the system mouse cursor
|
|
|
|
* position and visibility.
|
|
|
|
* ("System mouse cursor" means the cursor displayed by the OS in constrast to the cursor
|
|
|
|
* displayed by CEngine).
|
|
|
|
*
|
|
|
|
* \section Events Events
|
2012-06-30 10:26:40 +00:00
|
|
|
*
|
2012-07-29 13:09:53 +00:00
|
|
|
* Events are taken from SDL event queue, translated to common events from src/common.h
|
|
|
|
* and pushed to global event queue CEventQueue.
|
2012-06-30 10:26:40 +00:00
|
|
|
*
|
|
|
|
* Joystick events are generated somewhat differently, by running a separate timer,
|
|
|
|
* polling the device for changes and synthesising events on change. It avoids flooding
|
|
|
|
* the event queue with too many joystick events and the granularity of the timer can be
|
|
|
|
* adjusted.
|
|
|
|
*
|
2012-07-29 13:09:53 +00:00
|
|
|
* The events are passed to ProcessEvent() of classes in this order: CApplication, CEngine
|
|
|
|
* and CRobotMain. CApplication and CEngine's ProcessEvent() functions return bool, which
|
|
|
|
* means whether to pass the event on, or stop the chain. This is to enable handling some
|
|
|
|
* events which are internal to CApplication or CEngine.
|
|
|
|
*
|
|
|
|
* \section Portability Portability
|
|
|
|
*
|
|
|
|
* Currently, the class only handles OpenGL devices. SDL can be used with DirectX, but
|
|
|
|
* for that to work, video initialization and video setting must be done differently.
|
2012-06-25 17:59:17 +00:00
|
|
|
*
|
|
|
|
*/
|
2012-07-22 20:05:12 +00:00
|
|
|
class CApplication : public CSingleton<CApplication>
|
2012-06-22 14:31:55 +00:00
|
|
|
{
|
2012-06-24 13:41:56 +00:00
|
|
|
public:
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Constructor (can only be called once!)
|
|
|
|
CApplication();
|
|
|
|
//! Destructor
|
|
|
|
~CApplication();
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-06-25 17:59:17 +00:00
|
|
|
public:
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Parses commandline arguments
|
2012-09-17 21:41:53 +00:00
|
|
|
ParseArgsStatus ParseArguments(int argc, char *argv[]);
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Initializes the application
|
|
|
|
bool Create();
|
|
|
|
//! Main event loop
|
|
|
|
int Run();
|
2012-07-04 17:56:22 +00:00
|
|
|
//! Returns the code to be returned at main() exit
|
|
|
|
int GetExitCode();
|
|
|
|
|
2012-08-13 21:09:30 +00:00
|
|
|
//! Returns the message of error (set to something if exit code is not 0)
|
|
|
|
const std::string& GetErrorMessage();
|
|
|
|
|
2012-07-04 17:56:22 +00:00
|
|
|
//! Cleans up before exit
|
|
|
|
void Destroy();
|
2012-06-25 17:59:17 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Returns a list of possible video modes
|
2012-08-11 15:17:04 +00:00
|
|
|
VideoQueryResult GetVideoResolutionList(std::vector<Math::IntPoint> &resolutions,
|
2012-07-29 13:09:53 +00:00
|
|
|
bool fullScreen, bool resizeable);
|
|
|
|
|
|
|
|
//! Returns the current video mode
|
|
|
|
Gfx::GLDeviceConfig GetVideoConfig();
|
|
|
|
|
|
|
|
//! Change the video mode to given mode
|
|
|
|
bool ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig);
|
2012-06-25 17:59:17 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Suspends animation (time will not be updated)
|
|
|
|
void SuspendSimulation();
|
|
|
|
//! Resumes animation
|
|
|
|
void ResumeSimulation();
|
|
|
|
//! Returns whether simulation is suspended
|
|
|
|
bool GetSimulationSuspended();
|
|
|
|
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Updates the simulation state
|
2012-09-12 21:43:04 +00:00
|
|
|
void StepSimulation();
|
|
|
|
|
|
|
|
//@{
|
|
|
|
//! Management of simulation speed
|
|
|
|
void SetSimulationSpeed(float speed);
|
|
|
|
float GetSimulationSpeed();
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//! Returns the absolute time counter [seconds]
|
|
|
|
float GetAbsTime();
|
|
|
|
//! Returns the exact absolute time counter [nanoseconds]
|
|
|
|
long long GetExactAbsTime();
|
|
|
|
|
|
|
|
//! Returns the exact absolute time counter disregarding speed setting [nanoseconds]
|
|
|
|
long long GetRealAbsTime();
|
|
|
|
|
|
|
|
//! Returns the relative time since last update [seconds]
|
|
|
|
float GetRelTime();
|
|
|
|
//! Returns the exact realative time since last update [nanoseconds]
|
|
|
|
long long GetExactRelTime();
|
|
|
|
|
|
|
|
//! Returns the exact relative time since last update disregarding speed setting [nanoseconds]
|
|
|
|
long long GetRealRelTime();
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Returns a list of available joystick devices
|
|
|
|
std::vector<JoystickDevice> GetJoystickList();
|
2012-06-29 22:12:04 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Returns info about the current joystick
|
|
|
|
JoystickDevice GetJoystick();
|
2012-06-29 22:12:04 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Change the current joystick device
|
|
|
|
bool ChangeJoystick(const JoystickDevice &newJoystick);
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Management of joystick enable state
|
|
|
|
//@{
|
2012-06-29 22:12:04 +00:00
|
|
|
void SetJoystickEnabled(bool enable);
|
2012-07-01 20:59:22 +00:00
|
|
|
bool GetJoystickEnabled();
|
2012-09-12 21:43:04 +00:00
|
|
|
//@}
|
2012-06-29 22:12:04 +00:00
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Polls the state of joystick axes and buttons
|
|
|
|
void UpdateJoystick();
|
|
|
|
|
2012-08-12 08:45:04 +00:00
|
|
|
//! Updates the mouse position explicitly
|
|
|
|
void UpdateMouse();
|
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Returns the current key modifiers
|
|
|
|
int GetKmods();
|
|
|
|
//! Returns whether the given kmod is active
|
|
|
|
bool GetKmodState(int kmod);
|
|
|
|
|
|
|
|
//! Returns whether the tracked key is pressed
|
|
|
|
bool GetTrackedKeyState(TrackedKey key);
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Returns whether the mouse button is pressed
|
|
|
|
bool GetMouseButtonState(int index);
|
|
|
|
|
|
|
|
//! Resets tracked key states, modifiers and motion vectors
|
|
|
|
void ResetKeyStates();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO move input binding and motion vectors to CRobotMain
|
|
|
|
|
|
|
|
//! Sets the default input bindings
|
|
|
|
void SetDefaultInputBindings();
|
|
|
|
|
|
|
|
//! Management of input bindings
|
|
|
|
//@{
|
|
|
|
void SetInputBinding(InputSlot slot, const InputBinding& binding);
|
|
|
|
const InputBinding& GetInputBinding(InputSlot slot);
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
//! Management of the grab mode for input (keyboard & mouse)
|
|
|
|
//@{
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetGrabInput(bool grab);
|
|
|
|
bool GetGrabInput();
|
2012-09-12 21:43:04 +00:00
|
|
|
//@}
|
2012-07-22 20:05:12 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Management of the visiblity of system mouse cursor
|
|
|
|
//@{
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetSystemMouseVisible(bool visible);
|
|
|
|
bool GetSystemMouseVisibile();
|
2012-09-12 21:43:04 +00:00
|
|
|
//@}
|
2012-06-29 22:12:04 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Management of the position of system mouse cursor (in interface coords)
|
|
|
|
//@{
|
2012-07-22 20:05:12 +00:00
|
|
|
void SetSystemMousePos(Math::Point pos);
|
|
|
|
Math::Point GetSystemMousePos();
|
2012-09-12 21:43:04 +00:00
|
|
|
//@}
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Management of debug mode (prints more info in logger)
|
|
|
|
//@{
|
2012-07-29 13:09:53 +00:00
|
|
|
void SetDebugMode(bool mode);
|
|
|
|
bool GetDebugMode();
|
2012-09-12 21:43:04 +00:00
|
|
|
//@}
|
2012-06-24 13:41:56 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Returns the full path to a file in data directory
|
|
|
|
std::string GetDataFilePath(const std::string &dirName, const std::string &fileName);
|
|
|
|
|
2012-09-09 15:51:10 +00:00
|
|
|
//! Management of language
|
|
|
|
//@{
|
|
|
|
Language GetLanguage();
|
|
|
|
void SetLanguage(Language language);
|
|
|
|
//@}
|
|
|
|
|
2012-06-24 13:41:56 +00:00
|
|
|
protected:
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Creates the window's SDL_Surface
|
|
|
|
bool CreateVideoSurface();
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Processes the captured SDL event to Event struct
|
|
|
|
Event ParseEvent();
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Handles some incoming events
|
2012-07-22 20:05:12 +00:00
|
|
|
bool ProcessEvent(const Event &event);
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Renders the image in window
|
2012-08-10 21:31:42 +00:00
|
|
|
void Render();
|
2012-06-29 22:12:04 +00:00
|
|
|
|
|
|
|
//! Opens the joystick device
|
|
|
|
bool OpenJoystick();
|
|
|
|
//! Closes the joystick device
|
|
|
|
void CloseJoystick();
|
|
|
|
|
2012-06-24 13:41:56 +00:00
|
|
|
protected:
|
2012-06-30 10:26:40 +00:00
|
|
|
//! Instance manager
|
2012-06-29 22:12:04 +00:00
|
|
|
CInstanceManager* m_iMan;
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Private (SDL-dependent data)
|
|
|
|
ApplicationPrivate* m_private;
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Global event queue
|
|
|
|
CEventQueue* m_eventQueue;
|
|
|
|
//! Graphics engine
|
2012-06-26 20:23:05 +00:00
|
|
|
Gfx::CEngine* m_engine;
|
2012-07-01 20:59:22 +00:00
|
|
|
//! Graphics device
|
|
|
|
Gfx::CDevice* m_device;
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Sound subsystem
|
2012-09-15 20:19:32 +00:00
|
|
|
CSoundInterface* m_sound;
|
2012-06-29 22:12:04 +00:00
|
|
|
//! Main class of the proper game engine
|
|
|
|
CRobotMain* m_robotMain;
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
//! Code to return at exit
|
|
|
|
int m_exitCode;
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Whether application window is active
|
2012-06-26 20:23:05 +00:00
|
|
|
bool m_active;
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Whether debug mode is enabled
|
2012-06-26 20:23:05 +00:00
|
|
|
bool m_debugMode;
|
|
|
|
|
2012-08-13 21:09:30 +00:00
|
|
|
//! Message to be displayed as error to the user
|
|
|
|
std::string m_errorMessage;
|
|
|
|
|
2012-07-29 13:09:53 +00:00
|
|
|
//! Current configuration of OpenGL display device
|
|
|
|
Gfx::GLDeviceConfig m_deviceConfig;
|
|
|
|
//! Previous configuration of OpenGL display device
|
|
|
|
Gfx::GLDeviceConfig m_lastDeviceConfig;
|
2012-06-29 22:12:04 +00:00
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Text set as window title
|
2012-06-29 22:12:04 +00:00
|
|
|
std::string m_windowTitle;
|
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
//! Animation time stamps, etc.
|
|
|
|
//@{
|
|
|
|
SystemTimeStamp* m_baseTimeStamp;
|
|
|
|
SystemTimeStamp* m_lastTimeStamp;
|
|
|
|
SystemTimeStamp* m_curTimeStamp;
|
|
|
|
|
|
|
|
long long m_realAbsTimeBase;
|
|
|
|
long long m_realAbsTime;
|
|
|
|
long long m_realRelTime;
|
|
|
|
|
|
|
|
long long m_absTimeBase;
|
|
|
|
long long m_exactAbsTime;
|
|
|
|
long long m_exactRelTime;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-09-12 21:43:04 +00:00
|
|
|
float m_absTime;
|
|
|
|
float m_relTime;
|
|
|
|
|
|
|
|
float m_simulationSpeed;
|
|
|
|
bool m_simulationSuspended;
|
|
|
|
//@}
|
|
|
|
|
|
|
|
//! Current state of key modifiers (mask of SDLMod)
|
|
|
|
unsigned int m_kmodState;
|
|
|
|
//! Current state of some tracked keys (mask of TrackedKey)
|
|
|
|
bool m_trackedKeysState[TRKEY_MAX];
|
|
|
|
//! Current state of mouse buttons (mask of button indexes)
|
|
|
|
unsigned int m_mouseButtonsState;
|
|
|
|
|
|
|
|
//! Bindings for user inputs
|
|
|
|
InputBinding m_inputBindings[INPUT_SLOT_MAX];
|
|
|
|
|
|
|
|
//! Motion vector set by keyboard
|
|
|
|
Math::Vector m_keyMotion;
|
|
|
|
//! Motion vector set by joystick
|
|
|
|
Math::Vector m_joyMotion;
|
|
|
|
|
|
|
|
//! Current system mouse position
|
|
|
|
Math::Point m_systemMousePos;
|
2012-07-29 13:09:53 +00:00
|
|
|
|
|
|
|
//! Info about current joystick device
|
|
|
|
JoystickDevice m_joystick;
|
|
|
|
//! Whether joystick is enabled
|
|
|
|
bool m_joystickEnabled;
|
2012-06-30 10:26:40 +00:00
|
|
|
//! Current state of joystick axes; may be updated from another thread
|
|
|
|
std::vector<int> m_joyAxeState;
|
|
|
|
//! Current state of joystick buttons; may be updated from another thread
|
|
|
|
std::vector<bool> m_joyButtonState;
|
|
|
|
|
2012-07-22 20:05:12 +00:00
|
|
|
//! Path to directory with data files
|
|
|
|
std::string m_dataPath;
|
2012-09-09 15:51:10 +00:00
|
|
|
|
|
|
|
//! Application language
|
|
|
|
Language m_language;
|
2012-06-22 14:31:55 +00:00
|
|
|
};
|
|
|
|
|