From: Holger Schemel Date: Thu, 1 Dec 2005 01:18:40 +0000 (+0100) Subject: rnd-20051201-1-src X-Git-Tag: 3.1.2^2~42 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=949d7f40ef925eef7e473b12d5fc08a81d9c2eff;p=rocksndiamonds.git rnd-20051201-1-src --- diff --git a/ChangeLog b/ChangeLog index 950fe317..f8eec8df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,7 @@ (should be '#include ' instead) 2005-08-20 - * fixed bug preventing "walkable from no direction" from being ignored + * fixed bug which prevented "walkable from no direction" from working (due to compatibility code overwriting this setting after loading) 2005-08-15 diff --git a/src/conftime.h b/src/conftime.h index 8ef82a43..49683cd4 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-11-29 00:04]" +#define COMPILE_DATE_STRING "[2005-12-01 02:15]" diff --git a/src/game.c b/src/game.c index 239a6a70..9bea6aae 100644 --- a/src/game.c +++ b/src/game.c @@ -29,6 +29,7 @@ #define USE_NEW_SP_SLIPPERY (TRUE * USE_NEW_STUFF * 1) #define USE_NEW_COLLECT_COUNT (TRUE * USE_NEW_STUFF * 1) +#define USE_NEW_PLAYER_ANIM (TRUE * USE_NEW_STUFF * 1) /* for DigField() */ @@ -89,11 +90,18 @@ #define INITIAL_MOVE_DELAY_ON 0 /* values for player movement speed (which is in fact a delay value) */ +#define MOVE_DELAY_MIN_SPEED 32 #define MOVE_DELAY_NORMAL_SPEED 8 #define MOVE_DELAY_HIGH_SPEED 4 +#define MOVE_DELAY_MAX_SPEED 1 +#if 0 #define DOUBLE_MOVE_DELAY(x) (x = (x <= MOVE_DELAY_HIGH_SPEED ? x * 2 : x)) #define HALVE_MOVE_DELAY(x) (x = (x >= MOVE_DELAY_HIGH_SPEED ? x / 2 : x)) +#else +#define DOUBLE_MOVE_DELAY(x) (x = (x < MOVE_DELAY_MIN_SPEED ? x * 2 : x)) +#define HALVE_MOVE_DELAY(x) (x = (x > MOVE_DELAY_MAX_SPEED ? x / 2 : x)) +#endif #define DOUBLE_PLAYER_SPEED(p) (HALVE_MOVE_DELAY((p)->move_delay_value)) #define HALVE_PLAYER_SPEED(p) (DOUBLE_MOVE_DELAY((p)->move_delay_value)) @@ -5314,11 +5322,6 @@ void StartMoving(int x, int y) ContinueMoving(x, y); } -/* (emacs is confused here for some reason; this makes it happy again ;-) ) */ -void dummy() -{ -} - void ContinueMoving(int x, int y) { int element = Feld[x][y]; @@ -7439,12 +7442,25 @@ void AdvanceFrameAndPlayerCounters(int player_nr) for (i = 0; i < MAX_PLAYERS; i++) { boolean advance_player_counters = (player_nr == -1 || player_nr == i); - int move_frames = - MOVE_DELAY_NORMAL_SPEED / stored_player[i].move_delay_value; + int move_delay_value = stored_player[i].move_delay_value; + int move_frames = MOVE_DELAY_NORMAL_SPEED / move_delay_value; if (!advance_player_counters) /* not all players may be affected */ continue; +#if USE_NEW_PLAYER_ANIM + if (move_frames == 0) /* less than one move per game frame */ + { + int stepsize = TILEX / move_delay_value; + int delay = move_delay_value / MOVE_DELAY_NORMAL_SPEED; + int count = (stored_player[i].is_moving ? + ABS(stored_player[i].MovPos) / stepsize : FrameCounter); + + if (count % delay == 0) + move_frames = 1; + } +#endif + stored_player[i].Frame += move_frames; if (stored_player[i].MovPos != 0) @@ -7698,11 +7714,20 @@ void GameActions() if (IS_CHANGING(x, y) && (game.engine_version < VERSION_IDENT(3,0,7,1) || !Stop[x][y])) { + int page = element_info[element].event_page_nr[CE_DELAY]; #if 0 - ChangeElement(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : - element_info[element].event_page_nr[CE_DELAY]); + ChangeElement(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : page); #else - ChangeElement(x, y, element_info[element].event_page_nr[CE_DELAY]); + +#if 0 + printf("::: ChangeDelay == %d\n", ChangeDelay[x][y]); +#endif + + if (CAN_CHANGE(element)) + ChangeElement(x, y, page); + + if (HAS_ACTION(element) && ChangeDelay[x][y] == 0) + ExecuteCustomElementAction(x, y, element, page); #endif element = Feld[x][y]; diff --git a/src/tools.c b/src/tools.c index d5a370cb..726d9723 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1881,6 +1881,10 @@ void DrawPlayer(struct PlayerInfo *player) { GfxElement[jx][jy] = EL_UNDEFINED; + /* make sure that pushed elements are drawn with correct frame rate */ + if (player->is_pushing && player->is_moving) + GfxFrame[jx][jy] = player->StepFrame; + DrawLevelField(jx, jy); } } @@ -1930,6 +1934,7 @@ void DrawPlayer(struct PlayerInfo *player) player->is_moving, player_is_moving); #endif +#if 1 if (player->is_pushing && player->is_moving) { int px = SCREENX(jx), py = SCREENY(jy); @@ -1952,6 +1957,7 @@ void DrawPlayer(struct PlayerInfo *player) /* masked drawing is needed for EMC style (double) movement graphics */ DrawGraphicShiftedThruMask(px, py, pxx, pyy, graphic, frame, NO_CUTTING); } +#endif /* ----------------------------------------------------------------------- */ /* draw things in front of player (active dynamite or dynabombs) */