+# ifdef USE_IPHONE /* Always obey real-world gravity */
+ {
+ float a = fabs (fabs(state->accx) > fabs(state->accy)
+ ? state->accx : state->accy);
+ switch ((int) current_device_rotation ()) {
+ case 0: case 360: state->accx = 0; state->accy = a; break;
+ case -90: state->accx = -a; state->accy = 0; break;
+ case 90: state->accx = a; state->accy = 0; break;
+ case 180: case -180: state->accx = 0; state->accy = -a; break;
+ default: break;
+ }
+ }
+# endif /* USE_IPHONE */
+