From d15860e44f3cbe0c92add6acd24ace564442645d Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Mon, 20 Oct 2008 23:46:39 +0000 Subject: renamed gc_render* to render* --- src/game/client/components/damageind.cpp | 2 +- src/game/client/components/debughud.cpp | 2 +- src/game/client/components/emoticon.cpp | 2 +- src/game/client/components/hud.cpp | 2 +- src/game/client/components/items.cpp | 2 +- src/game/client/components/maplayers.cpp | 2 +- src/game/client/components/menus_browser.cpp | 2 +- src/game/client/components/menus_demo.cpp | 2 +- src/game/client/components/menus_settings.cpp | 2 +- src/game/client/components/particles.cpp | 2 +- src/game/client/components/players.cpp | 2 +- src/game/client/components/scoreboard.cpp | 2 +- src/game/client/components/voting.cpp | 2 +- src/game/client/gameclient.cpp | 2 +- src/game/client/gameclient.hpp | 2 +- src/game/client/gc_render.cpp | 311 -------------------------- src/game/client/gc_render.hpp | 68 ------ src/game/client/gc_render_map.cpp | 274 ----------------------- src/game/client/render.cpp | 311 ++++++++++++++++++++++++++ src/game/client/render.hpp | 68 ++++++ src/game/client/render_map.cpp | 274 +++++++++++++++++++++++ src/game/editor/ed_editor.cpp | 2 +- src/game/editor/ed_editor.hpp | 2 +- src/game/editor/ed_layer_quads.cpp | 2 +- src/game/editor/ed_layer_tiles.cpp | 2 +- 25 files changed, 672 insertions(+), 672 deletions(-) delete mode 100644 src/game/client/gc_render.cpp delete mode 100644 src/game/client/gc_render.hpp delete mode 100644 src/game/client/gc_render_map.cpp create mode 100644 src/game/client/render.cpp create mode 100644 src/game/client/render.hpp create mode 100644 src/game/client/render_map.cpp (limited to 'src/game') diff --git a/src/game/client/components/damageind.cpp b/src/game/client/components/damageind.cpp index f6176346..f585e4d3 100644 --- a/src/game/client/components/damageind.cpp +++ b/src/game/client/components/damageind.cpp @@ -4,7 +4,7 @@ #include // get_angle #include -#include +#include #include "damageind.hpp" DAMAGEIND::DAMAGEIND() diff --git a/src/game/client/components/debughud.cpp b/src/game/client/components/debughud.cpp index 7bb48307..ada006ea 100644 --- a/src/game/client/components/debughud.cpp +++ b/src/game/client/components/debughud.cpp @@ -12,7 +12,7 @@ extern "C" { #include #include -#include +#include //#include "controls.hpp" //#include "camera.hpp" diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index ca1d64b7..d76d6b22 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -5,7 +5,7 @@ #include // get_angle #include #include -#include +#include #include "emoticon.hpp" EMOTICON::EMOTICON() diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 2b1c1663..ef503a19 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include "controls.hpp" #include "camera.hpp" diff --git a/src/game/client/components/items.cpp b/src/game/client/components/items.cpp index c880b93e..1d579619 100644 --- a/src/game/client/components/items.cpp +++ b/src/game/client/components/items.cpp @@ -5,7 +5,7 @@ #include // get_angle #include #include -#include +#include #include #include diff --git a/src/game/client/components/maplayers.cpp b/src/game/client/components/maplayers.cpp index c6fea413..1d162999 100644 --- a/src/game/client/components/maplayers.cpp +++ b/src/game/client/components/maplayers.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 3cba5311..35397662 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -12,7 +12,7 @@ extern "C" { #include #include -#include +#include #include "menus.hpp" #include diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 81717bf7..1d94e736 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -5,7 +5,7 @@ //#include // atoi #include -#include +#include #include //#include diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 5f080d05..c536753c 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/src/game/client/components/particles.cpp b/src/game/client/components/particles.cpp index 58af6f55..ef6dbbe9 100644 --- a/src/game/client/components/particles.cpp +++ b/src/game/client/components/particles.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "particles.hpp" diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 51ab8fad..816f0293 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 9159d391..cbcaf422 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "scoreboard.hpp" diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 1386071d..7411e2ca 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include //#include #include "voting.hpp" diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 1b50a081..912a0c5d 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -4,7 +4,7 @@ #include #include -#include "gc_render.hpp" +#include "render.hpp" #include "gameclient.hpp" diff --git a/src/game/client/gameclient.hpp b/src/game/client/gameclient.hpp index d2a12099..c93a9168 100644 --- a/src/game/client/gameclient.hpp +++ b/src/game/client/gameclient.hpp @@ -1,7 +1,7 @@ #include #include -#include "gc_render.hpp" +#include "render.hpp" class GAMECLIENT { diff --git a/src/game/client/gc_render.cpp b/src/game/client/gc_render.cpp deleted file mode 100644 index 74cfc850..00000000 --- a/src/game/client/gc_render.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ -#include - -#include - -#include -#include -#include -#include -#include -#include "animstate.hpp" -#include "gc_render.hpp" - -static float sprite_w_scale; -static float sprite_h_scale; -/* -static void layershot_begin() -{ - if(!config.cl_layershot) - return; - - gfx_clear(0,0,0); -} - -static void layershot_end() -{ - if(!config.cl_layershot) - return; - - char buf[256]; - str_format(buf, sizeof(buf), "screenshots/layers_%04d.png", config.cl_layershot); - gfx_screenshot_direct(buf); - config.cl_layershot++; -}*/ - -void select_sprite(SPRITE *spr, int flags, int sx, int sy) -{ - int x = spr->x+sx; - int y = spr->y+sy; - int w = spr->w; - int h = spr->h; - int cx = spr->set->gridx; - int cy = spr->set->gridy; - - float f = sqrtf(h*h + w*w); - sprite_w_scale = w/f; - sprite_h_scale = h/f; - - float x1 = x/(float)cx; - float x2 = (x+w)/(float)cx; - float y1 = y/(float)cy; - float y2 = (y+h)/(float)cy; - float temp = 0; - - if(flags&SPRITE_FLAG_FLIP_Y) - { - temp = y1; - y1 = y2; - y2 = temp; - } - - if(flags&SPRITE_FLAG_FLIP_X) - { - temp = x1; - x1 = x2; - x2 = temp; - } - - gfx_quads_setsubset(x1, y1, x2, y2); -} - -void select_sprite(int id, int flags, int sx, int sy) -{ - if(id < 0 || id > data->num_sprites) - return; - select_sprite(&data->sprites[id], flags, sx, sy); -} - -void draw_sprite(float x, float y, float size) -{ - gfx_quads_draw(x, y, size*sprite_w_scale, size*sprite_h_scale); -} - -void draw_round_rect_ext(float x, float y, float w, float h, float r, int corners) -{ - int num = 8; - for(int i = 0; i < num; i+=2) - { - float a1 = i/(float)num * pi/2; - float a2 = (i+1)/(float)num * pi/2; - float a3 = (i+2)/(float)num * pi/2; - float ca1 = cosf(a1); - float ca2 = cosf(a2); - float ca3 = cosf(a3); - float sa1 = sinf(a1); - float sa2 = sinf(a2); - float sa3 = sinf(a3); - - if(corners&1) // TL - gfx_quads_draw_freeform( - x+r, y+r, - x+(1-ca1)*r, y+(1-sa1)*r, - x+(1-ca3)*r, y+(1-sa3)*r, - x+(1-ca2)*r, y+(1-sa2)*r); - - if(corners&2) // TR - gfx_quads_draw_freeform( - x+w-r, y+r, - x+w-r+ca1*r, y+(1-sa1)*r, - x+w-r+ca3*r, y+(1-sa3)*r, - x+w-r+ca2*r, y+(1-sa2)*r); - - if(corners&4) // BL - gfx_quads_draw_freeform( - x+r, y+h-r, - x+(1-ca1)*r, y+h-r+sa1*r, - x+(1-ca3)*r, y+h-r+sa3*r, - x+(1-ca2)*r, y+h-r+sa2*r); - - if(corners&8) // BR - gfx_quads_draw_freeform( - x+w-r, y+h-r, - x+w-r+ca1*r, y+h-r+sa1*r, - x+w-r+ca3*r, y+h-r+sa3*r, - x+w-r+ca2*r, y+h-r+sa2*r); - } - - gfx_quads_drawTL(x+r, y+r, w-r*2, h-r*2); // center - gfx_quads_drawTL(x+r, y, w-r*2, r); // top - gfx_quads_drawTL(x+r, y+h-r, w-r*2, r); // bottom - gfx_quads_drawTL(x, y+r, r, h-r*2); // left - gfx_quads_drawTL(x+w-r, y+r, r, h-r*2); // right - - if(!(corners&1)) gfx_quads_drawTL(x, y, r, r); // TL - if(!(corners&2)) gfx_quads_drawTL(x+w, y, -r, r); // TR - if(!(corners&4)) gfx_quads_drawTL(x, y+h, r, -r); // BL - if(!(corners&8)) gfx_quads_drawTL(x+w, y+h, -r, -r); // BR -} - -void draw_round_rect(float x, float y, float w, float h, float r) -{ - draw_round_rect_ext(x,y,w,h,r,0xf); -} - -void ui_draw_rect(const RECT *r, vec4 color, int corners, float rounding) -{ - gfx_texture_set(-1); - gfx_quads_begin(); - gfx_setcolor(color.r, color.g, color.b, color.a); - draw_round_rect_ext(r->x,r->y,r->w,r->h,rounding*ui_scale(), corners); - gfx_quads_end(); -} - -void render_tee(ANIMSTATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos) -{ - vec2 direction = dir; - vec2 position = pos; - - //gfx_texture_set(data->images[IMAGE_CHAR_DEFAULT].id); - gfx_texture_set(info->texture); - gfx_quads_begin(); - //gfx_quads_draw(pos.x, pos.y-128, 128, 128); - - // first pass we draw the outline - // second pass we draw the filling - for(int p = 0; p < 2; p++) - { - int outline = p==0 ? 1 : 0; - - for(int f = 0; f < 2; f++) - { - float animscale = info->size * 1.0f/64.0f; - float basesize = info->size; - if(f == 1) - { - gfx_quads_setrotation(anim->body.angle*pi*2); - - // draw body - gfx_setcolor(info->color_body.r, info->color_body.g, info->color_body.b, 1.0f); - vec2 body_pos = position + vec2(anim->body.x, anim->body.y)*animscale; - select_sprite(outline?SPRITE_TEE_BODY_OUTLINE:SPRITE_TEE_BODY, 0, 0, 0); - gfx_quads_draw(body_pos.x, body_pos.y, basesize, basesize); - - // draw eyes - if(p == 1) - { - switch (emote) - { - case EMOTE_PAIN: - select_sprite(SPRITE_TEE_EYE_PAIN, 0, 0, 0); - break; - case EMOTE_HAPPY: - select_sprite(SPRITE_TEE_EYE_HAPPY, 0, 0, 0); - break; - case EMOTE_SURPRISE: - select_sprite(SPRITE_TEE_EYE_SURPRISE, 0, 0, 0); - break; - case EMOTE_ANGRY: - select_sprite(SPRITE_TEE_EYE_ANGRY, 0, 0, 0); - break; - default: - select_sprite(SPRITE_TEE_EYE_NORMAL, 0, 0, 0); - break; - } - - float eyescale = basesize*0.40f; - float h = emote == EMOTE_BLINK ? basesize*0.15f : eyescale; - float eyeseparation = (0.075f - 0.010f*fabs(direction.x))*basesize; - vec2 offset = vec2(direction.x*0.125f, -0.05f+direction.y*0.10f)*basesize; - gfx_quads_draw(body_pos.x-eyeseparation+offset.x, body_pos.y+offset.y, eyescale, h); - gfx_quads_draw(body_pos.x+eyeseparation+offset.x, body_pos.y+offset.y, -eyescale, h); - } - } - - // draw feet - ANIM_KEYFRAME *foot = f ? &anim->front_foot : &anim->back_foot; - - float w = basesize; - float h = basesize/2; - - gfx_quads_setrotation(foot->angle*pi*2); - - bool indicate = !info->got_airjump && config.cl_airjumpindicator; - float cs = 1.0f; // color scale - - if(outline) - select_sprite(SPRITE_TEE_FOOT_OUTLINE, 0, 0, 0); - else - { - select_sprite(SPRITE_TEE_FOOT, 0, 0, 0); - if(indicate) - cs = 0.5f; - } - - gfx_setcolor(info->color_feet.r*cs, info->color_feet.g*cs, info->color_feet.b*cs, 1.0f); - gfx_quads_draw(position.x+foot->x*animscale, position.y+foot->y*animscale, w, h); - } - } - - gfx_quads_end(); - - -} - -static void calc_screen_params(float amount, float wmax, float hmax, float aspect, float *w, float *h) -{ - float f = sqrt(amount) / sqrt(aspect); - *w = f*aspect; - *h = f; - - // limit the view - if(*w > wmax) - { - *w = wmax; - *h = *w/aspect; - } - - if(*h > hmax) - { - *h = hmax; - *w = *h*aspect; - } -} - -void mapscreen_to_world(float center_x, float center_y, float parallax_x, float parallax_y, - float offset_x, float offset_y, float aspect, float zoom, float *points) -{ - float width, height; - calc_screen_params(1150*1000, 1500, 1050, aspect, &width, &height); - center_x *= parallax_x; - center_y *= parallax_y; - width *= zoom; - height *= zoom; - points[0] = offset_x+center_x-width/2; - points[1] = offset_y+center_y-height/2; - points[2] = offset_x+center_x+width/2; - points[3] = offset_y+center_y+height/2; -} - -void render_tilemap_generate_skip() -{ - for(int g = 0; g < layers_num_groups(); g++) - { - MAPITEM_GROUP *group = layers_get_group(g); - - for(int l = 0; l < group->num_layers; l++) - { - MAPITEM_LAYER *layer = layers_get_layer(group->start_layer+l); - - if(layer->type == LAYERTYPE_TILES) - { - MAPITEM_LAYER_TILEMAP *tmap = (MAPITEM_LAYER_TILEMAP *)layer; - TILE *tiles = (TILE *)map_get_data(tmap->data); - for(int y = 0; y < tmap->height; y++) - { - for(int x = 1; x < tmap->width; x++) - { - int sx; - for(sx = 1; x+sx < tmap->width && sx < 255; sx++) - { - if(tiles[y*tmap->width+x+sx].index) - break; - } - - tiles[y*tmap->width+x].skip = sx-1; - } - } - } - } - } -} diff --git a/src/game/client/gc_render.hpp b/src/game/client/gc_render.hpp deleted file mode 100644 index 917641c8..00000000 --- a/src/game/client/gc_render.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ -#ifndef GAME_CLIENT_RENDER_H -#define GAME_CLIENT_RENDER_H - -#include - -#include "../mapitems.hpp" -#include "ui.hpp" - -struct TEE_RENDER_INFO -{ - TEE_RENDER_INFO() - { - texture = -1; - color_body = vec4(1,1,1,1); - color_feet = vec4(1,1,1,1); - size = 1.0f; - got_airjump = 1; - }; - - int texture; - vec4 color_body; - vec4 color_feet; - float size; - int got_airjump; -}; - -// sprite renderings -enum -{ - SPRITE_FLAG_FLIP_Y=1, - SPRITE_FLAG_FLIP_X=2, - - LAYERRENDERFLAG_OPAQUE=1, - LAYERRENDERFLAG_TRANSPARENT=2, - - TILERENDERFLAG_EXTEND=4, -}; - -typedef struct SPRITE; - -void select_sprite(SPRITE *spr, int flags=0, int sx=0, int sy=0); -void select_sprite(int id, int flags=0, int sx=0, int sy=0); - -void draw_sprite(float x, float y, float size); - -// rects -void draw_round_rect(float x, float y, float w, float h, float r); -void draw_round_rect_ext(float x, float y, float w, float h, float r, int corners); -void ui_draw_rect(const RECT *r, vec4 color, int corners, float rounding); - -// larger rendering methods -void render_tilemap_generate_skip(); - -// object render methods (gc_render_obj.cpp) -void render_tee(class ANIMSTATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos); - -// map render methods (gc_render_map.cpp) -void render_eval_envelope(ENVPOINT *points, int num_points, int channels, float time, float *result); -void render_quads(QUAD *quads, int num_quads, void (*eval)(float time_offset, int env, float *channels), int flags); -void render_tilemap(TILE *tiles, int w, int h, float scale, vec4 color, int flags); - -// helpers -void mapscreen_to_world(float center_x, float center_y, float parallax_x, float parallax_y, - float offset_x, float offset_y, float aspect, float zoom, float *points); - - -#endif diff --git a/src/game/client/gc_render_map.cpp b/src/game/client/gc_render_map.cpp deleted file mode 100644 index d4f35d6c..00000000 --- a/src/game/client/gc_render_map.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ -#include -#include -#include - -#include "gc_render.hpp" - -void render_eval_envelope(ENVPOINT *points, int num_points, int channels, float time, float *result) -{ - if(num_points == 0) - { - result[0] = 0; - result[1] = 0; - result[2] = 0; - result[3] = 0; - return; - } - - if(num_points == 1) - { - result[0] = fx2f(points[0].values[0]); - result[1] = fx2f(points[0].values[1]); - result[2] = fx2f(points[0].values[2]); - result[3] = fx2f(points[0].values[3]); - return; - } - - time = fmod(time, points[num_points-1].time/1000.0f)*1000.0f; - for(int i = 0; i < num_points-1; i++) - { - if(time >= points[i].time && time <= points[i+1].time) - { - float delta = points[i+1].time-points[i].time; - float a = (time-points[i].time)/delta; - - - if(points[i].curvetype == CURVETYPE_SMOOTH) - a = -2*a*a*a + 3*a*a; // second hermite basis - else if(points[i].curvetype == CURVETYPE_SLOW) - a = a*a*a; - else if(points[i].curvetype == CURVETYPE_FAST) - { - a = 1-a; - a = 1-a*a*a; - } - else if (points[i].curvetype == CURVETYPE_STEP) - a = 0; - else - { - // linear - } - - for(int c = 0; c < channels; c++) - { - float v0 = fx2f(points[i].values[c]); - float v1 = fx2f(points[i+1].values[c]); - result[c] = v0 + (v1-v0) * a; - } - - return; - } - } - - result[0] = fx2f(points[num_points-1].values[0]); - result[1] = fx2f(points[num_points-1].values[1]); - result[2] = fx2f(points[num_points-1].values[2]); - result[3] = fx2f(points[num_points-1].values[3]); - return; -} - - -static void rotate(POINT *center, POINT *point, float rotation) -{ - int x = point->x - center->x; - int y = point->y - center->y; - point->x = (int)(x * cosf(rotation) - y * sinf(rotation) + center->x); - point->y = (int)(x * sinf(rotation) + y * cosf(rotation) + center->y); -} - -void render_quads(QUAD *quads, int num_quads, void (*eval)(float time_offset, int env, float *channels), int renderflags) -{ - gfx_quads_begin(); - float conv = 1/255.0f; - for(int i = 0; i < num_quads; i++) - { - QUAD *q = &quads[i]; - - float r=1, g=1, b=1, a=1; - - if(q->color_env >= 0) - { - float channels[4]; - eval(q->color_env_offset/1000.0f, q->color_env, channels); - r = channels[0]; - g = channels[1]; - b = channels[2]; - a = channels[3]; - } - - bool opaque = false; - if(a < 0.01f || (q->colors[0].a < 0.01f && q->colors[1].a < 0.01f && q->colors[2].a < 0.01f && q->colors[3].a < 0.01f)) - opaque = true; - - if(opaque && !(renderflags&LAYERRENDERFLAG_OPAQUE)) - continue; - if(!opaque && !(renderflags&LAYERRENDERFLAG_TRANSPARENT)) - continue; - - gfx_quads_setsubset_free( - fx2f(q->texcoords[0].x), fx2f(q->texcoords[0].y), - fx2f(q->texcoords[1].x), fx2f(q->texcoords[1].y), - fx2f(q->texcoords[2].x), fx2f(q->texcoords[2].y), - fx2f(q->texcoords[3].x), fx2f(q->texcoords[3].y) - ); - - float offset_x = 0; - float offset_y = 0; - float rot = 0; - - // TODO: fix this - if(q->pos_env >= 0) - { - float channels[4]; - eval(q->pos_env_offset/1000.0f, q->pos_env, channels); - offset_x = channels[0]; - offset_y = channels[1]; - rot = channels[2]/360.0f*pi*2; - } - - - gfx_setcolorvertex(0, q->colors[0].r*conv*r, q->colors[0].g*conv*g, q->colors[0].b*conv*b, q->colors[0].a*conv*a); - gfx_setcolorvertex(1, q->colors[1].r*conv*r, q->colors[1].g*conv*g, q->colors[1].b*conv*b, q->colors[1].a*conv*a); - gfx_setcolorvertex(2, q->colors[2].r*conv*r, q->colors[2].g*conv*g, q->colors[2].b*conv*b, q->colors[2].a*conv*a); - gfx_setcolorvertex(3, q->colors[3].r*conv*r, q->colors[3].g*conv*g, q->colors[3].b*conv*b, q->colors[3].a*conv*a); - - POINT *points = q->points; - - if(rot != 0) - { - static POINT rotated[4]; - rotated[0] = q->points[0]; - rotated[1] = q->points[1]; - rotated[2] = q->points[2]; - rotated[3] = q->points[3]; - points = rotated; - - rotate(&q->points[4], &rotated[0], rot); - rotate(&q->points[4], &rotated[1], rot); - rotate(&q->points[4], &rotated[2], rot); - rotate(&q->points[4], &rotated[3], rot); - } - - gfx_quads_draw_freeform( - fx2f(points[0].x)+offset_x, fx2f(points[0].y)+offset_y, - fx2f(points[1].x)+offset_x, fx2f(points[1].y)+offset_y, - fx2f(points[2].x)+offset_x, fx2f(points[2].y)+offset_y, - fx2f(points[3].x)+offset_x, fx2f(points[3].y)+offset_y - ); - } - gfx_quads_end(); -} - -void render_tilemap(TILE *tiles, int w, int h, float scale, vec4 color, int renderflags) -{ - //gfx_texture_set(img_get(tmap->image)); - float screen_x0, screen_y0, screen_x1, screen_y1; - gfx_getscreen(&screen_x0, &screen_y0, &screen_x1, &screen_y1); - //gfx_mapscreen(screen_x0-50, screen_y0-50, screen_x1+50, screen_y1+50); - - // calculate the final pixelsize for the tiles - float tile_pixelsize = 1024/32.0f; - float final_tilesize = scale/(screen_x1-screen_x0) * gfx_screenwidth(); - float final_tilesize_scale = final_tilesize/tile_pixelsize; - - gfx_quads_begin(); - gfx_setcolor(color.r, color.g, color.b, color.a); - - int starty = (int)(screen_y0/scale)-1; - int startx = (int)(screen_x0/scale)-1; - int endy = (int)(screen_y1/scale)+1; - int endx = (int)(screen_x1/scale)+1; - - // adjust the texture shift according to mipmap level - float texsize = 1024.0f; - float frac = (1.25f/texsize) * (1/final_tilesize_scale); - float nudge = (0.5f/texsize) * (1/final_tilesize_scale); - - for(int y = starty; y < endy; y++) - for(int x = startx; x < endx; x++) - { - int mx = x; - int my = y; - - if(renderflags&TILERENDERFLAG_EXTEND) - { - if(mx<0) - mx = 0; - if(mx>=w) - mx = w-1; - if(my<0) - my = 0; - if(my>=h) - my = h-1; - } - else - { - if(mx<0) - continue; // mx = 0; - if(mx>=w) - continue; // mx = w-1; - if(my<0) - continue; // my = 0; - if(my>=h) - continue; // my = h-1; - } - - int c = mx + my*w; - - unsigned char index = tiles[c].index; - if(index) - { - unsigned char flags = tiles[c].flags; - - bool render = false; - if(flags&TILEFLAG_OPAQUE) - { - if(renderflags&LAYERRENDERFLAG_OPAQUE) - render = true; - } - else - { - if(renderflags&LAYERRENDERFLAG_TRANSPARENT) - render = true; - } - - if(render) - { - - int tx = index%16; - int ty = index/16; - int px0 = tx*(1024/16); - int py0 = ty*(1024/16); - int px1 = (tx+1)*(1024/16)-1; - int py1 = (ty+1)*(1024/16)-1; - - float u0 = nudge + px0/texsize+frac; - float v0 = nudge + py0/texsize+frac; - float u1 = nudge + px1/texsize-frac; - float v1 = nudge + py1/texsize-frac; - - if(flags&TILEFLAG_VFLIP) - { - float tmp = u0; - u0 = u1; - u1 = tmp; - } - - if(flags&TILEFLAG_HFLIP) - { - float tmp = v0; - v0 = v1; - v1 = tmp; - } - - gfx_quads_setsubset(u0,v0,u1,v1); - gfx_quads_drawTL(x*scale, y*scale, scale, scale); - } - } - x += tiles[c].skip; - } - - gfx_quads_end(); - gfx_mapscreen(screen_x0, screen_y0, screen_x1, screen_y1); -} diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp new file mode 100644 index 00000000..f63e8692 --- /dev/null +++ b/src/game/client/render.cpp @@ -0,0 +1,311 @@ +/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#include + +#include + +#include +#include +#include +#include +#include +#include "animstate.hpp" +#include "render.hpp" + +static float sprite_w_scale; +static float sprite_h_scale; +/* +static void layershot_begin() +{ + if(!config.cl_layershot) + return; + + gfx_clear(0,0,0); +} + +static void layershot_end() +{ + if(!config.cl_layershot) + return; + + char buf[256]; + str_format(buf, sizeof(buf), "screenshots/layers_%04d.png", config.cl_layershot); + gfx_screenshot_direct(buf); + config.cl_layershot++; +}*/ + +void select_sprite(SPRITE *spr, int flags, int sx, int sy) +{ + int x = spr->x+sx; + int y = spr->y+sy; + int w = spr->w; + int h = spr->h; + int cx = spr->set->gridx; + int cy = spr->set->gridy; + + float f = sqrtf(h*h + w*w); + sprite_w_scale = w/f; + sprite_h_scale = h/f; + + float x1 = x/(float)cx; + float x2 = (x+w)/(float)cx; + float y1 = y/(float)cy; + float y2 = (y+h)/(float)cy; + float temp = 0; + + if(flags&SPRITE_FLAG_FLIP_Y) + { + temp = y1; + y1 = y2; + y2 = temp; + } + + if(flags&SPRITE_FLAG_FLIP_X) + { + temp = x1; + x1 = x2; + x2 = temp; + } + + gfx_quads_setsubset(x1, y1, x2, y2); +} + +void select_sprite(int id, int flags, int sx, int sy) +{ + if(id < 0 || id > data->num_sprites) + return; + select_sprite(&data->sprites[id], flags, sx, sy); +} + +void draw_sprite(float x, float y, float size) +{ + gfx_quads_draw(x, y, size*sprite_w_scale, size*sprite_h_scale); +} + +void draw_round_rect_ext(float x, float y, float w, float h, float r, int corners) +{ + int num = 8; + for(int i = 0; i < num; i+=2) + { + float a1 = i/(float)num * pi/2; + float a2 = (i+1)/(float)num * pi/2; + float a3 = (i+2)/(float)num * pi/2; + float ca1 = cosf(a1); + float ca2 = cosf(a2); + float ca3 = cosf(a3); + float sa1 = sinf(a1); + float sa2 = sinf(a2); + float sa3 = sinf(a3); + + if(corners&1) // TL + gfx_quads_draw_freeform( + x+r, y+r, + x+(1-ca1)*r, y+(1-sa1)*r, + x+(1-ca3)*r, y+(1-sa3)*r, + x+(1-ca2)*r, y+(1-sa2)*r); + + if(corners&2) // TR + gfx_quads_draw_freeform( + x+w-r, y+r, + x+w-r+ca1*r, y+(1-sa1)*r, + x+w-r+ca3*r, y+(1-sa3)*r, + x+w-r+ca2*r, y+(1-sa2)*r); + + if(corners&4) // BL + gfx_quads_draw_freeform( + x+r, y+h-r, + x+(1-ca1)*r, y+h-r+sa1*r, + x+(1-ca3)*r, y+h-r+sa3*r, + x+(1-ca2)*r, y+h-r+sa2*r); + + if(corners&8) // BR + gfx_quads_draw_freeform( + x+w-r, y+h-r, + x+w-r+ca1*r, y+h-r+sa1*r, + x+w-r+ca3*r, y+h-r+sa3*r, + x+w-r+ca2*r, y+h-r+sa2*r); + } + + gfx_quads_drawTL(x+r, y+r, w-r*2, h-r*2); // center + gfx_quads_drawTL(x+r, y, w-r*2, r); // top + gfx_quads_drawTL(x+r, y+h-r, w-r*2, r); // bottom + gfx_quads_drawTL(x, y+r, r, h-r*2); // left + gfx_quads_drawTL(x+w-r, y+r, r, h-r*2); // right + + if(!(corners&1)) gfx_quads_drawTL(x, y, r, r); // TL + if(!(corners&2)) gfx_quads_drawTL(x+w, y, -r, r); // TR + if(!(corners&4)) gfx_quads_drawTL(x, y+h, r, -r); // BL + if(!(corners&8)) gfx_quads_drawTL(x+w, y+h, -r, -r); // BR +} + +void draw_round_rect(float x, float y, float w, float h, float r) +{ + draw_round_rect_ext(x,y,w,h,r,0xf); +} + +void ui_draw_rect(const RECT *r, vec4 color, int corners, float rounding) +{ + gfx_texture_set(-1); + gfx_quads_begin(); + gfx_setcolor(color.r, color.g, color.b, color.a); + draw_round_rect_ext(r->x,r->y,r->w,r->h,rounding*ui_scale(), corners); + gfx_quads_end(); +} + +void render_tee(ANIMSTATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos) +{ + vec2 direction = dir; + vec2 position = pos; + + //gfx_texture_set(data->images[IMAGE_CHAR_DEFAULT].id); + gfx_texture_set(info->texture); + gfx_quads_begin(); + //gfx_quads_draw(pos.x, pos.y-128, 128, 128); + + // first pass we draw the outline + // second pass we draw the filling + for(int p = 0; p < 2; p++) + { + int outline = p==0 ? 1 : 0; + + for(int f = 0; f < 2; f++) + { + float animscale = info->size * 1.0f/64.0f; + float basesize = info->size; + if(f == 1) + { + gfx_quads_setrotation(anim->body.angle*pi*2); + + // draw body + gfx_setcolor(info->color_body.r, info->color_body.g, info->color_body.b, 1.0f); + vec2 body_pos = position + vec2(anim->body.x, anim->body.y)*animscale; + select_sprite(outline?SPRITE_TEE_BODY_OUTLINE:SPRITE_TEE_BODY, 0, 0, 0); + gfx_quads_draw(body_pos.x, body_pos.y, basesize, basesize); + + // draw eyes + if(p == 1) + { + switch (emote) + { + case EMOTE_PAIN: + select_sprite(SPRITE_TEE_EYE_PAIN, 0, 0, 0); + break; + case EMOTE_HAPPY: + select_sprite(SPRITE_TEE_EYE_HAPPY, 0, 0, 0); + break; + case EMOTE_SURPRISE: + select_sprite(SPRITE_TEE_EYE_SURPRISE, 0, 0, 0); + break; + case EMOTE_ANGRY: + select_sprite(SPRITE_TEE_EYE_ANGRY, 0, 0, 0); + break; + default: + select_sprite(SPRITE_TEE_EYE_NORMAL, 0, 0, 0); + break; + } + + float eyescale = basesize*0.40f; + float h = emote == EMOTE_BLINK ? basesize*0.15f : eyescale; + float eyeseparation = (0.075f - 0.010f*fabs(direction.x))*basesize; + vec2 offset = vec2(direction.x*0.125f, -0.05f+direction.y*0.10f)*basesize; + gfx_quads_draw(body_pos.x-eyeseparation+offset.x, body_pos.y+offset.y, eyescale, h); + gfx_quads_draw(body_pos.x+eyeseparation+offset.x, body_pos.y+offset.y, -eyescale, h); + } + } + + // draw feet + ANIM_KEYFRAME *foot = f ? &anim->front_foot : &anim->back_foot; + + float w = basesize; + float h = basesize/2; + + gfx_quads_setrotation(foot->angle*pi*2); + + bool indicate = !info->got_airjump && config.cl_airjumpindicator; + float cs = 1.0f; // color scale + + if(outline) + select_sprite(SPRITE_TEE_FOOT_OUTLINE, 0, 0, 0); + else + { + select_sprite(SPRITE_TEE_FOOT, 0, 0, 0); + if(indicate) + cs = 0.5f; + } + + gfx_setcolor(info->color_feet.r*cs, info->color_feet.g*cs, info->color_feet.b*cs, 1.0f); + gfx_quads_draw(position.x+foot->x*animscale, position.y+foot->y*animscale, w, h); + } + } + + gfx_quads_end(); + + +} + +static void calc_screen_params(float amount, float wmax, float hmax, float aspect, float *w, float *h) +{ + float f = sqrt(amount) / sqrt(aspect); + *w = f*aspect; + *h = f; + + // limit the view + if(*w > wmax) + { + *w = wmax; + *h = *w/aspect; + } + + if(*h > hmax) + { + *h = hmax; + *w = *h*aspect; + } +} + +void mapscreen_to_world(float center_x, float center_y, float parallax_x, float parallax_y, + float offset_x, float offset_y, float aspect, float zoom, float *points) +{ + float width, height; + calc_screen_params(1150*1000, 1500, 1050, aspect, &width, &height); + center_x *= parallax_x; + center_y *= parallax_y; + width *= zoom; + height *= zoom; + points[0] = offset_x+center_x-width/2; + points[1] = offset_y+center_y-height/2; + points[2] = offset_x+center_x+width/2; + points[3] = offset_y+center_y+height/2; +} + +void render_tilemap_generate_skip() +{ + for(int g = 0; g < layers_num_groups(); g++) + { + MAPITEM_GROUP *group = layers_get_group(g); + + for(int l = 0; l < group->num_layers; l++) + { + MAPITEM_LAYER *layer = layers_get_layer(group->start_layer+l); + + if(layer->type == LAYERTYPE_TILES) + { + MAPITEM_LAYER_TILEMAP *tmap = (MAPITEM_LAYER_TILEMAP *)layer; + TILE *tiles = (TILE *)map_get_data(tmap->data); + for(int y = 0; y < tmap->height; y++) + { + for(int x = 1; x < tmap->width; x++) + { + int sx; + for(sx = 1; x+sx < tmap->width && sx < 255; sx++) + { + if(tiles[y*tmap->width+x+sx].index) + break; + } + + tiles[y*tmap->width+x].skip = sx-1; + } + } + } + } + } +} diff --git a/src/game/client/render.hpp b/src/game/client/render.hpp new file mode 100644 index 00000000..917641c8 --- /dev/null +++ b/src/game/client/render.hpp @@ -0,0 +1,68 @@ +/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#ifndef GAME_CLIENT_RENDER_H +#define GAME_CLIENT_RENDER_H + +#include + +#include "../mapitems.hpp" +#include "ui.hpp" + +struct TEE_RENDER_INFO +{ + TEE_RENDER_INFO() + { + texture = -1; + color_body = vec4(1,1,1,1); + color_feet = vec4(1,1,1,1); + size = 1.0f; + got_airjump = 1; + }; + + int texture; + vec4 color_body; + vec4 color_feet; + float size; + int got_airjump; +}; + +// sprite renderings +enum +{ + SPRITE_FLAG_FLIP_Y=1, + SPRITE_FLAG_FLIP_X=2, + + LAYERRENDERFLAG_OPAQUE=1, + LAYERRENDERFLAG_TRANSPARENT=2, + + TILERENDERFLAG_EXTEND=4, +}; + +typedef struct SPRITE; + +void select_sprite(SPRITE *spr, int flags=0, int sx=0, int sy=0); +void select_sprite(int id, int flags=0, int sx=0, int sy=0); + +void draw_sprite(float x, float y, float size); + +// rects +void draw_round_rect(float x, float y, float w, float h, float r); +void draw_round_rect_ext(float x, float y, float w, float h, float r, int corners); +void ui_draw_rect(const RECT *r, vec4 color, int corners, float rounding); + +// larger rendering methods +void render_tilemap_generate_skip(); + +// object render methods (gc_render_obj.cpp) +void render_tee(class ANIMSTATE *anim, TEE_RENDER_INFO *info, int emote, vec2 dir, vec2 pos); + +// map render methods (gc_render_map.cpp) +void render_eval_envelope(ENVPOINT *points, int num_points, int channels, float time, float *result); +void render_quads(QUAD *quads, int num_quads, void (*eval)(float time_offset, int env, float *channels), int flags); +void render_tilemap(TILE *tiles, int w, int h, float scale, vec4 color, int flags); + +// helpers +void mapscreen_to_world(float center_x, float center_y, float parallax_x, float parallax_y, + float offset_x, float offset_y, float aspect, float zoom, float *points); + + +#endif diff --git a/src/game/client/render_map.cpp b/src/game/client/render_map.cpp new file mode 100644 index 00000000..118a4d73 --- /dev/null +++ b/src/game/client/render_map.cpp @@ -0,0 +1,274 @@ +/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#include +#include +#include + +#include "render.hpp" + +void render_eval_envelope(ENVPOINT *points, int num_points, int channels, float time, float *result) +{ + if(num_points == 0) + { + result[0] = 0; + result[1] = 0; + result[2] = 0; + result[3] = 0; + return; + } + + if(num_points == 1) + { + result[0] = fx2f(points[0].values[0]); + result[1] = fx2f(points[0].values[1]); + result[2] = fx2f(points[0].values[2]); + result[3] = fx2f(points[0].values[3]); + return; + } + + time = fmod(time, points[num_points-1].time/1000.0f)*1000.0f; + for(int i = 0; i < num_points-1; i++) + { + if(time >= points[i].time && time <= points[i+1].time) + { + float delta = points[i+1].time-points[i].time; + float a = (time-points[i].time)/delta; + + + if(points[i].curvetype == CURVETYPE_SMOOTH) + a = -2*a*a*a + 3*a*a; // second hermite basis + else if(points[i].curvetype == CURVETYPE_SLOW) + a = a*a*a; + else if(points[i].curvetype == CURVETYPE_FAST) + { + a = 1-a; + a = 1-a*a*a; + } + else if (points[i].curvetype == CURVETYPE_STEP) + a = 0; + else + { + // linear + } + + for(int c = 0; c < channels; c++) + { + float v0 = fx2f(points[i].values[c]); + float v1 = fx2f(points[i+1].values[c]); + result[c] = v0 + (v1-v0) * a; + } + + return; + } + } + + result[0] = fx2f(points[num_points-1].values[0]); + result[1] = fx2f(points[num_points-1].values[1]); + result[2] = fx2f(points[num_points-1].values[2]); + result[3] = fx2f(points[num_points-1].values[3]); + return; +} + + +static void rotate(POINT *center, POINT *point, float rotation) +{ + int x = point->x - center->x; + int y = point->y - center->y; + point->x = (int)(x * cosf(rotation) - y * sinf(rotation) + center->x); + point->y = (int)(x * sinf(rotation) + y * cosf(rotation) + center->y); +} + +void render_quads(QUAD *quads, int num_quads, void (*eval)(float time_offset, int env, float *channels), int renderflags) +{ + gfx_quads_begin(); + float conv = 1/255.0f; + for(int i = 0; i < num_quads; i++) + { + QUAD *q = &quads[i]; + + float r=1, g=1, b=1, a=1; + + if(q->color_env >= 0) + { + float channels[4]; + eval(q->color_env_offset/1000.0f, q->color_env, channels); + r = channels[0]; + g = channels[1]; + b = channels[2]; + a = channels[3]; + } + + bool opaque = false; + if(a < 0.01f || (q->colors[0].a < 0.01f && q->colors[1].a < 0.01f && q->colors[2].a < 0.01f && q->colors[3].a < 0.01f)) + opaque = true; + + if(opaque && !(renderflags&LAYERRENDERFLAG_OPAQUE)) + continue; + if(!opaque && !(renderflags&LAYERRENDERFLAG_TRANSPARENT)) + continue; + + gfx_quads_setsubset_free( + fx2f(q->texcoords[0].x), fx2f(q->texcoords[0].y), + fx2f(q->texcoords[1].x), fx2f(q->texcoords[1].y), + fx2f(q->texcoords[2].x), fx2f(q->texcoords[2].y), + fx2f(q->texcoords[3].x), fx2f(q->texcoords[3].y) + ); + + float offset_x = 0; + float offset_y = 0; + float rot = 0; + + // TODO: fix this + if(q->pos_env >= 0) + { + float channels[4]; + eval(q->pos_env_offset/1000.0f, q->pos_env, channels); + offset_x = channels[0]; + offset_y = channels[1]; + rot = channels[2]/360.0f*pi*2; + } + + + gfx_setcolorvertex(0, q->colors[0].r*conv*r, q->colors[0].g*conv*g, q->colors[0].b*conv*b, q->colors[0].a*conv*a); + gfx_setcolorvertex(1, q->colors[1].r*conv*r, q->colors[1].g*conv*g, q->colors[1].b*conv*b, q->colors[1].a*conv*a); + gfx_setcolorvertex(2, q->colors[2].r*conv*r, q->colors[2].g*conv*g, q->colors[2].b*conv*b, q->colors[2].a*conv*a); + gfx_setcolorvertex(3, q->colors[3].r*conv*r, q->colors[3].g*conv*g, q->colors[3].b*conv*b, q->colors[3].a*conv*a); + + POINT *points = q->points; + + if(rot != 0) + { + static POINT rotated[4]; + rotated[0] = q->points[0]; + rotated[1] = q->points[1]; + rotated[2] = q->points[2]; + rotated[3] = q->points[3]; + points = rotated; + + rotate(&q->points[4], &rotated[0], rot); + rotate(&q->points[4], &rotated[1], rot); + rotate(&q->points[4], &rotated[2], rot); + rotate(&q->points[4], &rotated[3], rot); + } + + gfx_quads_draw_freeform( + fx2f(points[0].x)+offset_x, fx2f(points[0].y)+offset_y, + fx2f(points[1].x)+offset_x, fx2f(points[1].y)+offset_y, + fx2f(points[2].x)+offset_x, fx2f(points[2].y)+offset_y, + fx2f(points[3].x)+offset_x, fx2f(points[3].y)+offset_y + ); + } + gfx_quads_end(); +} + +void render_tilemap(TILE *tiles, int w, int h, float scale, vec4 color, int renderflags) +{ + //gfx_texture_set(img_get(tmap->image)); + float screen_x0, screen_y0, screen_x1, screen_y1; + gfx_getscreen(&screen_x0, &screen_y0, &screen_x1, &screen_y1); + //gfx_mapscreen(screen_x0-50, screen_y0-50, screen_x1+50, screen_y1+50); + + // calculate the final pixelsize for the tiles + float tile_pixelsize = 1024/32.0f; + float final_tilesize = scale/(screen_x1-screen_x0) * gfx_screenwidth(); + float final_tilesize_scale = final_tilesize/tile_pixelsize; + + gfx_quads_begin(); + gfx_setcolor(color.r, color.g, color.b, color.a); + + int starty = (int)(screen_y0/scale)-1; + int startx = (int)(screen_x0/scale)-1; + int endy = (int)(screen_y1/scale)+1; + int endx = (int)(screen_x1/scale)+1; + + // adjust the texture shift according to mipmap level + float texsize = 1024.0f; + float frac = (1.25f/texsize) * (1/final_tilesize_scale); + float nudge = (0.5f/texsize) * (1/final_tilesize_scale); + + for(int y = starty; y < endy; y++) + for(int x = startx; x < endx; x++) + { + int mx = x; + int my = y; + + if(renderflags&TILERENDERFLAG_EXTEND) + { + if(mx<0) + mx = 0; + if(mx>=w) + mx = w-1; + if(my<0) + my = 0; + if(my>=h) + my = h-1; + } + else + { + if(mx<0) + continue; // mx = 0; + if(mx>=w) + continue; // mx = w-1; + if(my<0) + continue; // my = 0; + if(my>=h) + continue; // my = h-1; + } + + int c = mx + my*w; + + unsigned char index = tiles[c].index; + if(index) + { + unsigned char flags = tiles[c].flags; + + bool render = false; + if(flags&TILEFLAG_OPAQUE) + { + if(renderflags&LAYERRENDERFLAG_OPAQUE) + render = true; + } + else + { + if(renderflags&LAYERRENDERFLAG_TRANSPARENT) + render = true; + } + + if(render) + { + + int tx = index%16; + int ty = index/16; + int px0 = tx*(1024/16); + int py0 = ty*(1024/16); + int px1 = (tx+1)*(1024/16)-1; + int py1 = (ty+1)*(1024/16)-1; + + float u0 = nudge + px0/texsize+frac; + float v0 = nudge + py0/texsize+frac; + float u1 = nudge + px1/texsize-frac; + float v1 = nudge + py1/texsize-frac; + + if(flags&TILEFLAG_VFLIP) + { + float tmp = u0; + u0 = u1; + u1 = tmp; + } + + if(flags&TILEFLAG_HFLIP) + { + float tmp = v0; + v0 = v1; + v1 = tmp; + } + + gfx_quads_setsubset(u0,v0,u1,v1); + gfx_quads_drawTL(x*scale, y*scale, scale, scale); + } + } + x += tiles[c].skip; + } + + gfx_quads_end(); + gfx_mapscreen(screen_x0, screen_y0, screen_x1, screen_y1); +} diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index b62233dc..a7110a3b 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -14,7 +14,7 @@ extern "C" { #include #include -#include +#include #include "ed_editor.hpp" diff --git a/src/game/editor/ed_editor.hpp b/src/game/editor/ed_editor.hpp index f879e3c0..44eb4664 100644 --- a/src/game/editor/ed_editor.hpp +++ b/src/game/editor/ed_editor.hpp @@ -7,7 +7,7 @@ #include #include "array.hpp" #include "../mapitems.hpp" -#include "../client/gc_render.hpp" +#include "../client/render.hpp" extern "C" { #include diff --git a/src/game/editor/ed_layer_quads.cpp b/src/game/editor/ed_layer_quads.cpp index a6e49248..bfdacbfd 100644 --- a/src/game/editor/ed_layer_quads.cpp +++ b/src/game/editor/ed_layer_quads.cpp @@ -2,7 +2,7 @@ #include "ed_editor.hpp" #include -#include +#include LAYER_QUADS::LAYER_QUADS() { diff --git a/src/game/editor/ed_layer_tiles.cpp b/src/game/editor/ed_layer_tiles.cpp index 8f4c8660..80ccaa3a 100644 --- a/src/game/editor/ed_layer_tiles.cpp +++ b/src/game/editor/ed_layer_tiles.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include "ed_editor.hpp" LAYER_TILES::LAYER_TILES(int w, int h) -- cgit 1.4.1