浏览代码

Fixed bad editing in Cocoa joystick code.

Camilla Berglund 13 年之前
父节点
当前提交
e70ced5e05
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 2 0
      readme.html
  2. 4 4
      src/cocoa_joystick.m

+ 2 - 0
readme.html

@@ -924,6 +924,8 @@ their skills.  Special thanks go out to:</p>
   Much of the Windows code of GLFW was originally based on Jeff's
   Much of the Windows code of GLFW was originally based on Jeff's
   code</li>
   code</li>
 
 
+  <li>Julian Møller, for reporting a bug in the Cocoa joystick code</li>
+
   <li>Arturo J. Pérez, for a bug fix for cursor tracking on Mac OS X 10.6 Snow
   <li>Arturo J. Pérez, for a bug fix for cursor tracking on Mac OS X 10.6 Snow
   Leopard</li>
   Leopard</li>
 
 

+ 4 - 4
src/cocoa_joystick.m

@@ -550,15 +550,15 @@ int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes)
 
 
     for (i = 0;  i < numaxes;  i++)
     for (i = 0;  i < numaxes;  i++)
     {
     {
-        _glfwJoystickElement* axes =
+        _glfwJoystickElement* elements =
             (_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick.axes, i);
             (_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick.axes, i);
 
 
-        long readScale = axes->maxReport - axes->minReport;
+        long readScale = elements->maxReport - elements->minReport;
 
 
         if (readScale == 0)
         if (readScale == 0)
-            axes[i] = axes->value;
+            axes[i] = elements->value;
         else
         else
-            axes[i] = (2.0f * (axes->value - axes->minReport) / readScale) - 1.0f;
+            axes[i] = (2.0f * (elements->value - elements->minReport) / readScale) - 1.0f;
 
 
         if (i & 1)
         if (i & 1)
             axes[i] = -axes[i];
             axes[i] = -axes[i];