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:
authorCampbell Barton <ideasman42@gmail.com>2009-04-07 23:21:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-07 23:21:48 +0400
commitd012a222a21d4a2fb7f8879484755b89f80ecbb2 (patch)
tree2ce7e1bace5ae08d6cc0386fb7063faf777efebd
parentca1c3be3029a7a7aada686372ca1dd6ab39f0547 (diff)
Some users have odd joysticks with more then 8 axises, increased to 16 (so 4 joysticks)
Ideally there would be no limit but I dont think its worth the effort. Also had a bug in last commit for the pytyhon api's "axisSingle" attribute, UI index starts at 1 not zero.
-rw-r--r--source/blender/src/buttons_logic.c4
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h2
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
index 94790ac0f40..56879f80198 100644
--- a/source/blender/src/buttons_logic.c
+++ b/source/blender/src/buttons_logic.c
@@ -1495,7 +1495,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
else if(joy->type == SENS_JOY_AXIS)
{
uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
- &joy->axis, 1, 4.0, 100, 0,
+ &joy->axis, 1, 8.0, 100, 0,
"Specify which axis pair to use, 1 is useually the main direction input.");
uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
@@ -1523,7 +1523,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
}
else { /* (joy->type == SENS_JOY_AXIS_SINGLE)*/
uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19,
- &joy->axis_single, 1, 8.0, 100, 0,
+ &joy->axis_single, 1, 16.0, 100, 0,
"Specify a single axis (verticle/horizontal/other) to detect");
uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19,
diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
index 42fed51b19f..636c4dd5a42 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
@@ -39,7 +39,7 @@
#endif
#define JOYINDEX_MAX 8
-#define JOYAXIS_MAX 8
+#define JOYAXIS_MAX 16
#define JOYAXIS_RIGHT 0
#define JOYAXIS_UP 1
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index 3df9b454b1d..fa61e057b2c 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -605,7 +605,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT
return NULL;
}
- return PyInt_FromLong(joy->GetAxisPosition(self->m_axis));
+ return PyInt_FromLong(joy->GetAxisPosition(self->m_axis-1));
}
PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)