diff --git a/res/1.png b/res/1.png new file mode 100644 index 0000000..3f0f5e1 Binary files /dev/null and b/res/1.png differ diff --git a/res/1.svg b/res/1.svg new file mode 100644 index 0000000..a571cca --- /dev/null +++ b/res/1.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + diff --git a/res/you_won.png b/res/you_won.png new file mode 100644 index 0000000..5468122 Binary files /dev/null and b/res/you_won.png differ diff --git a/res/you_won.svg b/res/you_won.svg new file mode 100644 index 0000000..dc7bd5d --- /dev/null +++ b/res/you_won.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + You Won + + diff --git a/src/gui.c b/src/gui.c index 22abaff..9038ece 100644 --- a/src/gui.c +++ b/src/gui.c @@ -16,6 +16,7 @@ SDL_Texture *tile_texture = NULL; SDL_Texture *tile_textures[13]; SDL_Rect tile_size; SDL_Texture *game_over_texture = NULL; +SDL_Texture *you_won_texture = NULL; TTF_Font *Sans = NULL; SDL_Color Black = { 0, 0, 0 }; @@ -69,6 +70,7 @@ void gui_init() { SDL_QueryTexture(tile_texture, NULL, NULL, &tile_size.w, &tile_size.h); game_over_texture = texture_from_png("res/game_over.png"); + you_won_texture = texture_from_png("res/you_won.png"); Sans = TTF_OpenFont("/usr/share/fonts/liberation/LiberationSerif-Regular.ttf", 92); } @@ -81,6 +83,7 @@ void gui_destroy() { SDL_DestroyTexture(tile_textures[i]); } SDL_DestroyTexture(game_over_texture); + SDL_DestroyTexture(you_won_texture); TTF_Quit(); // Quit SDL subsystems @@ -168,6 +171,9 @@ void gui_loop(Game *game) { // render game over screen SDL_RenderCopy(window_renderer, game_over_texture, NULL, NULL); } + else if (game->won) { + SDL_RenderCopy(window_renderer, you_won_texture, NULL, NULL); + } SDL_RenderPresent(window_renderer); needs_redraw = false;