Pass canvas to gr_rle_expand_scanline_generic

This commit is contained in:
Kp 2017-01-01 00:45:45 +00:00
parent 22e364e030
commit c914131009
3 changed files with 10 additions and 8 deletions

View file

@ -435,7 +435,7 @@ static void gr_bm_ubitblt0x_rle(unsigned w, unsigned h, int dx, int dy, int sx,
for (uint_fast32_t y1 = 0; y1 != h; ++y1)
{
gr_rle_expand_scanline_generic(dest, dx, dy+y1, sbits, sx, sx+w-1);
gr_rle_expand_scanline_generic(*grd_curcanv, dest, dx, dy+y1, sbits, sx, sx+w-1);
if ( src.bm_flags & BM_FLAG_RLE_BIG )
sbits += GET_INTEL_SHORT(&src.bm_data[4 + ((y1 + sy) * data_offset)]);
else

View file

@ -440,8 +440,7 @@ grs_bitmap *_rle_expand_texture(const grs_bitmap &bmp)
return least_recently_used->expanded_bitmap.get();
}
void gr_rle_expand_scanline_generic(grs_bitmap &dest, int dx, int dy, const ubyte *src, int x1, int x2 )
void gr_rle_expand_scanline_generic(grs_canvas &canvas, grs_bitmap &dest, int dx, const int dy, const uint8_t *src, const int x1, const int x2)
{
int i = 0;
int count;
@ -469,12 +468,12 @@ void gr_rle_expand_scanline_generic(grs_bitmap &dest, int dx, int dy, const ubyt
if ( x1+count > x2 ) {
count = x2-x1+1;
for ( int j=0; j<count; j++ )
gr_bm_pixel(*grd_curcanv, dest, dx++, dy, color);
gr_bm_pixel(canvas, dest, dx++, dy, color);
return;
}
for ( int j=0; j<count; j++ )
gr_bm_pixel(*grd_curcanv, dest, dx++, dy, color);
gr_bm_pixel(canvas, dest, dx++, dy, color);
i += count;
while( i <= x2 ) {
@ -490,12 +489,12 @@ void gr_rle_expand_scanline_generic(grs_bitmap &dest, int dx, int dy, const ubyt
// we know have '*count' pixels of 'color'.
if ( i+count <= x2 ) {
for ( int j=0; j<count; j++ )
gr_bm_pixel(*grd_curcanv, dest, dx++, dy, color);
gr_bm_pixel(canvas, dest, dx++, dy, color);
i += count;
} else {
count = x2-i+1;
for ( int j=0; j<count; j++ )
gr_bm_pixel(*grd_curcanv, dest, dx++, dy, color);
gr_bm_pixel(canvas, dest, dx++, dy, color);
i += count;
}
}

View file

@ -79,7 +79,10 @@ void rle_cache_close();
void rle_cache_flush();
void rle_swap_0_255(grs_bitmap &bmp);
void rle_remap(grs_bitmap &bmp, array<color_t, 256> &colormap);
void gr_rle_expand_scanline_generic(grs_bitmap &dest, int dx, int dy, const ubyte *src, int x1, int x2 );
#if !DXX_USE_OGL
#define gr_rle_expand_scanline_generic(C,D,DX,DY,S,X1,X2) gr_rle_expand_scanline_generic(D,DX,DY,S,X1,X2)
#endif
void gr_rle_expand_scanline_generic(grs_canvas &, grs_bitmap &dest, int dx, int dy, const ubyte *src, int x1, int x2 );
}
#endif