From 80b6b64c0075c2dbfaa64245763f98ca15709bcb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 13 Feb 2024 00:03:47 +0100 Subject: [PATCH] fixed playing intermissions with small game graphics for native EM engine --- src/game_bd/main_bd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); -- 2.34.1