diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-30 19:46:31 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-07-30 19:46:31 +0000 |
| commit | f826bc6cac4f4dfc191fa1d94f3336e117f44278 (patch) | |
| tree | 4e1a74ae9b3caf6f47ea28d17f22aa48a7019c29 /src/game/client/menu.cpp | |
| parent | 57da0cae4f2d072211b39a6618a102c6b620197f (diff) | |
| download | zcatch-f826bc6cac4f4dfc191fa1d94f3336e117f44278.tar.gz zcatch-f826bc6cac4f4dfc191fa1d94f3336e117f44278.zip | |
larger update. reduced the amount of video memory used from ~60 to ~36mb on a typical map
Diffstat (limited to 'src/game/client/menu.cpp')
| -rw-r--r-- | src/game/client/menu.cpp | 48 |
1 files changed, 10 insertions, 38 deletions
diff --git a/src/game/client/menu.cpp b/src/game/client/menu.cpp index 799f351d..8a02015a 100644 --- a/src/game/client/menu.cpp +++ b/src/game/client/menu.cpp @@ -141,7 +141,8 @@ struct pretty_font extern pretty_font *current_font; -void render_sun(float x, float y); +extern void render_sun(float x, float y); +extern void select_sprite(int id, int flags=0, int sx=0, int sy=0); void draw_background(float t) { @@ -152,48 +153,19 @@ void draw_background(float t) render_sun(170, 170); - gfx_texture_set(data->images[IMAGE_CLOUD_1].id); + gfx_texture_set(data->images[IMAGE_CLOUDS].id); gfx_quads_begin(); - gfx_quads_setcolor(1,1,1,1); - gfx_quads_setsubset( - 0.0f, // startx - 0.0f, // starty - 1.0f, // endx - 1.0f); // endy - gfx_quads_drawTL(3500 - fmod(t * 20 + 2000, 4524), 0, 512, 512); - gfx_quads_end(); - - gfx_texture_set(data->images[IMAGE_CLOUD_2].id); - gfx_quads_begin(); - gfx_quads_setcolor(1,1,1,1); - gfx_quads_setsubset( - 0.0f, // startx - 0.0f, // starty - 1.0f, // endx - 1.0f); // endy - gfx_quads_drawTL(3000 - fmod(t * 50 + 2000, 4024), 150, 512, 512); - gfx_quads_end(); - - gfx_texture_set(data->images[IMAGE_CLOUD_3].id); - gfx_quads_begin(); - gfx_quads_setcolor(1,1,1,1); - gfx_quads_setsubset( - 0.0f, // startx - 0.0f, // starty - 1.0f, // endx - 1.0f); // endy - gfx_quads_drawTL(4000 - fmod(t * 60 + 500, 4512), 300, 256, 256); + select_sprite(SPRITE_CLOUD1); + gfx_quads_drawTL(3500 - fmod(t * 20 + 2000, 4524), 0, 512, 512); + select_sprite(SPRITE_CLOUD2); + gfx_quads_drawTL(3000 - fmod(t * 50 + 2000, 4024), 150, 512, 512); + select_sprite(SPRITE_CLOUD3); + gfx_quads_drawTL(4000 - fmod(t * 60 + 500, 4512), 300, 256, 256); gfx_quads_end(); gfx_texture_set(data->images[IMAGE_MENU_BACKGROUND].id); gfx_quads_begin(); - gfx_quads_setcolor(1,1,1,1); - gfx_quads_setsubset( - 0.0f, // startx - 0.0f, // starty - 1.0f, // endx - 1.0f); // endy - gfx_quads_drawTL(0, -400, 1600, 1600); + gfx_quads_drawTL(0, 400, 1600, 1600/2); gfx_quads_end(); int frame = int(t * 10) % 3; |