bugger, 8 joysticks not 4.

On Tue, Apr 7, 2009 at 12:21 PM, Campbell Barton <[email protected]> wrote:
> Revision: 19589
>          
> http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19589
> Author:   campbellbarton
> Date:     2009-04-07 21:21:48 +0200 (Tue, 07 Apr 2009)
>
> Log Message:
> -----------
> 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.
>
> Modified Paths:
> --------------
>    trunk/blender/source/blender/src/buttons_logic.c
>    trunk/blender/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
>    trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
>
> Modified: trunk/blender/source/blender/src/buttons_logic.c
> ===================================================================
> --- trunk/blender/source/blender/src/buttons_logic.c    2009-04-07 18:55:35 
> UTC (rev 19588)
> +++ trunk/blender/source/blender/src/buttons_logic.c    2009-04-07 19:21:48 
> UTC (rev 19589)
> @@ -1495,7 +1495,7 @@
>                        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 @@
>                        }
>                        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,
>
> Modified: 
> trunk/blender/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
> ===================================================================
> --- trunk/blender/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h  
>   2009-04-07 18:55:35 UTC (rev 19588)
> +++ trunk/blender/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h  
>   2009-04-07 19:21:48 UTC (rev 19589)
> @@ -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
>
> Modified: trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
> ===================================================================
> --- trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp    
> 2009-04-07 18:55:35 UTC (rev 19588)
> +++ trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp    
> 2009-04-07 19:21:48 UTC (rev 19589)
> @@ -605,7 +605,7 @@
>                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)
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> [email protected]
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
- Campbell
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to