playfield_cursor_set = FALSE;
}
+#if 0
HandleNoEvent();
+#endif
}
+#if 1
+ HandleNoEvent();
+#endif
+
/* don't use all CPU time when idle; the main loop while playing
has its own synchronization and is CPU friendly, too */
event_name, event->data1, event->data2);
#endif
- if (event->event == SDL_WINDOWEVENT_EXPOSED)
+ if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
+ event->event == SDL_WINDOWEVENT_RESIZED ||
+ event->event == SDL_WINDOWEVENT_EXPOSED)
SDLRedrawWindow();
#if 0
int max_events = 10;
#endif
+#if 0
#if DEBUG_EVENTS
Error(ERR_DEBUG, "FINGER EVENT: finger was %s, touch ID %lld, finger ID %lld, x/y %f/%f, dx/dy %f/%f, pressure %f",
event->type == EVENT_FINGERPRESS ? "pressed" :
event->dx, event->dy,
event->pressure);
#endif
+#endif
#if 0
int x = (int)(event->x * video.width);
Key key = getKeyFromKeyName(text);
#if DEBUG_EVENTS
- Error(ERR_DEBUG, "TEXT EVENT: text == '%s' [%d byte(s), '%c'/%d], resulting key == %d (%s)",
+ Error(ERR_DEBUG, "TEXT EVENT: text == '%s' [%d byte(s), '%c'/%d], resulting key == %d (%s) [%04x]",
text,
strlen(text),
text[0], (int)(text[0]),
key,
- getKeyNameFromKey(key));
+ getKeyNameFromKey(key),
+ GetKeyModState());
#endif
// if (game_status != GAME_MODE_PLAYING && GetKeyModState() != KMOD_None)
{
HandleButton(0, 0, -button_status, button_status);
+#if 0
return;
+#endif
+ }
+ else
+ {
+ HandleJoystick();
}
#if defined(NETWORK_AVALIABLE)
HandleNetworking();
#endif
- HandleJoystick();
+ switch (game_status)
+ {
+ case GAME_MODE_MAIN:
+ DrawPreviewLevelAnimation();
+ DoAnimation();
+ break;
+
+ case GAME_MODE_LEVELS:
+ case GAME_MODE_LEVELNR:
+ case GAME_MODE_SETUP:
+ case GAME_MODE_INFO:
+ case GAME_MODE_SCORES:
+ DoAnimation();
+ break;
+
+ case GAME_MODE_EDITOR:
+ HandleLevelEditorIdle();
+ break;
+
+ default:
+ break;
+ }
}
static int HandleJoystickForAllPlayers()
HandleHallOfFame(0, 0, dx, dy, !newbutton);
break;
+#if 0
case GAME_MODE_EDITOR:
HandleLevelEditorIdle();
break;
+#endif
case GAME_MODE_PLAYING:
if (tape.playing || keyboard)
newbutton = ((joy & JOY_BUTTON) != 0);
#if 0
- if (local_player->LevelSolved_GameEnd && newbutton)
+ if (newbutton && local_player->LevelSolved_GameEnd)
#else
- if (AllPlayersGone && newbutton)
+ if (newbutton && AllPlayersGone)
#endif
{
GameEnd();