Small fix to joystick input

This commit is contained in:
pelya
2012-11-25 18:30:24 +02:00
parent 61cf0e1415
commit 548db2705b

View File

@@ -445,7 +445,10 @@ int SDL_ANDROID_processTouchscreenKeyboard(int x, int y, int action, int pointer
joystickTouchPoints[1] = y;
if( SDL_ANDROID_isJoystickUsed )
{
SDL_ANDROID_MainThreadPushJoystickAxis(0, 0, (x - arrows.x - arrows.w / 2) * 65534 / arrows.w );
int xx = (x - arrows.x - arrows.w / 2) * 65534 / arrows.w;
if( xx == 0 ) // Do not allow (0,0) coordinate, when the user touches the joystick
xx = 1;
SDL_ANDROID_MainThreadPushJoystickAxis(0, 0, xx );
SDL_ANDROID_MainThreadPushJoystickAxis(0, 1, (y - arrows.y - arrows.h / 2) * 65534 / arrows.h );
}
else