Properly scale and simplify arithmetic for briefing bitmap.

Constrain by screen height, by just using rescale_y for width and height.
Then use show_fullscr to fill the destination canvas.
This commit is contained in:
Bradley Bell 2015-02-07 17:11:20 -08:00
parent 33f0731d11
commit 2b4aba341d

View file

@ -1104,24 +1104,11 @@ static void show_animated_bitmap(briefing *br)
static void show_briefing_bitmap(grs_bitmap *bmp)
{
grs_canvas *curcanv_save;
#ifdef OGL
float scale = 1.0;
#endif
auto bitmap_canv = gr_create_sub_canvas(*grd_curcanv, rescale_x(220), rescale_y(55), (bmp->bm_w*(SWIDTH/(HIRESMODE ? 640 : 320))),(bmp->bm_h*(SHEIGHT/(HIRESMODE ? 480 : 200))));
auto bitmap_canv = gr_create_sub_canvas(*grd_curcanv, rescale_x(220), rescale_y(55), rescale_y(bmp->bm_w), rescale_y(bmp->bm_h));
curcanv_save = grd_curcanv;
gr_set_current_canvas(bitmap_canv);
#ifdef OGL
if (((float)SWIDTH/(HIRESMODE ? 640 : 320)) < ((float)SHEIGHT/(HIRESMODE ? 480 : 200)))
scale = ((float)SWIDTH/(HIRESMODE ? 640 : 320));
else
scale = ((float)SHEIGHT/(HIRESMODE ? 480 : 200));
ogl_ubitmapm_cs(0,0,bmp->bm_w*scale,bmp->bm_h*scale,*bmp,255,F1_0);
#else
gr_bitmapm(0, 0, *bmp);
#endif
show_fullscr(*bmp);
gr_set_current_canvas(curcanv_save);
}