#include "editor.h"
#include "files.h"
#include "tape.h"
+#include "cartoons.h"
#include "network.h"
/* do no reset mouse cursor before all pending events have been processed */
if (gfx.cursor_mode == cursor_mode_last &&
- ((effectiveGameStatus() == GAME_MODE_TITLE &&
+ ((game_status == GAME_MODE_TITLE &&
gfx.cursor_mode == CURSOR_NONE) ||
(game_status == GAME_MODE_PLAYING &&
gfx.cursor_mode == CURSOR_PLAYFIELD)))
void EventLoop(void)
{
+ static unsigned int sync_frame_delay = 0;
+ unsigned int sync_frame_delay_value = GAME_FRAME_DELAY;
+
while (1)
{
if (PendingEvent()) /* got event */
}
else
{
- if (effectiveGameStatus() == GAME_MODE_TITLE)
+ if (game_status == GAME_MODE_TITLE)
{
/* when showing title screens, hide mouse pointer (if not moved) */
SetMouseCursor(CURSOR_NONE);
}
}
- else if (game_status == GAME_MODE_PLAYING && !tape.pausing)
+ else if (game_status == GAME_MODE_PLAYING && (!tape.pausing ||
+ tape.single_step))
{
/* when playing, display a special mouse pointer inside the playfield */
has its own synchronization and is CPU friendly, too */
if (game_status == GAME_MODE_PLAYING)
- {
HandleGameActions();
- }
- else
- {
- if (!PendingEvent()) /* delay only if no pending events */
- Delay(10);
- }
/* refresh window contents from drawing buffer, if needed */
BackToFront();
+ if (game_status != GAME_MODE_PLAYING)
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
+
if (game_status == GAME_MODE_QUIT)
return;
}
}
break;
-#if 0
- case KSYM_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;
-#endif
-
case KSYM_v:
printf("::: currently using game engine version %d\n",
game.engine_version);