1. p2
  2. MatrixCode

Commits

p2  committed 7fac64a

Made non-gyroscope devices work again

  • Participants
  • Parent commits 1f1c8b2
  • Branches default

Comments (0)

Files changed (1)

File Classes/EAGLView.m

View file
 		reqSysVer = @"4.0";
 		if (NSOrderedDescending == [currSysVer compare:reqSysVer options:NSNumericSearch]) {
 			motionManager = [[NSClassFromString(@"CMMotionManager") alloc] init];
+			if (motionManager && ![motionManager isDeviceMotionAvailable]) {
+				[motionManager release];
+				motionManager = nil;
+			}
 			[motionManager setDeviceMotionUpdateInterval:1.0 / 30.0 * animationFrameInterval];
 		}
     }