if (anim->state & ANIM_STATE_RESTART)
anim->part_counter++;
+
+ if (anim->part_counter == anim->num_parts &&
+ c->anim_mode & ANIM_ONCE)
+ anim->state = ANIM_STATE_INACTIVE;
}
void HandleGlobalAnim_Mode(struct GlobalAnimControlInfo *ctrl, int action)
string_has_parameter(value, "all") ? ANIM_ALL :
ANIM_DEFAULT);
+ if (string_has_parameter(value, "once"))
+ result |= ANIM_ONCE;
+
if (string_has_parameter(value, "reverse"))
result |= ANIM_REVERSE;
MV_NONE)
/* values for animation mode (frame order and direction) */
+/* (stored in level files -- never change existing values) */
#define ANIM_NONE 0
#define ANIM_LOOP (1 << 0)
#define ANIM_LINEAR (1 << 1)
#define ANIM_OPAQUE_PLAYER (1 << 9)
/* values for special (non game element) animation modes */
+/* (not stored in level files -- can be changed, if needed) */
#define ANIM_HORIZONTAL (1 << 10)
#define ANIM_VERTICAL (1 << 11)
#define ANIM_CENTERED (1 << 12)
#define ANIM_STATIC_PANEL (1 << 13)
#define ANIM_ALL (1 << 14)
+#define ANIM_ONCE (1 << 15)
#define ANIM_DEFAULT ANIM_LOOP