force show_fullscreen to software drawing if image is bigger than screen, showing Automap background in low resolutions via software, removed obsolete robot briefing fix in OGL, code cleanup
This commit is contained in:
parent
552cf239f3
commit
a09bf9b953
|
@ -1754,7 +1754,9 @@ void show_fullscr(grs_bitmap *bm)
|
|||
grs_bitmap * const scr = &grd_curcanv->cv_bitmap;
|
||||
|
||||
#ifdef OGL
|
||||
if(bm->bm_type == BM_LINEAR && scr->bm_type == BM_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
|
||||
{
|
||||
ogl_ubitblt_i(scr->bm_w,scr->bm_h,0,0,bm->bm_w,bm->bm_h,0,0,bm,scr,0);//use opengl to scale, faster and saves ram. -MPM
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
D2X-Rebirth Changelog
|
||||
|
||||
20070206
|
||||
--------
|
||||
2d/bitblt.c, main/automap.c, main/titles.c: force show_fullscreen to software drawing if image is bigger than screen, showing Automap background in low resolutions via software, removed obsolete robot briefing fix in OGL, code cleanup
|
||||
|
||||
20070205
|
||||
--------
|
||||
main/menu.h: make sure Menu_pcx_name gets loaded correctly if resolution is lowres
|
||||
|
|
|
@ -748,7 +748,7 @@ void do_automap( int key_code ) {
|
|||
gr_init_sub_canvas(&DrawingPage, &Page, RESCALE_X(27), RESCALE_Y(80), RESCALE_X(582), RESCALE_Y(334));
|
||||
gr_set_current_canvas(&Page);
|
||||
if (automap_height<400)
|
||||
gr_clear_canvas( BM_XRGB(3,3,3) );
|
||||
show_fullscr(&Automap_background);
|
||||
else
|
||||
ogl_ubitmapm_cs(0, 0, -1, -1, &Automap_background, -1, F1_0);
|
||||
gr_set_curfont(HUGE_FONT);
|
||||
|
|
|
@ -1337,28 +1337,6 @@ void DoBriefingColorStuff ()
|
|||
Erase_color = gr_find_closest_color_current(0, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef OGL
|
||||
// ZICO - this function will load the bitmap frame for spinning robots in the offscreen buffer.
|
||||
// this way we can be sure the frame is shown when offscreen render is called in draw_model_picture().
|
||||
// some GPU configurations seem (dunno why) to mess it up otherwise...
|
||||
void ogl_init_robot_frame()
|
||||
{
|
||||
CFILE * file;
|
||||
int pcx_error;
|
||||
grs_bitmap backdrop;
|
||||
|
||||
backdrop.bm_data=NULL;
|
||||
pcx_error = pcx_read_bitmap("brief03.pcx",&backdrop, BM_LINEAR,New_pal);
|
||||
if (pcx_error != PCX_ERROR_NONE) {
|
||||
cfclose(file);
|
||||
return;
|
||||
}
|
||||
ogl_start_offscreen_render(0, 0, SWIDTH, SHEIGHT);
|
||||
show_fullscr(&backdrop);
|
||||
ogl_end_offscreen_render();
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Return true if screen got aborted by user, else return false.
|
||||
int show_briefing_screen( int screen_num, int allow_keys)
|
||||
|
@ -1379,10 +1357,11 @@ int show_briefing_screen( int screen_num, int allow_keys)
|
|||
grs_bitmap briefing_bm;
|
||||
|
||||
gr_init_bitmap_data(&briefing_bm);
|
||||
if ((pcx_error=pcx_read_bitmap(Briefing_screens[screen_num].bs_name, &briefing_bm, BM_LINEAR, New_pal))!=PCX_ERROR_NONE) {
|
||||
if ((pcx_error=pcx_read_bitmap(Briefing_screens[screen_num].bs_name, &briefing_bm, BM_LINEAR, New_pal))!=PCX_ERROR_NONE)
|
||||
#else
|
||||
if ((pcx_error=pcx_read_fullscr(Briefing_screens[screen_num].bs_name, New_pal))!=PCX_ERROR_NONE) {
|
||||
if ((pcx_error=pcx_read_fullscr(Briefing_screens[screen_num].bs_name, New_pal))!=PCX_ERROR_NONE)
|
||||
#endif
|
||||
{
|
||||
printf("PCX load error: %s. File '%s'\n\n", pcx_errormsg(pcx_error), Briefing_screens[screen_num].bs_name);
|
||||
mprintf((0, "File '%s', PCX load error: %s (%i)\n (It's a briefing screen. Does this cause you pain?)\n", Briefing_screens[screen_num].bs_name, pcx_errormsg(pcx_error), pcx_error));
|
||||
Int3();
|
||||
|
@ -1396,9 +1375,6 @@ int show_briefing_screen( int screen_num, int allow_keys)
|
|||
//vfx_set_palette_sub( New_pal );
|
||||
#ifdef OGL
|
||||
gr_palette_load(New_pal);
|
||||
|
||||
if (screen_num>1)
|
||||
ogl_init_robot_frame();
|
||||
#else
|
||||
gr_palette_clear();
|
||||
#endif
|
||||
|
@ -1598,4 +1574,4 @@ void show_order_form()
|
|||
key_flush();
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue