From: Holger Schemel Date: Fri, 31 Mar 2023 18:17:13 +0000 (+0200) Subject: fixed graphical bugs with off-screen playfield movement in MM engine X-Git-Tag: 4.3.5.3~9 X-Git-Url: https://git.artsoft.org/rocksndiamonds.git/?a=commitdiff_plain;h=2181d7515fcdeae73c7482c3e19cc6120279b556;p=rocksndiamonds.git fixed graphical bugs with off-screen playfield movement in MM engine This changes handles graphical bugs that may occur if the playfield of levels played with the MM game engine are larger than the visible part of the playfield. (This is not supported with MM style levels, but may occur when using custom artwork with smaller playfield viewport than intended by the level designer.) The problem could be seen with levels where pacman game elements leave and re-enter the visible part of the playfield. --- diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 39bb2467..8d77a8c0 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -364,7 +364,24 @@ void DrawScreenField_MM(int x, int y) void DrawLevelField_MM(int x, int y) { - DrawScreenField_MM(x, y); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + DrawScreenField_MM(SCREENX(x), SCREENY(y)); + else if (IS_MOVING(x, y)) + { + int newx,newy; + + Moving2Blocked(x, y, &newx, &newy); + if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy))) + DrawScreenField_MM(SCREENX(newx), SCREENY(newy)); + } + else if (IS_BLOCKED(x, y)) + { + int oldx, oldy; + + Blocked2Moving(x, y, &oldx, &oldy); + if (IN_SCR_FIELD(SCREENX(oldx), SCREENY(oldy))) + DrawScreenField_MM(SCREENX(oldx), SCREENY(oldy)); + } } void DrawMiniElement_MM(int x, int y, int element)