mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-13 04:27:59 +01:00
implement progress bar on fulscreen toggling
This commit is contained in:
parent
e67ffb821c
commit
8c24ebd982
2 changed files with 12 additions and 4 deletions
|
@ -331,7 +331,6 @@ void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, floa
|
||||||
game->level.derpy = al_create_bitmap(al_get_bitmap_width(*(game->level.derpy_sheet))/game->level.sheet_cols, al_get_bitmap_height(*(game->level.derpy_sheet))/game->level.sheet_rows);
|
game->level.derpy = al_create_bitmap(al_get_bitmap_width(*(game->level.derpy_sheet))/game->level.sheet_cols, al_get_bitmap_height(*(game->level.derpy_sheet))/game->level.sheet_rows);
|
||||||
|
|
||||||
//TODO: load proper bitmap files for each level
|
//TODO: load proper bitmap files for each level
|
||||||
//TODO: maybe handle strange display aspects
|
|
||||||
game->level.clouds = LoadScaledBitmap("levels/1/clouds.png", game->viewportHeight*4.73307291666666666667, game->viewportHeight);
|
game->level.clouds = LoadScaledBitmap("levels/1/clouds.png", game->viewportHeight*4.73307291666666666667, game->viewportHeight);
|
||||||
PROGRESS;
|
PROGRESS;
|
||||||
game->level.foreground = LoadScaledBitmap("levels/1/foreground.png", game->viewportHeight*4.73307291666666666667, game->viewportHeight);
|
game->level.foreground = LoadScaledBitmap("levels/1/foreground.png", game->viewportHeight*4.73307291666666666667, game->viewportHeight);
|
||||||
|
|
|
@ -44,14 +44,23 @@ int Pause_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||||
al_flip_display();
|
al_flip_display();
|
||||||
SetupViewport(game);
|
SetupViewport(game);
|
||||||
Shared_Load(game);
|
Shared_Load(game);
|
||||||
al_draw_text_with_shadow(game->font, al_map_rgb(255,255,255), game->viewportWidth*0.0234, game->viewportHeight*0.85, ALLEGRO_ALIGN_LEFT, "Loading...");
|
|
||||||
al_flip_display();
|
void Progress(struct Game *game, float p) {
|
||||||
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
|
al_clear_to_color(al_map_rgb(0,0,0));
|
||||||
|
al_draw_text_with_shadow(game->font, al_map_rgb(255,255,255), game->viewportWidth*0.0234, game->viewportHeight*0.84, ALLEGRO_ALIGN_LEFT, "Loading...");
|
||||||
|
al_draw_filled_rectangle(0, game->viewportHeight*0.985, game->viewportWidth, game->viewportHeight, al_map_rgba(128,128,128,128));
|
||||||
|
al_draw_filled_rectangle(0, game->viewportHeight*0.985, p*game->viewportWidth, game->viewportHeight, al_map_rgba(255,255,255,255));
|
||||||
|
al_flip_display();
|
||||||
|
}
|
||||||
|
Progress(game, 0);
|
||||||
|
|
||||||
Loading_Unload(game);
|
Loading_Unload(game);
|
||||||
Loading_Load(game);
|
Loading_Load(game);
|
||||||
Menu_Unload(game);
|
Menu_Unload(game);
|
||||||
Menu_Preload(game, NULL);
|
Menu_Preload(game, NULL);
|
||||||
Level_UnloadBitmaps(game);
|
Level_UnloadBitmaps(game);
|
||||||
Level_PreloadBitmaps(game, NULL);
|
Level_PreloadBitmaps(game, &Progress);
|
||||||
Pause_Unload_Real(game);
|
Pause_Unload_Real(game);
|
||||||
Pause_Preload(game);
|
Pause_Preload(game);
|
||||||
Pause_Load(game);
|
Pause_Load(game);
|
||||||
|
|
Loading…
Reference in a new issue