mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Initial code for winter background
This commit is contained in:
parent
88078b8de0
commit
349fcdb7f8
|
@ -212,6 +212,18 @@ images {
|
||||||
sun {
|
sun {
|
||||||
filename "data/sun.png"
|
filename "data/sun.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moon {
|
||||||
|
filename "data/moon.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
stars {
|
||||||
|
filename "data/stars.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
snow {
|
||||||
|
filename "data/snow.png"
|
||||||
|
}
|
||||||
|
|
||||||
backdrop {
|
backdrop {
|
||||||
filename "data/mountain_paralax.png"
|
filename "data/mountain_paralax.png"
|
||||||
|
|
|
@ -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)
|
void render_sun(float x, float y)
|
||||||
{
|
{
|
||||||
vec2 pos(x, 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_setcolorvertex(3, bottom.r, bottom.g, bottom.b, bottom.a);
|
||||||
gfx_quads_drawTL(0, 0, 1, 1);
|
gfx_quads_drawTL(0, 0, 1, 1);
|
||||||
gfx_quads_end();
|
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);
|
mapscreen_to_world(center_x, center_y, zoom);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue