From: Holger Schemel Date: Mon, 12 Feb 2024 23:03:47 +0000 (+0100) Subject: fixed playing intermissions with small game graphics for native EM engine X-Git-Tag: 4.4.0.0-test-1~369 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=80b6b64c0075c2dbfaa64245763f98ca15709bcb;p=rocksndiamonds.git fixed playing intermissions with small game graphics for native EM engine --- diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index 8f80b4f4..93350523 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -69,6 +69,11 @@ void setLevelInfoToDefaults_BD_Ext(int width, int height) { cave->w = width; cave->h = height; + + cave->x1 = 0; + cave->y1 = 0; + cave->x2 = cave->w - 1; + cave->y2 = cave->h - 1; } gd_flatten_cave(cave, 0); @@ -282,6 +287,8 @@ void InitGameEngine_BD(void) if (setup.bd_skip_uncovering) gd_scroll(game_bd.game, TRUE, TRUE); + ClearRectangle(gd_screen_bitmap, 0, 0, SXSIZE, SYSIZE); + RedrawPlayfield_BD(TRUE); UpdateGameDoorValues_BD(); @@ -375,10 +382,11 @@ void CoverScreen_BD(void) void BlitScreenToBitmap_BD(Bitmap *target_bitmap) { + GdCave *cave = native_bd_level.cave; int xsize = SXSIZE; int ysize = SYSIZE; - int full_xsize = native_bd_level.cave->w * TILESIZE_VAR; - int full_ysize = native_bd_level.cave->h * TILESIZE_VAR; + int full_xsize = (cave->x2 - cave->x1 + 1) * TILESIZE_VAR; + int full_ysize = (cave->y2 - cave->y1 + 1) * TILESIZE_VAR; int sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); int sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); int sxsize = (full_xsize < xsize ? full_xsize : xsize);