mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 19:16:44 +01:00
fix loading menu when starting with other gamestate
This commit is contained in:
parent
e4e848b175
commit
572d147e0c
2 changed files with 9 additions and 0 deletions
|
@ -24,6 +24,11 @@
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
|
|
||||||
void Menu_Draw(struct Game *game) {
|
void Menu_Draw(struct Game *game) {
|
||||||
|
if (!game->menu.loaded) {
|
||||||
|
game->gamestate=GAMESTATE_LOADING;
|
||||||
|
game->loadstate=GAMESTATE_MENU;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
al_set_target_bitmap(game->menu.pinkcloud_bitmap);
|
al_set_target_bitmap(game->menu.pinkcloud_bitmap);
|
||||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
al_clear_to_color(al_map_rgba(0,0,0,0));
|
||||||
|
@ -190,9 +195,12 @@ void Menu_Unload(struct Game *game) {
|
||||||
al_destroy_sample(game->menu.sample);
|
al_destroy_sample(game->menu.sample);
|
||||||
al_destroy_sample(game->menu.rain_sample);
|
al_destroy_sample(game->menu.rain_sample);
|
||||||
al_destroy_sample(game->menu.click_sample);
|
al_destroy_sample(game->menu.click_sample);
|
||||||
|
game->menu.loaded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu_Load(struct Game *game) {
|
void Menu_Load(struct Game *game) {
|
||||||
|
if (!game->menu.loaded) return;
|
||||||
|
|
||||||
game->menu.cloud_position = 100;
|
game->menu.cloud_position = 100;
|
||||||
game->menu.cloud2_position = 100;
|
game->menu.cloud2_position = 100;
|
||||||
game->menu.options = false;
|
game->menu.options = false;
|
||||||
|
|
|
@ -75,6 +75,7 @@ void Pause_Preload(struct Game* game) {
|
||||||
game->pause.bitmap = NULL;
|
game->pause.bitmap = NULL;
|
||||||
game->pause.derpy = LoadScaledBitmap("derpy_pause.png", al_get_display_width(game->display)*0.53, al_get_display_height(game->display)*0.604);
|
game->pause.derpy = LoadScaledBitmap("derpy_pause.png", al_get_display_width(game->display)*0.53, al_get_display_height(game->display)*0.604);
|
||||||
PrintConsole(game,"Pause preloaded.");
|
PrintConsole(game,"Pause preloaded.");
|
||||||
|
if (!game->menu.loaded) Menu_Preload(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pause_Load(struct Game* game) {
|
void Pause_Load(struct Game* game) {
|
||||||
|
|
Loading…
Reference in a new issue