Pass grs_bitmap to gr_pixel

This commit is contained in:
Kp 2017-03-11 19:56:23 +00:00
parent 9dbec8433d
commit 719de35484
6 changed files with 12 additions and 12 deletions

View file

@ -47,11 +47,11 @@ void gr_upixel(grs_bitmap &cv_bitmap, const unsigned x, const unsigned y, const
}
}
void gr_pixel(grs_canvas &canvas, const unsigned x, const unsigned y, const uint8_t color)
void gr_pixel(grs_bitmap &cv_bitmap, const unsigned x, const unsigned y, const uint8_t color)
{
if (unlikely(x >= canvas.cv_bitmap.bm_w || y >= canvas.cv_bitmap.bm_h))
if (unlikely(x >= cv_bitmap.bm_w || y >= cv_bitmap.bm_h))
return;
gr_upixel(canvas.cv_bitmap, x, y, color);
gr_upixel(cv_bitmap, x, y, color);
}
#if !DXX_USE_OGL

View file

@ -192,7 +192,7 @@ namespace dcx {
void gr_settransblend(grs_canvas &, int fade_level, uint8_t blend_func);
// Draws a point into the current canvas in the current color and drawmode.
void gr_pixel(grs_canvas &, unsigned x, unsigned y, uint8_t color);
void gr_pixel(grs_bitmap &, unsigned x, unsigned y, uint8_t color);
void gr_upixel(grs_bitmap &, unsigned x, unsigned y, uint8_t color);
// Gets a pixel;

View file

@ -1145,7 +1145,7 @@ static int gr_internal_string_clipped_template(grs_canvas &canvas, int x, int y,
if (underline) {
for (uint_fast32_t i = width; i--;)
{
gr_pixel(canvas, x++, y, color);
gr_pixel(canvas.cv_bitmap, x++, y, color);
}
} else {
auto fp = proportional ? cv_font.ft_chars[letter] : cv_font.ft_data + letter * BITS_TO_BYTES(width) * cv_font.ft_h;
@ -1175,7 +1175,7 @@ static int gr_internal_string_clipped_template(grs_canvas &canvas, int x, int y,
if (!bit_enabled)
continue;
}
gr_pixel(canvas, x, y, color);
gr_pixel(canvas.cv_bitmap, x, y, color);
}
}
}

View file

@ -140,7 +140,7 @@ static void check_segment(const vsegptridx_t seg)
#endif
{
uint8_t color = 0;
gr_pixel(*grd_curcanv, Search_x, Search_y, color); //set our search pixel to color zero
gr_pixel(grd_curcanv->cv_bitmap, Search_x, Search_y, color); //set our search pixel to color zero
}
#if DXX_USE_OGL
g3_start_frame(*grd_curcanv);
@ -860,7 +860,7 @@ void find_segments(short x,short y,grs_canvas *screen_canvas,editor_view *v,cons
g3_end_frame();
#endif
uint8_t color = 0;
gr_pixel(*grd_curcanv, x, y, color); //set our search pixel to color zero
gr_pixel(grd_curcanv->cv_bitmap, x, y, color); //set our search pixel to color zero
#if DXX_USE_OGL
g3_start_frame(*grd_curcanv);
#endif

View file

@ -1064,7 +1064,7 @@ void draw_stars()
g3_project_point(p);
#if !DXX_USE_OGL
gr_pixel(*grd_curcanv, f2i(p.p3_sx), f2i(p.p3_sy), color);
gr_pixel(grd_curcanv->cv_bitmap, f2i(p.p3_sx), f2i(p.p3_sy), color);
#else
g3_draw_sphere(*grd_curcanv, p, F1_0 * 3, color);
#endif

View file

@ -402,7 +402,7 @@ static void check_face(const vsegidx_t segnum, const unsigned sidenum, const uns
#endif
{
uint8_t color = 0;
gr_pixel(*grd_curcanv, _search_x, _search_y, color); //set our search pixel to color zero
gr_pixel(grd_curcanv->cv_bitmap, _search_x, _search_y, color); //set our search pixel to color zero
}
#if DXX_USE_OGL
ogl_start_frame(*grd_curcanv);
@ -587,7 +587,7 @@ static void render_object_search(const vobjptridx_t obj)
ogl_start_frame(*grd_curcanv);
#else
gr_pixel(*grd_curcanv, _search_x, _search_y, color);
gr_pixel(grd_curcanv->cv_bitmap, _search_x, _search_y, color);
#endif
}
render_object(obj);
@ -601,7 +601,7 @@ static void render_object_search(const vobjptridx_t obj)
gr_rect(*grd_curcanv, _search_x - 1, _search_y - 1, _search_x + 1, _search_y + 1, color);
ogl_start_frame(*grd_curcanv);
#else
gr_pixel(*grd_curcanv, _search_x, _search_y, color);
gr_pixel(grd_curcanv->cv_bitmap, _search_x, _search_y, color);
#endif
}
render_object(obj);