else
frame = gfx.anim_random_frame % num_frames;
}
+ else if (mode & ANIM_LEVEL_NR) // play frames by level number
+ {
+ int level_pos = level_nr - leveldir_current->first_level;
+
+ frame = level_pos % num_frames;
+ }
else if (mode & (ANIM_CE_VALUE | ANIM_CE_SCORE | ANIM_CE_DELAY))
{
frame = sync_frame % num_frames;
string_has_parameter(value, "centered") ? ANIM_CENTERED :
string_has_parameter(value, "all") ? ANIM_ALL :
string_has_parameter(value, "tiled") ? ANIM_TILED :
+ string_has_parameter(value, "level_nr") ? ANIM_LEVEL_NR :
ANIM_DEFAULT);
if (string_has_parameter(value, "once"))
#define ANIM_CE_DELAY (1 << 7)
#define ANIM_REVERSE (1 << 8)
#define ANIM_OPAQUE_PLAYER (1 << 9)
+#define ANIM_LEVEL_NR (1 << 10)
// 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_TILED (1 << 16)
-#define ANIM_RANDOM_STATIC (1 << 17)
+#define ANIM_HORIZONTAL (1 << 11)
+#define ANIM_VERTICAL (1 << 12)
+#define ANIM_CENTERED (1 << 13)
+#define ANIM_STATIC_PANEL (1 << 14)
+#define ANIM_ALL (1 << 15)
+#define ANIM_ONCE (1 << 16)
+#define ANIM_TILED (1 << 17)
+#define ANIM_RANDOM_STATIC (1 << 18)
#define ANIM_DEFAULT ANIM_LOOP