X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=600b4b3217a6ad785ccc3f1b4608c824fa4149f7;hb=4d3b0d040b3c5d397ac3b7a15f3d48c44d50e9dd;hp=4e53f626d624d0676dcb88bff81a9873be2aa0ef;hpb=0c454763268d571be71d2c7a633f5bd855d0ad0b;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index 4e53f626..600b4b32 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -201,23 +201,26 @@ void InitGfxDoor3Info(int ex, int ey, int exsize, int eysize) void InitGfxWindowInfo(int win_xsize, int win_ysize) { - gfx.win_xsize = win_xsize; - gfx.win_ysize = win_ysize; - - gfx.background_bitmap_mask = REDRAW_NONE; - - ReCreateBitmap(&gfx.background_bitmap, win_xsize, win_ysize, DEFAULT_DEPTH); + if (win_xsize != gfx.win_xsize || win_ysize != gfx.win_ysize) + { + ReCreateBitmap(&gfx.background_bitmap, win_xsize, win_ysize); #if defined(TARGET_SDL2) - ReCreateBitmap(&gfx.final_screen_bitmap, win_xsize, win_ysize, DEFAULT_DEPTH); + ReCreateBitmap(&gfx.final_screen_bitmap, win_xsize, win_ysize); #endif - ReCreateBitmap(&gfx.fade_bitmap_backup, win_xsize, win_ysize, DEFAULT_DEPTH); - ReCreateBitmap(&gfx.fade_bitmap_source, win_xsize, win_ysize, DEFAULT_DEPTH); - ReCreateBitmap(&gfx.fade_bitmap_target, win_xsize, win_ysize, DEFAULT_DEPTH); - ReCreateBitmap(&gfx.fade_bitmap_black, win_xsize, win_ysize, DEFAULT_DEPTH); + ReCreateBitmap(&gfx.fade_bitmap_backup, win_xsize, win_ysize); + ReCreateBitmap(&gfx.fade_bitmap_source, win_xsize, win_ysize); + ReCreateBitmap(&gfx.fade_bitmap_target, win_xsize, win_ysize); + ReCreateBitmap(&gfx.fade_bitmap_black, win_xsize, win_ysize); - ClearRectangle(gfx.fade_bitmap_black, 0, 0, win_xsize, win_ysize); + ClearRectangle(gfx.fade_bitmap_black, 0, 0, win_xsize, win_ysize); + } + + gfx.win_xsize = win_xsize; + gfx.win_ysize = win_ysize; + + gfx.background_bitmap_mask = REDRAW_NONE; } void InitGfxScrollbufferInfo(int scrollbuffer_width, int scrollbuffer_height) @@ -441,9 +444,9 @@ Bitmap *CreateBitmap(int width, int height, int depth) return new_bitmap; } -void ReCreateBitmap(Bitmap **bitmap, int width, int height, int depth) +void ReCreateBitmap(Bitmap **bitmap, int width, int height) { - Bitmap *new_bitmap = CreateBitmap(width, height, depth); + Bitmap *new_bitmap = CreateBitmap(width, height, DEFAULT_DEPTH); if (*bitmap == NULL) {