From beaa49a7ba6ac93b1fb06bac2b4773198067fbd1 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 11 Feb 2017 21:42:34 +0000 Subject: [PATCH] Pass destination bitmap to scale_bitmap --- common/2d/scalec.cpp | 3 +-- common/3d/rod.cpp | 2 +- common/include/fwd-gr.h | 2 +- similar/main/state.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/2d/scalec.cpp b/common/2d/scalec.cpp index 2cc057a4e..d084e2500 100644 --- a/common/2d/scalec.cpp +++ b/common/2d/scalec.cpp @@ -351,9 +351,8 @@ static void scale_bitmap_c_rle(const grs_bitmap &source_bmp, grs_bitmap &dest_bm #define FIND_SCALED_NUM(x,x0,x1,y0,y1) (fixmuldiv((x)-(x0),(y1)-(y0),(x1)-(x0))+(y0)) // Scales bitmap, bp, into vertbuf[0] to vertbuf[1] -void scale_bitmap(const grs_bitmap &bp, const array &vertbuf, int orientation ) +void scale_bitmap(const grs_bitmap &bp, const array &vertbuf, int orientation, grs_bitmap &dbp) { - auto &dbp = grd_curcanv->cv_bitmap; fix x0, y0, x1, y1; fix u0, v0, u1, v1; fix clipped_x0, clipped_y0, clipped_x1, clipped_y1; diff --git a/common/3d/rod.cpp b/common/3d/rod.cpp index 44a61163e..9159b9ef6 100644 --- a/common/3d/rod.cpp +++ b/common/3d/rod.cpp @@ -163,7 +163,7 @@ void g3_draw_bitmap(const vms_vector &pos,fix width,fix height,grs_bitmap &bm) {blob1x, blob0y}, {blob1x, pnt.p3_sy + h}, }}; - scale_bitmap(bm, blob_vertices, 0); + scale_bitmap(bm, blob_vertices, 0, grd_curcanv->cv_bitmap); } #endif diff --git a/common/include/fwd-gr.h b/common/include/fwd-gr.h index 74c9c29fd..e400b41d7 100644 --- a/common/include/fwd-gr.h +++ b/common/include/fwd-gr.h @@ -284,7 +284,7 @@ std::pair gr_get_string_wrap(const char *s, unsigned lim void gr_get_string_size(const grs_font &, const char *s, int *string_width, int *string_height, int *average_width); // From scale.c -void scale_bitmap(const grs_bitmap &bp, const array &vertbuf, int orientation); +void scale_bitmap(const grs_bitmap &bp, const array &vertbuf, int orientation, grs_bitmap &); //=========================================================================== // Global variables diff --git a/similar/main/state.cpp b/similar/main/state.cpp index 53cb92fcd..0b7153581 100644 --- a/similar/main/state.cpp +++ b/similar/main/state.cpp @@ -648,7 +648,7 @@ static int state_callback(newmenu *menu,const d_event &event, state_userdata *co {0,0}, {i2f(THUMBNAIL_W*2),i2f(THUMBNAIL_H*24/10)} }}; - scale_bitmap(*sc_bmp[citem-1].get(), vertbuf, 0); + scale_bitmap(*sc_bmp[citem-1].get(), vertbuf, 0, grd_curcanv->cv_bitmap); gr_set_current_canvas( save_canv ); #if !DXX_USE_OGL gr_bitmap(*grd_curcanv, (grd_curcanv->cv_bitmap.bm_w / 2) - fspacx(THUMBNAIL_W / 2), items[0].y - 3, temp_canv->cv_bitmap);