Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GameLogic/Joystick/SCA_Joystick.h')
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.h55
1 files changed, 10 insertions, 45 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
index 53cd65cd495..6324b898247 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
@@ -44,6 +44,7 @@ class SCA_Joystick
{
static SCA_Joystick *m_instance[JOYINDEX_MAX];
+ static int m_joynum;
static int m_refCount;
class PrivateData;
@@ -53,9 +54,14 @@ class SCA_Joystick
int m_joyindex;
/*
- *support for 2 axes
+ *support for JOYAXIS_MAX axes (in pairs)
*/
int m_axis_array[JOYAXIS_MAX];
+
+ /*
+ *support for JOYHAT_MAX hats (each is a direction)
+ */
+ int m_hat_array[JOYHAT_MAX];
/*
* Precision or range of the axes
@@ -63,24 +69,6 @@ class SCA_Joystick
int m_prec;
/*
- * multiple axis values stored here
- */
- int m_axisnum;
- int m_axisvalue;
-
- /*
- * max # of axes avail
- */
- /*disabled
- int m_axismax;
- */
-
- /*
- * button values stored here
- */
- int m_buttonnum;
-
- /*
* max # of buttons avail
*/
@@ -88,18 +76,6 @@ class SCA_Joystick
int m_buttonmax;
int m_hatmax;
- /*
- * hat values stored here
- */
- int m_hatnum;
- int m_hatdir;
-
- /*
-
- * max # of hats avail
- disabled
- int m_hatmax;
- */
/* is the joystick initialized ?*/
bool m_isinit;
@@ -136,7 +112,6 @@ class SCA_Joystick
/*
* fills the axis mnember values
*/
- void pFillAxes(void);
void pFillButtons(void);
/*
@@ -149,11 +124,6 @@ class SCA_Joystick
*/
int pGetAxis(int axisnum, int udlr);
- /*
- * gets the current hat direction
- */
- int pGetHat(int direction);
-
SCA_Joystick(short int index);
~SCA_Joystick();
@@ -172,10 +142,9 @@ public:
bool aAxisIsPositive(int axis_single); /* check a single axis only */
bool aAnyButtonPressIsPositive(void);
- bool aAnyButtonReleaseIsPositive(void);
bool aButtonPressIsPositive(int button);
bool aButtonReleaseIsPositive(int button);
- bool aHatIsPositive(int dir);
+ bool aHatIsPositive(int hatnum, int dir);
/*
* precision is default '3200' which is overridden by input
@@ -186,13 +155,9 @@ public:
int GetAxisPosition(int index){
return m_axis_array[index];
}
-
- int GetButton(void){
- return m_buttonnum;
- }
- int GetHat(void){
- return m_hatdir;
+ int GetHat(int index){
+ return m_hat_array[index];
}
int GetThreshold(void){