diff --git a/datasrc/teewars.ds b/datasrc/teewars.ds index 640fd9526..de92b3b5b 100644 --- a/datasrc/teewars.ds +++ b/datasrc/teewars.ds @@ -223,26 +223,6 @@ images { filename "data/game.png" } - 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" - } - cursor { filename "data/gui_cursor.png" } @@ -250,10 +230,6 @@ images { banner { filename "data/gui_logo.png" } - - clouds { - filename "data/cloudmap.png" - } emoticons { filename "data/emoticons.png" diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp index f4af5cc31..8df0e6981 100644 --- a/src/game/client/gc_client.cpp +++ b/src/game/client/gc_client.cpp @@ -642,7 +642,7 @@ void anim_eval_add(animstate *state, animation *anim, float time, float amount) anim_add(state, &add, amount); } -void draw_circle(float x, float y, float r, int segments) +static void draw_circle(float x, float y, float r, int segments) { float f_segments = (float)segments; for(int i = 0; i < segments; i+=2) @@ -665,171 +665,6 @@ void draw_circle(float x, float y, float r, int segments) } } -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() -{ - struct star - { - vec2 p; - float tingle; - float rot; - float size; - }; - - static const int NUM_STARS = 20; - static star stars[NUM_STARS]; - static bool init = true; - if(init) - { - for(int i = 0; i < NUM_STARS; i++) - { - stars[i].p.x = (frandom()-0.5f)*800*3; - stars[i].p.y = (frandom()-0.5f)*300*3; - stars[i].tingle = frandom(); - stars[i].rot = frandom()*pi; - stars[i].size = 30.0f+frandom()*20.0f; - } - - init = false; - } - - int64 now = time_get(); - int64 freq = time_freq()*5; - float t = (now%freq)/(float)freq; - gfx_texture_set(data->images[IMAGE_STARS].id); - gfx_quads_begin(); - gfx_quads_setsubset(0,0,0.5f,1); - for(int i = 0; i < NUM_STARS; i++) - { - float a = fmod(t+stars[i].tingle, 1.0f); - gfx_quads_setrotation(stars[i].rot); - gfx_setcolor(1,1,1,0.25f+sinf(a*pi)*0.75f); - gfx_quads_draw(stars[i].p.x, stars[i].p.y, stars[i].size, stars[i].size); - } - - gfx_quads_end(); -} - -void render_snow() -{ - vec2 tl, br; - gfx_getscreen(&tl.x, &tl.y, &br.x, &br.y); - tl.x += 1000; // this is here to fix positions below 0,0 - tl.y += 1000; - br.x += 1000; - br.y += 1000; - - struct flake - { - vec2 p; - float tingle; - float rot; - float size; - float yspeed; - float xspeed; - }; - - static const int NUM_FLAKES = 100; - static flake flakes[NUM_FLAKES]; - static bool init = true; - - float w = 400*6; - float h = 300*6; - - if(init) - { - for(int i = 0; i < NUM_FLAKES; i++) - { - flakes[i].p.x = frandom()*w; - flakes[i].p.y = frandom()*h; - flakes[i].tingle = frandom(); - flakes[i].rot = frandom()*pi; - flakes[i].size = 50.0f+frandom()*10.0f; - flakes[i].yspeed = 50+frandom()*20.0f; - flakes[i].xspeed = flakes[i].yspeed * (0.4+frandom()*0.4f); - } - - init = false; - } - - int basex = (int)(tl.x/w); - float splitx = tl.x-basex*w; - int basey = (int)(tl.y/h); - float splity = tl.y-basey*h; - - float f = client_frametime(); - gfx_texture_set(data->images[IMAGE_SNOW].id); - gfx_quads_begin(); - for(int i = 0; i < NUM_FLAKES; i++) - { - flakes[i].p.x -= f*flakes[i].xspeed; - flakes[i].p.y += f*flakes[i].yspeed; - if(flakes[i].p.x < 0) - flakes[i].p.x += w; - if(flakes[i].p.y > h) - flakes[i].p.y -= h; - - float x = flakes[i].p.x + basex*w; - float y = flakes[i].p.y + basey*h; - - if(flakes[i].p.x < splitx) - x += w; - if(flakes[i].p.y < splity) - y += h; - - x -= 1000; - y -= 1000; - - gfx_quads_setrotation(flakes[i].rot); - gfx_quads_draw(x, y, flakes[i].size, flakes[i].size); - } - - gfx_quads_end(); -} - -void render_sun(float x, float y) -{ - vec2 pos(x, y); - - gfx_texture_set(-1); - gfx_blend_additive(); - gfx_quads_begin(); - const int rays = 10; - gfx_setcolor(1.0f,1.0f,1.0f,0.025f); - for(int r = 0; r < rays; r++) - { - float a = r/(float)rays + client_localtime()*0.025f; - float size = (1.0f/(float)rays)*0.25f; - vec2 dir0(sinf((a-size)*pi*2.0f), cosf((a-size)*pi*2.0f)); - vec2 dir1(sinf((a+size)*pi*2.0f), cosf((a+size)*pi*2.0f)); - - gfx_setcolorvertex(0, 1.0f,1.0f,1.0f,0.025f); - gfx_setcolorvertex(1, 1.0f,1.0f,1.0f,0.025f); - gfx_setcolorvertex(2, 1.0f,1.0f,1.0f,0.0f); - gfx_setcolorvertex(3, 1.0f,1.0f,1.0f,0.0f); - const float range = 1000.0f; - gfx_quads_draw_freeform( - pos.x+dir0.x, pos.y+dir0.y, - pos.x+dir1.x, pos.y+dir1.y, - pos.x+dir0.x*range, pos.y+dir0.y*range, - pos.x+dir1.x*range, pos.y+dir1.y*range); - } - gfx_quads_end(); - gfx_blend_normal(); - - gfx_texture_set(data->images[IMAGE_SUN].id); - gfx_quads_begin(); - gfx_quads_draw(pos.x, pos.y, 256, 256); - gfx_quads_end(); -} - static vec2 emoticon_selector_mouse; void emoticon_selector_reset()