part->anim_event_state = (c->anim_event != ANIM_EVENT_UNDEFINED);
part->initial_anim_sync_frame =
- (g->anim_global_sync ? 0 : anim_sync_frame + part->init_delay_counter);
+ (g->anim_global_sync || g->anim_global_anim_sync ? 0 :
+ anim_sync_frame + part->init_delay_counter);
// do not re-initialize random animation frame after fade-in
if (part->anim_random_frame == -1)
return click_consumed_current;
}
+
+int getGlobalAnimSyncFrame(void)
+{
+ return anim_sync_frame;
+}
boolean HandleGlobalAnimClicks(int, int, int, boolean);
+int getGlobalAnimSyncFrame(void);
+
#endif
{ ".delay", "1", TYPE_INTEGER },
{ ".anim_mode", ARG_UNDEFINED, TYPE_STRING },
{ ".global_sync", "false", TYPE_BOOLEAN },
+ { ".global_anim_sync", "false", TYPE_BOOLEAN },
{ ".crumbled_like", ARG_UNDEFINED, TYPE_ELEMENT },
{ ".diggable_like", ARG_UNDEFINED, TYPE_ELEMENT },
{ ".border_size", ARG_UNDEFINED, TYPE_INTEGER },
int element = gpc->value;
int graphic = el2panelimg(element);
int init_gfx_random = (graphic_info[graphic].anim_global_sync ?
- sync_random_frame : INIT_GFX_RANDOM());
+ sync_random_frame :
+ graphic_info[graphic].anim_global_anim_sync ?
+ getGlobalAnimSyncFrame() : INIT_GFX_RANDOM());
if (gpc->value != gpc->last_value)
{
int last_anim_random_frame = gfx.anim_random_frame;
int graphic = gpc->graphic;
int init_gfx_random = (graphic_info[graphic].anim_global_sync ?
- sync_random_frame : INIT_GFX_RANDOM());
+ sync_random_frame :
+ graphic_info[graphic].anim_global_anim_sync ?
+ getGlobalAnimSyncFrame() : INIT_GFX_RANDOM());
if (gpc->value != gpc->last_value)
{
if (graphic_info[graphic].anim_global_sync)
GfxFrame[x][y] = FrameCounter;
+ else if (graphic_info[graphic].anim_global_anim_sync)
+ GfxFrame[x][y] = getGlobalAnimSyncFrame();
else if (ANIM_MODE(graphic) == ANIM_CE_VALUE)
GfxFrame[x][y] = CustomValue[x][y];
else if (ANIM_MODE(graphic) == ANIM_CE_SCORE)
// animation synchronized with global frame counter, not move position
g->anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
+ // animation synchronized with global anim frame counter, not move position
+ g->anim_global_anim_sync = parameter[GFX_ARG_GLOBAL_ANIM_SYNC];
+
// optional element for cloning crumble graphics
if (parameter[GFX_ARG_CRUMBLED_LIKE] != ARG_UNDEFINED_VALUE)
g->crumbled_like = parameter[GFX_ARG_CRUMBLED_LIKE];
GFX_ARG_DELAY,
GFX_ARG_ANIM_MODE,
GFX_ARG_GLOBAL_SYNC,
+ GFX_ARG_GLOBAL_ANIM_SYNC,
GFX_ARG_CRUMBLED_LIKE,
GFX_ARG_DIGGABLE_LIKE,
GFX_ARG_BORDER_SIZE,
int anim_mode;
boolean anim_global_sync;
+ boolean anim_global_anim_sync;
int crumbled_like; // element for cloning crumble graphics
int diggable_like; // element for cloning digging graphics
// animation synchronized with global frame counter, not move position
if (graphic_info[graphic].anim_global_sync || sync_frame < 0)
sync_frame = FrameCounter;
+ else if (graphic_info[graphic].anim_global_anim_sync)
+ sync_frame = getGlobalAnimSyncFrame();
return getAnimationFrame(graphic_info[graphic].anim_frames,
graphic_info[graphic].anim_delay,
if (graphic_info[graphic].anim_global_sync)
sync_frame = FrameCounter;
+ else if (graphic_info[graphic].anim_global_anim_sync)
+ sync_frame = getGlobalAnimSyncFrame();
else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY))
sync_frame = GfxFrame[x][y];
else
if (graphic_info[graphic].anim_global_sync)
sync_frame = FrameCounter;
+ else if (graphic_info[graphic].anim_global_anim_sync)
+ sync_frame = getGlobalAnimSyncFrame();
else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY))
sync_frame = GfxFrame[x][y];
else