From: Holger Schemel Date: Sat, 24 Feb 2007 02:16:45 +0000 (+0100) Subject: rnd-20070224-1-src X-Git-Tag: 3.2.4^2~84 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2a54652c5fad8751e08b648111a0534f8c012a32;p=rocksndiamonds.git rnd-20070224-1-src * fixed bug in "InitMovingField()" where treating an integer array as boolean caused wrong resetting of animations while elements are moving * fixed problem with resetting animations when starting element change --- diff --git a/ChangeLog b/ChangeLog index 42c67769..ec57d7dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-24 + * fixed bug in "InitMovingField()" where treating an integer array as + boolean caused wrong resetting of animations while elements are moving + * fixed problem with resetting animations when starting element change + 2007-02-08 * added sort priority for order of title screens and title messages diff --git a/src/conftime.h b/src/conftime.h index c11aa0b1..3d5d53f5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-02-21 03:39" +#define COMPILE_DATE_STRING "2007-02-24 02:52" diff --git a/src/game.c b/src/game.c index e17ce2dd..237395e7 100644 --- a/src/game.c +++ b/src/game.c @@ -59,6 +59,8 @@ #define USE_FIX_KILLED_BY_NON_WALKABLE (USE_NEW_STUFF * 1) #define USE_FIX_IMPACT_COLLISION (USE_NEW_STUFF * 1) +#define USE_GFX_RESET_WHEN_NOT_MOVING (USE_NEW_STUFF * 1) + /* for DigField() */ #define DF_NO_PUSH 0 @@ -3309,7 +3311,12 @@ void InitMovingField(int x, int y, int direction) /* check if element was/is moving or being moved before/after mode change */ #if 1 +#if 1 + is_moving_before = (WasJustMoving[x][y] != 0); +#else + /* (!!! this does not work -- WasJustMoving is NOT a boolean value !!!) */ is_moving_before = WasJustMoving[x][y]; +#endif #else is_moving_before = (getElementMoveStepsizeExt(x, y, MovDir[x][y]) != 0); #endif @@ -6854,6 +6861,17 @@ void ContinueMoving(int x, int y) if (ABS(MovPos[x][y]) < TILEX) { +#if 0 + int ee = Feld[x][y]; + int gg = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); + int ff = getGraphicAnimationFrame(gg, GfxFrame[x][y]); + + printf("::: %d.%d: moving %d ... [%d, %d, %d] [%d, %d, %d]\n", + x, y, ABS(MovPos[x][y]), + ee, gg, ff, + GfxAction[x][y], GfxDir[x][y], GfxFrame[x][y]); +#endif + DrawLevelField(x, y); return; /* element is still moving */ @@ -9046,8 +9064,18 @@ static void HandleElementChange(int x, int y, int page) if (change->can_change) { - ResetGfxAnimation(x, y); - ResetRandomAnimationValue(x, y); +#if 0 + /* !!! not clear why graphic animation should be reset at all here !!! */ +#if USE_GFX_RESET_WHEN_NOT_MOVING + /* when a custom element is about to change (for example by change delay), + do not reset graphic animation when the custom element is moving */ + if (IS_MOVING(x, y)) +#endif + { + ResetGfxAnimation(x, y); + ResetRandomAnimationValue(x, y); + } +#endif if (change->pre_change_function) change->pre_change_function(x, y);