From f194481a520a39a1964348011df8deb108f789b7 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 12 May 2024 16:57:19 +0200 Subject: splash art --- src/game.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index d17e432..c582ac4 100644 --- a/src/game.c +++ b/src/game.c @@ -372,9 +372,25 @@ static void move_camera(platform_window* window) { _global_camera.y = (int)_camera_buffer.y; } +void draw_splash(platform_window* window) { + image* img = img_splash_art1; + int imgw = img->width * (window->height/(float)img->height); + int imgh = window->height; + + int imgx = (window->width - imgw) / 2 + _global_camera.x; + int imgy = 0 + _global_camera.y; + + renderer->render_image(img, imgx, imgy, imgw, imgh); +} + void update_game(platform_window* window) { clear_bullets(); + if (global_state.state != GAMESTATE_PLAYING) { + draw_splash(window); + return; + } + if (global_state.server) { update_server(window); } -- cgit v1.2.3-70-g09d2