From 903722299d19a061ec38ca9f17fccc8b389b95a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Jun 2009 04:12:59 +0000 Subject: BGE PyAPI fixes - CValue warning ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); had false positives because of python using getattr() internally. Only show the wanring now when a CValue is found. - Py functions that accepted a vector and a GameObject were slowed down by PySequence_Check() first called on the GameObject, though this would fail it would try and get attributes from the game object - ending up in ~8 attribute lookups each time. Avoiding PySequence_Check() makes ob.getDistanceTo(otherOb) over twice as fast. - Joystick hat events could crash the BGE for joysticks with more then 4 hats. - PLY Import failed on PLY files from Carve, added some extra types. --- source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/gameengine/GameLogic/Joystick') diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 66193a2f4b9..53d3be35f92 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -45,7 +45,7 @@ void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) /* See notes below in the event loop */ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) { - if(sdl_event->jhat.hat >= JOYAXIS_MAX) + if(sdl_event->jhat.hat >= JOYHAT_MAX) return; m_hat_array[sdl_event->jhat.hat]= sdl_event->jhat.value; -- cgit v1.2.3