mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
don't allow loading GAMESTATE_PAUSE as primary game state
This commit is contained in:
parent
da13fcb41c
commit
7667473206
1 changed files with 5 additions and 0 deletions
|
@ -96,6 +96,10 @@ void DrawConsole(struct Game *game) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreloadGameState(struct Game *game, void (*progress)(struct Game*, float)) {
|
void PreloadGameState(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||||
|
if (game->loadstate<1) {
|
||||||
|
PrintConsole(game, "ERROR: Attempted to preload invalid gamestate %d! Loading GAMESTATE_MENU instead...", game->loadstate);
|
||||||
|
game->loadstate = GAMESTATE_MENU;
|
||||||
|
}
|
||||||
if ((game->loadstate==GAMESTATE_MENU) && (game->menu.loaded)) {
|
if ((game->loadstate==GAMESTATE_MENU) && (game->menu.loaded)) {
|
||||||
PrintConsole(game, "GAMESTATE_MENU already loaded, skipping...");
|
PrintConsole(game, "GAMESTATE_MENU already loaded, skipping...");
|
||||||
return;
|
return;
|
||||||
|
@ -167,6 +171,7 @@ void DrawGameState(struct Game *game) {
|
||||||
DRAW_STATE(GAMESTATE_DISCLAIMER, Disclaimer)
|
DRAW_STATE(GAMESTATE_DISCLAIMER, Disclaimer)
|
||||||
default:
|
default:
|
||||||
game->showconsole = true;
|
game->showconsole = true;
|
||||||
|
al_clear_to_color(al_map_rgb(0,0,0));
|
||||||
PrintConsole(game, "ERROR: Unknown gamestate %d reached! (5 sec sleep)", game->gamestate);
|
PrintConsole(game, "ERROR: Unknown gamestate %d reached! (5 sec sleep)", game->gamestate);
|
||||||
DrawConsole(game);
|
DrawConsole(game);
|
||||||
al_flip_display();
|
al_flip_display();
|
||||||
|
|
Loading…
Reference in a new issue