Browse Source

Using Gamepad setters from PlatformBlackBerry so that gamepad events are triggered on BB10, enabling UI control.

ablake 13 years ago
parent
commit
741219ea78
1 changed files with 5 additions and 3 deletions
  1. 5 3
      gameplay/src/PlatformBlackBerry.cpp

+ 5 - 3
gameplay/src/PlatformBlackBerry.cpp

@@ -575,7 +575,9 @@ void queryGamepad(GamepadHandle handle, int* buttonCount, int* joystickCount, in
 
 void Platform::pollGamepadState(Gamepad* gamepad)
 {
-    screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_BUTTONS, (int*)&gamepad->_buttons);
+	unsigned int buttons;
+    screen_get_device_property_iv(gamepad->_handle, SCREEN_PROPERTY_BUTTONS, (int*)&buttons);
+	gamepad->setButtons(buttons);
 
     unsigned int i;
     for (i = 0; i < gamepad->_joystickCount; ++i)
@@ -604,7 +606,7 @@ void Platform::pollGamepadState(Gamepad* gamepad)
         x *= (x < 0) ? 0.0078125f : 0.0078740157480315f;
         y *= (y > 0) ? 0.0078125f : 0.0078740157480315f;
 
-        gamepad->_joysticks[i].set(x, y);        
+		gamepad->setJoystickValue(i, x, y);
     }
 
     for (i = 0; i < gamepad->_triggerCount; ++i)
@@ -623,7 +625,7 @@ void Platform::pollGamepadState(Gamepad* gamepad)
         }
 
         float value = (float)analog[2] * 0.0078125f;
-        gamepad->_triggers[i] = value;
+		gamepad->setTriggerValue(i, value);
     }
 }
 #else