Formatting.

This commit is contained in:
Camilla Berglund 2012-11-08 16:06:23 +01:00
parent 1fd9428287
commit a4b3a18755

View File

@ -199,13 +199,19 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
if (hats > 0) if (hats > 0)
{ {
int j; int j, value = ji.dwPOV / 100 / 45;
int value = ji.dwPOV / 100 / 45;
if (value < 0 || value > 8) value = 8; if (value < 0 || value > 8)
value = 8;
for (j = 0; j < 4 && button < numbuttons; j++) for (j = 0; j < 4 && button < numbuttons; j++)
{ {
buttons[button++] = directions[value] & (1 << j) ? GLFW_PRESS : GLFW_RELEASE; if (directions[value] & (1 << j))
buttons[button] = GLFW_PRESS;
else
buttons[button] = GLFW_RELEASE;
button++;
} }
} }