From a4b3a18755c4236864603949fbd764122b6e122e Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 8 Nov 2012 16:06:23 +0100 Subject: [PATCH] Formatting. --- src/win32_joystick.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/win32_joystick.c b/src/win32_joystick.c index 9ffb9aac..3e342168 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -199,13 +199,19 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, if (hats > 0) { - int j; - int value = ji.dwPOV / 100 / 45; - if (value < 0 || value > 8) value = 8; + int j, value = ji.dwPOV / 100 / 45; + + if (value < 0 || value > 8) + value = 8; 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++; } }