PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes | List of all members
GlobalSettings Class Reference

Global engine application settings class. More...

#include <global_settings.h>

Public Member Functions

void initJoysticks ()
 Initialize all plugged joystics which are can be used in game.
 
void closeJoysticks ()
 Deinitialize all initialized joysticks.
 
void load ()
 Load settings from a config file.
 
void save ()
 Save settings into config file.
 
void resetDefaults ()
 Set all settings to default state.
 
void apply ()
 Applies all changed preferences.
 
void loadKeyMap (KeyMap &map, QSettings &set, QString grp)
 Load settings to specific control key map through opened config file inside specified INI-group. More...
 
void saveKeyMap (KeyMap &map, QSettings &set, QString grp)
 Save settings from specific control keys map into opened config file into specified INI-group. More...
 
void loadJoyCtrlMapID (KeyMap &map, QSettings &set, QString grp)
 Load settings to specific joysticks control map through opened config file inside specified INI-group. More...
 
void saveJoyCtrlMapID (KeyMap &map, QSettings &set, QString grp)
 Save settings from specific joysticks control map into opened config file inside specified INI-group. More...
 
void loadJoyCtrlMapType (KeyMap &map, QSettings &set, QString grp)
 Load settings to specific joysticks control types map through opened config file inside specified INI-group. More...
 
void saveJoyCtrlMapType (KeyMap &map, QSettings &set, QString grp)
 Save settings from specific joysticks control types map into opened config file inside specified INI-group. More...
 
ControlleropenController (int player)
 Constructs controller class for specific player and return a pointer to it. More...
 
void loadJoystickSettings ()
 Load all joystick control keys maps from engine configuration file.
 

Public Attributes

bool debugMode
 Enable debug mode of engine (Allow any cheats and allow showing of any debug information)
 
bool interprocessing
 Enable interprocessing mode (Engine will try to find running editor and will ask it for opened file data to play it)
 
bool fullScreen
 Enable full-screen mode.
 
int ScreenWidth
 Current width of screen.
 
int ScreenHeight
 Current height of screen.
 
float TicksPerSecond
 How much loop steps will be done per second.
 
int timeOfFrame
 Time of one loop step.
 
bool vsync
 Enable vertical synchronization with monitor refresh rate (not all video cards are supports this feature)
 
bool showDebugInfo
 Enable printing of engine debug information.
 
bool frameSkip
 Enable skipping of frames if real time delay is longer than predefined.
 
int volume_sound
 Current volume of SFX-es (0...128)
 
int volume_music
 Current volume of music (0...128)
 
int player1_controller
 Type of controller used by first player (-1 keyboard, >=0 joystick ID)
 
KeyMap player1_keyboard
 Keyboard controlls map for a first player.
 
QList< KeyMapplayer1_joysticks
 Control maps per each joystick ID for a first player.
 
QList< KeyMapJoyCtrlsplayer1_joysticks_ctrls_ids
 Joystick control ID maps per each joystick ID for a first player.
 
QList< KeyMapJoyCtrlsplayer1_joysticks_ctrls_types
 Joystick control types (button, axis, hat, ball) maps per each joystick ID for a first player.
 
int player2_controller
 Type of controller used by second player (-1 keyboard, >=0 joystick ID)
 
KeyMap player2_keyboard
 Keyboard controlls map for a second player.
 
QList< KeyMapplayer2_joysticks
 Control maps per each joystick ID for a second player.
 
QList< KeyMapJoyCtrlsplayer2_joysticks_ctrls_ids
 Joystick control ID maps per each joystick ID for a second player.
 
QList< KeyMapJoyCtrlsplayer2_joysticks_ctrls_types
 Joystick control types (button, axis, hat, ball) maps per each joystick ID for a second player.
 
QList< SDL_Joystick * > joysticks
 List of all available joysticks.
 

Detailed Description

Global engine application settings class.

Member Function Documentation

void GlobalSettings::loadJoyCtrlMapID ( KeyMap map,
QSettings &  set,
QString  grp 
)

Load settings to specific joysticks control map through opened config file inside specified INI-group.

Parameters
mapJosytick control map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map
void GlobalSettings::loadJoyCtrlMapType ( KeyMap map,
QSettings &  set,
QString  grp 
)

Load settings to specific joysticks control types map through opened config file inside specified INI-group.

Parameters
mapJosytick control types map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map
void GlobalSettings::loadKeyMap ( KeyMap map,
QSettings &  set,
QString  grp 
)

Load settings to specific control key map through opened config file inside specified INI-group.

Parameters
mapKeyboard control map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map
Controller * GlobalSettings::openController ( int  player)

Constructs controller class for specific player and return a pointer to it.

Parameters
playerNumber of player
Returns
Pointer to constructed controller class (When you fininshed your works with it, delete it youself!)
void GlobalSettings::saveJoyCtrlMapID ( KeyMap map,
QSettings &  set,
QString  grp 
)

Save settings from specific joysticks control map into opened config file inside specified INI-group.

Parameters
mapJosytick control map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map
void GlobalSettings::saveJoyCtrlMapType ( KeyMap map,
QSettings &  set,
QString  grp 
)

Save settings from specific joysticks control types map into opened config file inside specified INI-group.

Parameters
mapJosytick control types map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map
void GlobalSettings::saveKeyMap ( KeyMap map,
QSettings &  set,
QString  grp 
)

Save settings from specific control keys map into opened config file into specified INI-group.

Parameters
mapKeyboard control map structure which contains key ID's per each control key
setOpened engine configuration file
grpINI-group which contains saved control keys map

The documentation for this class was generated from the following files: