#define USE_STOP_CHANGED_ELEMENTS (USE_NEW_STUFF * 1)
#define USE_ELEMENT_TOUCHING_BUGFIX (USE_NEW_STUFF * 1)
#define USE_NEW_CONTINUOUS_SNAPPING (USE_NEW_STUFF * 1)
+#define USE_GFX_RESET_GFX_ANIMATION (USE_NEW_STUFF * 1)
#define USE_QUICKSAND_IMPACT_BUGFIX (USE_NEW_STUFF * 0)
boolean SnapField(struct PlayerInfo *, int, int);
boolean DropElement(struct PlayerInfo *);
+static int getInvisibleActiveFromInvisibleElement(int);
+static int getInvisibleFromInvisibleActiveElement(int);
static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS];
game.light_time_left = level.time_light * FRAMES_PER_SECOND;
break;
+ case EL_INVISIBLE_STEELWALL:
+ case EL_INVISIBLE_WALL:
+ case EL_INVISIBLE_SAND:
+ if (game.light_time_left > 0 ||
+ game.lenses_time_left > 0)
+ Feld[x][y] = getInvisibleActiveFromInvisibleElement(element);
+ break;
+
case EL_EMC_MAGIC_BALL:
if (game.ball_state)
Feld[x][y] = EL_EMC_MAGIC_BALL_ACTIVE;
LoadScore(level_nr);
- if (strcmp(setup.player_name, EMPTY_PLAYER_NAME) == 0 ||
+ if (strEqual(setup.player_name, EMPTY_PLAYER_NAME) ||
local_player->score < highscore[MAX_SCORE_ENTRIES - 1].Score)
return -1;
#ifdef ONE_PER_NAME
for (l = k; l < MAX_SCORE_ENTRIES; l++)
- if (!strcmp(setup.player_name, highscore[l].Name))
+ if (strEqual(setup.player_name, highscore[l].Name))
m = l;
if (m == k) /* player's new highscore overwrites his old one */
goto put_into_list;
}
}
-static void ResetRandomAnimationValue(int x, int y)
+#if USE_GFX_RESET_GFX_ANIMATION
+static void ResetGfxFrame(int x, int y, boolean redraw)
{
- GfxRandom[x][y] = INIT_GFX_RANDOM();
+ int element = Feld[x][y];
+ int graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
+ int last_gfx_frame = GfxFrame[x][y];
+
+ if (graphic_info[graphic].anim_global_sync)
+ GfxFrame[x][y] = FrameCounter;
+ else if (ANIM_MODE(graphic) == ANIM_CE_VALUE)
+ GfxFrame[x][y] = CustomValue[x][y];
+ else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
+ GfxFrame[x][y] = element_info[element].collect_score;
+
+ if (redraw && GfxFrame[x][y] != last_gfx_frame)
+ DrawLevelGraphicAnimation(x, y, graphic);
}
+#endif
static void ResetGfxAnimation(int x, int y)
{
int element, graphic;
#endif
- GfxFrame[x][y] = 0;
GfxAction[x][y] = ACTION_DEFAULT;
GfxDir[x][y] = MovDir[x][y];
+ GfxFrame[x][y] = 0;
#if 0
element = Feld[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
GfxFrame[x][y] = element_info[element].collect_score;
#endif
+
+#if USE_GFX_RESET_GFX_ANIMATION
+ ResetGfxFrame(x, y, FALSE);
+#endif
+}
+
+static void ResetRandomAnimationValue(int x, int y)
+{
+ GfxRandom[x][y] = INIT_GFX_RANDOM();
}
void InitMovingField(int x, int y, int direction)
static void TurnRound(int x, int y)
{
int direction = MovDir[x][y];
-#if 1
+#if 0
int element, graphic;
#endif
GfxAction[x][y] = ACTION_TURNING_FROM_LEFT + MV_DIR_TO_BIT(direction);
#if 1
+ ResetGfxFrame(x, y, FALSE);
+#else
element = Feld[x][y];
graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
Feld[x][y] = new_element;
+#if !USE_GFX_RESET_GFX_ANIMATION
ResetGfxAnimation(x, y);
ResetRandomAnimationValue(x, y);
+#endif
if (element_info[new_element].move_direction_initial == MV_START_PREVIOUS)
MovDir[x][y] = previous_move_direction;
new_element = Feld[x][y]; /* element may have changed */
+#if USE_GFX_RESET_GFX_ANIMATION
+ ResetGfxAnimation(x, y);
+ ResetRandomAnimationValue(x, y);
+#endif
+
DrawLevelField(x, y);
if (GFX_CRUMBLED(new_element))
printf("::: Yo man! Rocks can fall!\n");
#endif
+#if 1
+ ResetGfxFrame(x, y, TRUE);
+#else
if (graphic_info[graphic].anim_global_sync)
GfxFrame[x][y] = FrameCounter;
else if (ANIM_MODE(graphic) == ANIM_CE_VALUE)
#endif
DrawLevelGraphicAnimation(x, y, graphic);
}
+#endif
if (ANIM_MODE(graphic) == ANIM_RANDOM &&
IS_NEXT_FRAME(GfxFrame[x][y], graphic))