From: Holger Schemel Date: Wed, 3 Mar 2021 18:46:19 +0000 (+0100) Subject: fixed graphics config option to support elements on non-black background X-Git-Tag: 4.3.0.0~221 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=62356d7587434a3822d39f74d8b4c86a9febd123 fixed graphics config option to support elements on non-black background This change fixes graphical bugs for moving and falling elements when using non-black background by using option "game.use_masked_elements". This is a fix for commit bbf7eaa0. --- diff --git a/src/tools.c b/src/tools.c index b0df3440..325f7e1c 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2535,6 +2535,16 @@ void DrawScreenField(int x, int y) else DrawScreenElement(x, y, EL_EMPTY); + if (cut_mode != CUT_BELOW && game.use_masked_elements) + { + int dir = MovDir[lx][ly]; + int newx = x + (dir == MV_LEFT ? -1 : dir == MV_RIGHT ? +1 : 0); + int newy = y + (dir == MV_UP ? -1 : dir == MV_DOWN ? +1 : 0); + + if (IN_SCR_FIELD(newx, newy)) + DrawScreenElement(newx, newy, EL_EMPTY); + } + if (horiz_move) DrawScreenElementShifted(x, y, MovPos[lx][ly], 0, element, NO_CUTTING); else if (cut_mode == NO_CUTTING)