From 349fcdb7f8f53e2657309c2c0548a123af96c410 Mon Sep 17 00:00:00 2001 From: Joel de Vahl Date: Sun, 9 Dec 2007 18:19:42 +0000 Subject: [PATCH] Initial code for winter background --- datasrc/teewars.ds | 12 ++++++++++++ src/game/client/game_client.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/datasrc/teewars.ds b/datasrc/teewars.ds index 8773072b9..8c0f70c46 100644 --- a/datasrc/teewars.ds +++ b/datasrc/teewars.ds @@ -212,6 +212,18 @@ images { sun { filename "data/sun.png" } + + moon { + filename "data/moon.png" + } + + stars { + filename "data/stars.png" + } + + snow { + filename "data/snow.png" + } backdrop { filename "data/mountain_paralax.png" diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 3c3619c3b..250883f09 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -1614,6 +1614,28 @@ static void render_player( } } +void render_moon(float x, float y) +{ + gfx_texture_set(data->images[IMAGE_MOON].id); + gfx_quads_begin(); + gfx_quads_draw(x, y, 512, 512); + gfx_quads_end(); +} + +void render_stars() +{ + gfx_texture_set(data->images[IMAGE_STARS].id); + gfx_quads_begin(); + gfx_quads_end(); +} + +void render_snow() +{ + gfx_texture_set(data->images[IMAGE_SNOW].id); + gfx_quads_begin(); + gfx_quads_end(); +} + void render_sun(float x, float y) { vec2 pos(x, y); @@ -1919,6 +1941,10 @@ void render_world(float center_x, float center_y, float zoom) gfx_setcolorvertex(3, bottom.r, bottom.g, bottom.b, bottom.a); gfx_quads_drawTL(0, 0, 1, 1); gfx_quads_end(); + + render_stars(); + render_moon(20+center_x*0.6f, 20+center_y*0.6f); + render_snow(); mapscreen_to_world(center_x, center_y, zoom); }