mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 19:16:44 +01:00
add Derpy to pause screen :D
This commit is contained in:
parent
9dcab1af04
commit
0d7edb94e3
5 changed files with 29 additions and 3 deletions
|
@ -73,10 +73,12 @@ void About_Preload(struct Game *game) {
|
||||||
draw_text(" http://dosowisko.net/");
|
draw_text(" http://dosowisko.net/");
|
||||||
draw_text("");
|
draw_text("");
|
||||||
draw_text("Graphics:");
|
draw_text("Graphics:");
|
||||||
draw_text(" - hombre0 (menu background)");
|
draw_text(" - hombre0");
|
||||||
draw_text(" http://hombre0.deviantart.com/");
|
draw_text(" http://hombre0.deviantart.com/");
|
||||||
draw_text(" - Siobhan Brewer (cloud shapes)");
|
draw_text(" - Siobhan Brewer");
|
||||||
draw_text(" http://boxdrink.deviantart.com/");
|
draw_text(" http://boxdrink.deviantart.com/");
|
||||||
|
draw_text(" - CptOfTheFriendship");
|
||||||
|
draw_text(" http://cptofthefriendship.deviantart.com/");
|
||||||
draw_text("");
|
draw_text("");
|
||||||
draw_text("Music:");
|
draw_text("Music:");
|
||||||
draw_text(" - Dr Dissonance (\"Don Discord\")");
|
draw_text(" - Dr Dissonance (\"Don Discord\")");
|
||||||
|
|
|
@ -94,9 +94,11 @@ void Level_Preload(struct Game *game) {
|
||||||
al_draw_textf(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)/2, al_get_display_height(game->display)/2.2, ALLEGRO_ALIGN_CENTRE, "Level %d: Not implemented yet!", game->level.current_level);
|
al_draw_textf(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)/2, al_get_display_height(game->display)/2.2, ALLEGRO_ALIGN_CENTRE, "Level %d: Not implemented yet!", game->level.current_level);
|
||||||
al_draw_text(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)/2, al_get_display_height(game->display)/1.8, ALLEGRO_ALIGN_CENTRE, "Have some moonwalk instead.");
|
al_draw_text(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)/2, al_get_display_height(game->display)/1.8, ALLEGRO_ALIGN_CENTRE, "Have some moonwalk instead.");
|
||||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
|
Pause_Preload(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level_Unload(struct Game *game) {
|
void Level_Unload(struct Game *game) {
|
||||||
|
Pause_Unload_Real(game);
|
||||||
ALLEGRO_EVENT ev;
|
ALLEGRO_EVENT ev;
|
||||||
game->level.fade_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
|
game->level.fade_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
|
||||||
al_set_target_bitmap(game->level.fade_bitmap);
|
al_set_target_bitmap(game->level.fade_bitmap);
|
||||||
|
|
|
@ -83,6 +83,7 @@ struct Loading {
|
||||||
/*! \brief Resources used by Pause state. */
|
/*! \brief Resources used by Pause state. */
|
||||||
struct Pause {
|
struct Pause {
|
||||||
ALLEGRO_BITMAP *bitmap;
|
ALLEGRO_BITMAP *bitmap;
|
||||||
|
ALLEGRO_BITMAP *derpy;
|
||||||
int selected;
|
int selected;
|
||||||
bool options;
|
bool options;
|
||||||
};
|
};
|
||||||
|
|
22
src/pause.c
22
src/pause.c
|
@ -43,6 +43,21 @@ int Pause_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pause_Preload(struct Game* game) {
|
||||||
|
game->pause.bitmap = NULL;
|
||||||
|
game->pause.derpy = al_create_bitmap(al_get_display_width(game->display)*0.53, al_get_display_height(game->display)*0.604);
|
||||||
|
|
||||||
|
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
|
||||||
|
ALLEGRO_BITMAP *derpy = al_load_bitmap( "data/derpy_pause.png" );
|
||||||
|
al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR | ALLEGRO_MIN_LINEAR);
|
||||||
|
|
||||||
|
al_set_target_bitmap(game->pause.derpy);
|
||||||
|
ScaleBitmap(derpy, al_get_display_width(game->display)*0.53, al_get_display_height(game->display)*0.604);
|
||||||
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
|
|
||||||
|
al_destroy_bitmap(derpy);
|
||||||
|
}
|
||||||
|
|
||||||
void Pause_Load(struct Game* game) {
|
void Pause_Load(struct Game* game) {
|
||||||
game->gamestate=game->loadstate;
|
game->gamestate=game->loadstate;
|
||||||
game->loadstate=GAMESTATE_PAUSE;
|
game->loadstate=GAMESTATE_PAUSE;
|
||||||
|
@ -58,6 +73,7 @@ void Pause_Load(struct Game* game) {
|
||||||
game->pause.bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
|
game->pause.bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
|
||||||
al_set_target_bitmap(game->pause.bitmap);
|
al_set_target_bitmap(game->pause.bitmap);
|
||||||
al_draw_bitmap(al_get_backbuffer(game->display), 0, 0, 0);
|
al_draw_bitmap(al_get_backbuffer(game->display), 0, 0, 0);
|
||||||
|
al_draw_bitmap(game->pause.derpy, 0.47*al_get_display_width(game->display), al_get_display_height(game->display)*0.396, 0);
|
||||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
al_destroy_bitmap(fade);
|
al_destroy_bitmap(fade);
|
||||||
game->pause.selected=0;
|
game->pause.selected=0;
|
||||||
|
@ -96,8 +112,12 @@ void Pause_Draw(struct Game* game) {
|
||||||
DrawConsole(game);
|
DrawConsole(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pause_Unload_Real(struct Game* game) {
|
||||||
|
if (game->pause.bitmap) al_destroy_bitmap(game->pause.bitmap);
|
||||||
|
al_destroy_bitmap(game->pause.derpy);
|
||||||
|
}
|
||||||
|
|
||||||
void Pause_Unload(struct Game* game) {
|
void Pause_Unload(struct Game* game) {
|
||||||
al_destroy_bitmap(game->pause.bitmap);
|
|
||||||
game->gamestate=game->loadstate;
|
game->gamestate=game->loadstate;
|
||||||
UnloadGameState(game);
|
UnloadGameState(game);
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
void Pause_Draw(struct Game *game);
|
void Pause_Draw(struct Game *game);
|
||||||
void Pause_Preload(struct Game *game);
|
void Pause_Preload(struct Game *game);
|
||||||
|
void Pause_Unload_Real(struct Game* game);
|
||||||
void Pause_Unload(struct Game *game);
|
void Pause_Unload(struct Game *game);
|
||||||
void Pause_Load(struct Game *game);
|
void Pause_Load(struct Game *game);
|
||||||
int Pause_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
int Pause_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||||
|
|
Loading…
Reference in a new issue