diff --git a/CHANGELOG.txt b/CHANGELOG.txt index aabd27c16..6634517f0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 -------- diff --git a/main/game.c b/main/game.c index e1aad15f4..7fe247114 100644 --- a/main/game.c +++ b/main/game.c @@ -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. diff --git a/main/menu.c b/main/menu.c index e3fa5de0f..7fd8fa413 100644 --- a/main/menu.c +++ b/main/menu.c @@ -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); } } diff --git a/main/newmenu.c b/main/newmenu.c index 30c5ce65a..e2dcbe770 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -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 );