From: Holger Schemel Date: Mon, 9 Oct 2006 20:30:21 +0000 (+0200) Subject: rnd-20061009-1-src X-Git-Tag: 3.2.3^2~37 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a5f961c9d6d0ef7f1b69478b6ec20fbac09548b9;p=rocksndiamonds.git rnd-20061009-1-src * fixed bug with CE with move speed "not moving" not being animated * when changing player artwork by CE action, reset animation frame --- diff --git a/ChangeLog b/ChangeLog index 1daa7ca8..16e53b91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-09 + * fixed bug with CE with move speed "not moving" not being animated + * when changing player artwork by CE action, reset animation frame + 2006-10-03 * fixed bug with not unmapping main menu screen gadgets on other screens * fixed bug with un-pausing a paused game by releasing still pressed key diff --git a/src/conftime.h b/src/conftime.h index 5a7ed31d..b9d640b7 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-10-03 15:21]" +#define COMPILE_DATE_STRING "[2006-10-09 21:55]" diff --git a/src/game.c b/src/game.c index 00dff5ed..4d71c89a 100644 --- a/src/game.c +++ b/src/game.c @@ -53,6 +53,9 @@ #define USE_UFAST_PLAYER_EXIT_BUGFIX (USE_NEW_STUFF * 1) +#define USE_GFX_RESET_ONLY_WHEN_MOVING (USE_NEW_STUFF * 1) +#define USE_GFX_RESET_PLAYER_ARTWORK (USE_NEW_STUFF * 1) + /* for DigField() */ #define DF_NO_PUSH 0 @@ -3003,22 +3006,33 @@ static void ResetRandomAnimationValue(int x, int y) void InitMovingField(int x, int y, int direction) { int element = Feld[x][y]; + int move_stepsize = getElementMoveStepsize(x, y); int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); int newx = x + dx; int newy = y + dy; + boolean is_moving = (move_stepsize != 0); /* moving or being moved */ + boolean continues_moving = (WasJustMoving[x][y] && direction == MovDir[x][y]); - if (!WasJustMoving[x][y] || direction != MovDir[x][y]) + /* reset animation only for moving elements that change direction of moving + (else CEs with property "can move" / "not moving" are reset each frame) */ +#if USE_GFX_RESET_ONLY_WHEN_MOVING + if (is_moving && !continues_moving) + ResetGfxAnimation(x, y); +#else + if (!continues_moving) ResetGfxAnimation(x, y); +#endif MovDir[x][y] = direction; GfxDir[x][y] = direction; - GfxAction[x][y] = (direction == MV_DOWN && CAN_FALL(element) ? + GfxAction[x][y] = (!is_moving ? ACTION_WAITING : + direction == MV_DOWN && CAN_FALL(element) ? ACTION_FALLING : ACTION_MOVING); /* this is needed for CEs with property "can move" / "not moving" */ - if (getElementMoveStepsize(x, y) != 0) /* moving or being moved */ + if (is_moving) { if (Feld[newx][newy] == EL_EMPTY) Feld[newx][newy] = EL_BLOCKED; @@ -7230,7 +7244,7 @@ static void CloseAllOpenTimegates() } } -void EdelsteinFunkeln(int x, int y) +void DrawTwinkleOnField(int x, int y) { if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y)) return; @@ -7901,6 +7915,11 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) (level.use_artwork_element[i] ? level.artwork_element[i] : stored_player[i].element_nr); +#if USE_GFX_RESET_PLAYER_ARTWORK + if (stored_player[i].artwork_element != artwork_element) + stored_player[i].Frame = 0; +#endif + stored_player[i].artwork_element = artwork_element; SetPlayerWaiting(&stored_player[i], FALSE); @@ -9445,7 +9464,7 @@ void GameActions_RND() DrawLevelGraphicAnimationIfNeeded(x, y, graphic); if (IS_GEM(element) || element == EL_SP_INFOTRON) - EdelsteinFunkeln(x, y); + DrawTwinkleOnField(x, y); } else if ((element == EL_ACID || element == EL_EXIT_OPEN ||