}
}
}
-
- HandleNoXEvent();
+ else
+ HandleNoEvent();
/* don't use all CPU time when idle; the main loop while playing
has its own synchronization and is CPU friendly, too */
- if (game_status != PLAYING)
+ if (game_status == PLAYING)
+ HandleGameActions();
+ else
{
SyncDisplay();
if (!PendingEvent()) /* delay only if no pending events */
HandleClientMessageEvent((ClientMessageEvent *) event);
break;
-#ifdef USE_SDL_LIBRARY
+#ifdef USE_SDL_JOYSTICK
case SDL_JOYAXISMOTION:
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
if (!PointerInWindow(window))
return; /* window and pointer are on different screens */
-#if 0
+#if 1
if (button_status == MB_RELEASED && game_status != LEVELED)
return;
#endif
GAME_FRAME_DELAY * 100 / GameFrameDelay, GameFrameDelay);
break;
+ case KEY_d:
+ if (options.debug)
+ {
+ options.debug = FALSE;
+ printf("debug mode disabled\n");
+ }
+ else
+ {
+ options.debug = TRUE;
+ printf("debug mode enabled\n");
+ }
+ break;
+
+ case KEY_s:
+ if (!global.fps_slowdown)
+ {
+ global.fps_slowdown = TRUE;
+ global.fps_slowdown_factor = 2;
+ printf("fps slowdown enabled -- display only every 2nd frame\n");
+ }
+ else if (global.fps_slowdown_factor == 2)
+ {
+ global.fps_slowdown_factor = 4;
+ printf("fps slowdown enabled -- display only every 4th frame\n");
+ }
+ else
+ {
+ global.fps_slowdown = FALSE;
+ global.fps_slowdown_factor = 1;
+ printf("fps slowdown disabled\n");
+ }
+ break;
#if 0
case KEY_a:
}
}
-void HandleNoXEvent()
+void HandleNoEvent()
{
if (button_status && game_status != PLAYING)
{
#endif
HandleJoystick();
-
- if (game_status == PLAYING)
- HandleGameActions();
}
static int HandleJoystickForAllPlayers()