Fixes for my last revisions: More reliable check for cockpit_decode_alpha, more reliable check is newmenu sub-bitmap needs to be re-created, call gr_set_mode() in change_res() with correct Game_screen_mode
This commit is contained in:
parent
92cec5ced3
commit
7d91cc91f8
|
@ -3,6 +3,7 @@ D1X-Rebirth Changelog
|
|||
20081028
|
||||
--------
|
||||
arch/ogl.c, include/gr.h, main/game.c, main/gauges.c, main/gauges.h, main/newmenu.c: Removed hack for Cockpit-window transparencies and added function to decode and add alpha to the bitmap directly (now works in non-OGL as well); Using sub-bitmaps for Cockpit-windows and menu backgrounds; Cleaned old bkg stuff from menu GUI
|
||||
main/game.c, main/manu.c, main/newmenu.c: Fixes for my last revisions: More reliable check for cockpit_decode_alpha, more reliable check is newmenu sub-bitmap needs to be re-created, call gr_set_mode() in change_res() with correct Game_screen_mode
|
||||
|
||||
20081023
|
||||
--------
|
||||
|
|
|
@ -234,12 +234,11 @@ void cockpit_decode_alpha(grs_bitmap *bm)
|
|||
{
|
||||
unsigned char decodebuf[1024*1024];
|
||||
int i=0,x=0,y=0;
|
||||
static grs_bitmap *cur=NULL;
|
||||
static ubyte *cur=NULL;
|
||||
|
||||
// check if we processed this bitmap already
|
||||
if (cur==bm)
|
||||
if (cur==bm->bm_data)
|
||||
return;
|
||||
cur=bm;
|
||||
|
||||
// decode the bitmap
|
||||
if (bm->bm_flags & BM_FLAG_RLE){
|
||||
|
@ -277,6 +276,7 @@ void cockpit_decode_alpha(grs_bitmap *bm)
|
|||
i++;
|
||||
}
|
||||
}
|
||||
cur=bm->bm_data;
|
||||
}
|
||||
|
||||
// This actually renders the new cockpit onto the screen.
|
||||
|
|
|
@ -554,10 +554,10 @@ void change_res()
|
|||
// clean up and apply everything
|
||||
newmenu_close();
|
||||
set_screen_mode(SCREEN_MENU);
|
||||
gr_set_mode(Game_screen_mode);
|
||||
if (Game_screen_mode != screen_mode)
|
||||
{
|
||||
Game_screen_mode = screen_mode;
|
||||
gr_set_mode(Game_screen_mode);
|
||||
game_init_render_buffers(SM_W(screen_mode), SM_H(screen_mode), VR_NONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,6 +162,11 @@ void nm_draw_background(int x1, int y1, int x2, int y2 )
|
|||
gr_palette_load( gr_palette );
|
||||
|
||||
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;
|
||||
gr_free_sub_bitmap(nm_background_sub);
|
||||
}
|
||||
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 );
|
||||
|
|
Loading…
Reference in a new issue