Fixed a bug where SDL_SYS_JoystickUpdate would send update events even when the accelerometer delegate hadn't received new information from the hardware. gsoc2008_iphone
authorHolmes Futrell <hfutrell@umail.ucsb.edu>
Fri, 18 Jul 2008 17:47:36 +0000
branchgsoc2008_iphone
changeset 2363 49b243db2e04
parent 2362 44fc2537ff9e
child 2364 e321b52dee8f
Fixed a bug where SDL_SYS_JoystickUpdate would send update events even when the accelerometer delegate hadn't received new information from the hardware.
src/joystick/iphoneos/SDL_sysjoystick.m
--- a/src/joystick/iphoneos/SDL_sysjoystick.m	Fri Jul 18 17:46:17 2008 +0000
+++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Fri Jul 18 17:47:36 2008 +0000
@@ -89,10 +89,10 @@
 {
 	
 	Sint16 orientation[3];
-	[[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation];
 	
 	if ([[SDLUIAccelerationDelegate sharedDelegate] hasNewData]) {
 	
+		[[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation];
 		[[SDLUIAccelerationDelegate sharedDelegate] setHasNewData: NO];
 		
 		SDL_PrivateJoystickAxis(joystick, 0, orientation[0]);