From: Holger Schemel Date: Tue, 31 May 2016 18:55:05 +0000 (+0200) Subject: changed function for re-creating bitmaps to always use default depth X-Git-Tag: 4.0.0.0-rc3~37 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4d3b0d040b3c5d397ac3b7a15f3d48c44d50e9dd;p=rocksndiamonds.git changed function for re-creating bitmaps to always use default depth --- diff --git a/src/game_em/init.c b/src/game_em/init.c index 719f5e13..0d4c3139 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -41,8 +41,7 @@ int open_all(void) void InitGfxBuffers_EM() { - ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, - DEFAULT_DEPTH); + ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY); global_em_info.screenbuffer = screenBitmap; } diff --git a/src/game_sp/init.c b/src/game_sp/init.c index b515020c..c1dbc3e4 100644 --- a/src/game_sp/init.c +++ b/src/game_sp/init.c @@ -80,7 +80,7 @@ void InitPrecedingPlayfieldMemory() void InitGfxBuffers_SP() { - ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE, DEFAULT_DEPTH); + ReCreateBitmap(&bitmap_db_field_sp, FXSIZE, FYSIZE); } unsigned int InitEngineRandom_SP(int seed) diff --git a/src/init.c b/src/init.c index ba6ea496..770d88c8 100644 --- a/src/init.c +++ b/src/init.c @@ -5165,17 +5165,17 @@ void InitGfxBuffers() if (WIN_XSIZE != win_xsize_last || WIN_YSIZE != win_ysize_last) { /* used to temporarily store the backbuffer -- only re-create if changed */ - ReCreateBitmap(&bitmap_db_store_1, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); - ReCreateBitmap(&bitmap_db_store_2, WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + ReCreateBitmap(&bitmap_db_store_1, WIN_XSIZE, WIN_YSIZE); + ReCreateBitmap(&bitmap_db_store_2, WIN_XSIZE, WIN_YSIZE); win_xsize_last = WIN_XSIZE; win_ysize_last = WIN_YSIZE; } - ReCreateBitmap(&bitmap_db_field, FXSIZE, FYSIZE, DEFAULT_DEPTH); - ReCreateBitmap(&bitmap_db_panel, DXSIZE, DYSIZE, DEFAULT_DEPTH); - ReCreateBitmap(&bitmap_db_door_1, 3 * DXSIZE, DYSIZE, DEFAULT_DEPTH); - ReCreateBitmap(&bitmap_db_door_2, 3 * VXSIZE, VYSIZE, DEFAULT_DEPTH); + ReCreateBitmap(&bitmap_db_field, FXSIZE, FYSIZE); + ReCreateBitmap(&bitmap_db_panel, DXSIZE, DYSIZE); + ReCreateBitmap(&bitmap_db_door_1, 3 * DXSIZE, DYSIZE); + ReCreateBitmap(&bitmap_db_door_2, 3 * VXSIZE, VYSIZE); /* initialize screen properties */ InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE, diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index a860eeb9..9b44b372 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -431,7 +431,7 @@ void SDLInitVideoBuffer(boolean fullscreen) should never be drawn to directly, it would do no harm nevertheless. */ /* create additional (symbolic) buffer for double-buffering */ - ReCreateBitmap(&window, video.width, video.height, video.depth); + ReCreateBitmap(&window, video.width, video.height); } static boolean SDLCreateScreen(boolean fullscreen) diff --git a/src/libgame/system.c b/src/libgame/system.c index acd36018..600b4b32 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -203,16 +203,16 @@ void InitGfxWindowInfo(int win_xsize, int win_ysize) { if (win_xsize != gfx.win_xsize || win_ysize != gfx.win_ysize) { - ReCreateBitmap(&gfx.background_bitmap, win_xsize, win_ysize, DEFAULT_DEPTH); + 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); } @@ -444,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) { diff --git a/src/libgame/system.h b/src/libgame/system.h index 109cca0e..97fed8a2 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1385,7 +1385,7 @@ void CloseVideoDisplay(void); void InitVideoBuffer(int, int, int, boolean); Bitmap *CreateBitmapStruct(void); Bitmap *CreateBitmap(int, int, int); -void ReCreateBitmap(Bitmap **, int, int, int); +void ReCreateBitmap(Bitmap **, int, int); void FreeBitmap(Bitmap *); void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int); void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int);