Pass show_fullscr arg by &

This commit is contained in:
Kp 2014-12-02 03:35:01 +00:00
parent c89e3b7452
commit c990701d87
8 changed files with 24 additions and 29 deletions

View file

@ -483,26 +483,25 @@ inside:
}
}
void show_fullscr(grs_bitmap *bm)
void show_fullscr(grs_bitmap &bm)
{
grs_bitmap * const scr = &grd_curcanv->cv_bitmap;
auto &scr = grd_curcanv->cv_bitmap;
#ifdef OGL
if(bm->bm_type == BM_LINEAR && scr->bm_type == BM_OGL &&
bm->bm_w <= grd_curscreen->sc_w && bm->bm_h <= grd_curscreen->sc_h) // only scale with OGL if bitmap is not bigger than screen size
if(bm.bm_type == BM_LINEAR && scr.bm_type == BM_OGL &&
bm.bm_w <= grd_curscreen->sc_w && bm.bm_h <= grd_curscreen->sc_h) // only scale with OGL if bitmap is not bigger than screen size
{
ogl_ubitmapm_cs(0,0,-1,-1,*bm,-1,F1_0);//use opengl to scale, faster and saves ram. -MPM
ogl_ubitmapm_cs(0,0,-1,-1,bm,-1,F1_0);//use opengl to scale, faster and saves ram. -MPM
return;
}
#endif
if(scr->bm_type != BM_LINEAR) {
grs_bitmap_ptr p = gr_create_bitmap(scr->bm_w, scr->bm_h);
grs_bitmap *tmp = p.get();
gr_bitmap_scale_to(*bm, *tmp);
gr_bitmap(0, 0, *tmp);
if(scr.bm_type != BM_LINEAR) {
grs_bitmap_ptr p = gr_create_bitmap(scr.bm_w, scr.bm_h);
auto &tmp = *p.get();
gr_bitmap_scale_to(bm, tmp);
gr_bitmap(0, 0, tmp);
return;
}
gr_bitmap_scale_to(*bm, *scr);
gr_bitmap_scale_to(bm, scr);
}
// Find transparent area in bitmap

View file

@ -313,7 +313,7 @@ int gr_uline(fix x0,fix y0,fix x1,fix y1);
// Draw the bitmap into the current canvas at the specified location.
void gr_bitmap(unsigned x,unsigned y,grs_bitmap &bm);
void gr_ubitmap(grs_bitmap &bm);
void show_fullscr(grs_bitmap *bm);
void show_fullscr(grs_bitmap &bm);
// Find transparent area in bitmap
void gr_bitblt_find_transparent_area(grs_bitmap *bm, unsigned &minx, unsigned &miny, unsigned &maxx, unsigned &maxy);

View file

@ -490,7 +490,7 @@ static void draw_automap(automap *am)
am->leave_mode = 1;
gr_set_current_canvas(NULL);
show_fullscr(&am->automap_background);
show_fullscr(am->automap_background);
gr_set_curfont(HUGE_FONT);
gr_set_fontcolor(BM_XRGB(20, 20, 20), -1);
#if defined(DXX_BUILD_DESCENT_I)

View file

@ -170,7 +170,7 @@ static window_event_result credits_handler(window *wind,const d_event &event, cr
}
y = cr->first_line_offset - cr->row;
show_fullscr(&cr->backdrop);
show_fullscr(cr->backdrop);
for (int j=0; j<NUM_LINES; j++ ) {
char *s;
@ -281,7 +281,7 @@ void credits_show(const char *credits_filename)
gr_remap_bitmap_good( &cr->backdrop,backdrop_palette, -1, -1 );
gr_set_current_canvas(NULL);
show_fullscr(&cr->backdrop);
show_fullscr(cr->backdrop);
gr_palette_load( gr_palette );
key_flush();

View file

@ -932,7 +932,7 @@ static int draw_endlevel_background(newmenu *,const d_event &event, grs_bitmap *
{
case EVENT_WINDOW_DRAW:
gr_set_current_canvas(NULL);
show_fullscr(background);
show_fullscr(*background);
break;
default:

View file

@ -189,7 +189,7 @@ static void kmatrix_redraw(kmatrix_screen *km)
playernum_array_t sorted;
gr_set_current_canvas(NULL);
show_fullscr(&km->background);
show_fullscr(km->background);
if (Game_mode & GM_MULTI_COOP)
{

View file

@ -129,7 +129,7 @@ static void nm_draw_background1(const char * filename)
(void)pcx_error;
}
gr_palette_load( gr_palette );
show_fullscr(&nm_background1);
show_fullscr(nm_background1);
}
#if defined(DXX_BUILD_DESCENT_II)
strcpy(last_palette_loaded,""); //force palette load next time
@ -177,14 +177,14 @@ void nm_draw_background(int x1, int y1, int x2, int y2 )
gr_set_current_canvas(tmp);
gr_palette_load( gr_palette );
show_fullscr( &nm_background ); // show so we load all necessary data for the sub-bitmap
show_fullscr(nm_background); // show so we load all necessary data for the sub-bitmap
if (!init_sub && ((nm_background_sub->bm_w != w*(((float) nm_background.bm_w)/SWIDTH)) || (nm_background_sub->bm_h != h*(((float) nm_background.bm_h)/SHEIGHT))))
{
init_sub=1;
}
if (init_sub)
nm_background_sub = gr_create_sub_bitmap(nm_background,0,0,w*(((float) nm_background.bm_w)/SWIDTH),h*(((float) nm_background.bm_h)/SHEIGHT));
show_fullscr( nm_background_sub.get() );
show_fullscr(*nm_background_sub.get());
gr_set_current_canvas(old);

View file

@ -141,7 +141,7 @@ static window_event_result title_handler(window *wind,const d_event &event, titl
case EVENT_WINDOW_DRAW:
gr_set_current_canvas( NULL );
show_fullscr(&ts->title_bm);
show_fullscr(ts->title_bm);
break;
case EVENT_WINDOW_CLOSE:
@ -1253,9 +1253,7 @@ static int load_briefing_screen(briefing *br, const char *fname)
gr_palette[0].r = gr_palette[0].g = gr_palette[0].b = 0;
gr_palette[255].r = gr_palette[255].g = gr_palette[255].b = 63;
}
show_fullscr(&br->background);
show_fullscr(br->background);
gr_palette_load(gr_palette);
set_briefing_fontcolor(NULL);
@ -1280,9 +1278,7 @@ static int load_briefing_screen(briefing *br, const char *fname)
if ((pcx_error = pcx_read_bitmap(fname, br->background, BM_LINEAR, gr_palette))!=PCX_ERROR_NONE)
Error( "Error loading briefing screen <%s>, PCX load error: %s (%i)\n",fname, pcx_errormsg(pcx_error), pcx_error);
show_fullscr(&br->background);
show_fullscr(br->background);
if (EMULATING_D1 && !d_stricmp(fname, "brief03.pcx")) // HACK, FIXME: D1 missions should use their own palette (PALETTE.256), but texture replacements not complete
gr_use_palette_table("groupa.256");
@ -1507,7 +1503,7 @@ static window_event_result briefing_handler(window *wind,const d_event &event, b
check_text_pos(br);
if (br->background.bm_data)
show_fullscr(&br->background);
show_fullscr(br->background);
if (br->guy_bitmap_show)
show_briefing_bitmap(&br->guy_bitmap);