Camilla Berglund 9 年之前
父節點
當前提交
c580949417
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/cocoa_joystick.m

+ 4 - 4
src/cocoa_joystick.m

@@ -481,7 +481,7 @@ void _glfwTerminateJoysticksNS(void)
 int _glfwPlatformJoystickPresent(int joy)
 int _glfwPlatformJoystickPresent(int joy)
 {
 {
     _GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
     _GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
-    return joystick->present ? GLFW_TRUE : GLFW_FALSE;
+    return joystick->present;
 }
 }
 
 
 const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
 const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
@@ -508,9 +508,9 @@ const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
 const char* _glfwPlatformGetJoystickName(int joy)
 const char* _glfwPlatformGetJoystickName(int joy)
 {
 {
     _GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
     _GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
-    if (joystick->present)
-        return joystick->name;
-    else
+    if (!joystick->present)
         return NULL;
         return NULL;
+
+    return joystick->name;
 }
 }