Control.cpp File Reference

#include <PVLE/Config.h>
#include <PVLE/Input/Control.h>
#include <PVLE/Util/Singleton.h>
#include <boost/static_assert.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/cast.hpp>
#include <osg/ref_ptr>
#include <algorithm>
#include <fstream>
#include <osgGA/GUIEventAdapter>

Include dependency graph for Control.cpp:

Go to the source code of this file.

Classes

class  KeyMap
 Maps IDs to strings for keys. More...
class  InvKeyMap
 Maps strings to IDs for keys. More...
struct  SimpleStrComp

Defines

#define axisName   switchName

Functions

 BOOST_STATIC_ASSERT (sizeof(switchesNames)/sizeof(char *)==ControlState::MAX_STARNDARD_SWITCH)
void saveBindings (const Bindings &k, const AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames, UINT nbUserSwitchesNames, UINT userBindingsFileVersion)
bool loadBindings (Bindings &k, AxisBindings &a, const boost::filesystem::path &path, const char **userSwitchesNames, UINT nbUserSwitchesNames, UINT userBindingsFileVersion)
void setDefaultBindings (Bindings &k, AxisBindings &a)

Variables

const char * switchesNames []
const char * axisNames [ControlState::MAX_AXIS]
const char *const VERSION_TEXT = "Version:"
const char *const SWITCHES_TEXT = "-----Key_bindings-----"
const char *const AXIS_TEXT = "-----Axis_bindings-----"
const UINT BINDINGS_FILE_VERSION = 5


Define Documentation

#define axisName   switchName

Referenced by loadBindings().


Function Documentation

BOOST_STATIC_ASSERT ( sizeof(switchesNames)/sizeof(char *)  = =ControlState::MAX_STARNDARD_SWITCH  ) 

bool loadBindings ( Bindings k,
AxisBindings a,
const boost::filesystem::path &  path,
const char **  userSwitchesNames,
UINT  nbUserSwitchesNames,
UINT  userBindingsFileVersion 
)

void saveBindings ( const Bindings k,
const AxisBindings a,
const boost::filesystem::path &  path,
const char **  userSwitchesNames,
UINT  nbUserSwitchesNames,
UINT  userBindingsFileVersion 
)

void setDefaultBindings ( Bindings k,
AxisBindings a 
)


Variable Documentation

const char* const AXIS_TEXT = "-----Axis_bindings-----"

Definition at line 133 of file Control.cpp.

const char* axisNames[ControlState::MAX_AXIS]

Initial value:

 {
    "AXIS_X", "AXIS_Y", "AXIS_Z",
    "AXIS_SCROLL_1", "AXIS_SCROLL_2", "AXIS_SCROLL_3", "AXIS_SCROLL_4"
}

Definition at line 82 of file Control.cpp.

Definition at line 134 of file Control.cpp.

const char* const SWITCHES_TEXT = "-----Key_bindings-----"

Definition at line 132 of file Control.cpp.

const char* switchesNames[]

Initial value:

 {      
    "NONE",
    "FORWARD", "BACKWARD", "LEFT", "RIGHT", "STRAFE_LEFT", "STRAFE_RIGHT", "UP", "DOWN",
    "ROLL_LEFT", "ROLL_RIGHT",
    "JUMP", "CROUCH",
    "FAST_TOGGLE", "ALWAYS_FAST",
    "FASTER", "SLOWER",
    "FIRE1", "FIRE2", "FIRE3", "FIRE4", "FIRE5",
    "WEAPON_NEXT", "WEAPON_PREV", "WEAPON_TOGGLE",
    "WEAPON1", "WEAPON2", "WEAPON3", "WEAPON4", "WEAPON5", "WEAPON6", "WEAPON7", "WEAPON8", "WEAPON9", "WEAPON10",
    "WEAPON11", "WEAPON12", "WEAPON13", "WEAPON14", "WEAPON15", "WEAPON16", "WEAPON17", "WEAPON18", "WEAPON19", "WEAPON20",
    "DROP_WEAPON", "DROP_ALTERNATE",
    "TARGET", "TARGET_NEXT", "TARGET_PREV", "SHOW_INFO",
    "VIEW_NEXT", "VIEW_PREV",
    "ZOOM_IN", "ZOOM_OUT",
    "VIEW1", "VIEW2", "VIEW3", "VIEW4", "VIEW5", "VIEW6", "VIEW7", "VIEW8", "VIEW9", "VIEW10", "VIEW11", "VIEW12", "VIEW13", "VIEW14", "VIEW15",
    "PAUSE",
    "SCREENSHOT",
    "TOGGLE_FULLSCREEN",
    "BRAKE", "RESET",
    "MENU", "SCORE_MENU",
    "OK", "CANCEL"
}
Todo:
Switches/Keys : Create a preprocessor code that converts enum to text (or inverse if not possible) to avoid keeping up to date

Definition at line 56 of file Control.cpp.

Referenced by loadBindings(), and saveBindings().

const char* const VERSION_TEXT = "Version:"

Definition at line 131 of file Control.cpp.


Generated on Sun Jan 17 11:38:58 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9