Propagate function pointer into texture_map_flat

This commit is contained in:
Kp 2017-02-11 21:42:38 +00:00
parent 5a86bcaeb6
commit bc91e8b789

View file

@ -91,7 +91,7 @@ static void tmap_scanline_flat(int y, fix xleft, fix xright)
// Render a texture map.
// Linear in outer loop, linear in inner loop.
// -------------------------------------------------------------------------------------
static void texture_map_flat(const g3ds_tmap &t, int color, void (*scanline_func)(int,fix,fix))
static void texture_map_flat(const g3ds_tmap &t, int color)
{
int vlt,vrt,vlb,vrb; // vertex left top, vertex right top, vertex left bottom, vertex right bottom
int topy,boty,dy;
@ -164,16 +164,13 @@ static void texture_map_flat(const g3ds_tmap &t, int color, void (*scanline_func
xright = v3d[vrt].x2d;
}
//tmap_scanline_flat(y, xleft, xright);
(*scanline_func)(y, xleft, xright);
tmap_scanline_flat(y, xleft, xright);
xleft += dx_dy_left;
xright += dx_dy_right;
}
//tmap_scanline_flat(y, xleft, xright);
(*scanline_func)(boty, xleft, xright);
tmap_scanline_flat(boty, xleft, xright);
}
// -----------------------------------------------------------------------------------------
@ -226,7 +223,6 @@ void draw_tmap_flat(const grs_bitmap &bp,uint_fast32_t nverts,const g3s_point *c
//function with ylr values
static void gr_upoly_tmap_ylr(uint_fast32_t nverts, const int *vert, const uint8_t color)
{
auto &ylr_func = tmap_scanline_flat;
g3ds_tmap my_tmap;
my_tmap.nv = nverts;
@ -235,7 +231,7 @@ static void gr_upoly_tmap_ylr(uint_fast32_t nverts, const int *vert, const uint8
i.x2d = *vert++;
i.y2d = *vert++;
}
texture_map_flat(my_tmap, color, ylr_func);
texture_map_flat(my_tmap, color);
}
}