{ "toon_20.direction", "down" },
{ "toon_20.position", "any" },
+ { "global.anim_1.gfx", UNDEFINED_FILENAME },
+ { "global.anim_2.gfx", UNDEFINED_FILENAME },
+ { "global.anim_3.gfx", UNDEFINED_FILENAME },
+ { "global.anim_4.gfx", UNDEFINED_FILENAME },
+ { "global.anim_5.gfx", UNDEFINED_FILENAME },
+ { "global.anim_6.gfx", UNDEFINED_FILENAME },
+ { "global.anim_7.gfx", UNDEFINED_FILENAME },
+ { "global.anim_8.gfx", UNDEFINED_FILENAME },
+
{ "global.anim_1", UNDEFINED_FILENAME },
{ "global.anim_2", UNDEFINED_FILENAME },
{ "global.anim_3", UNDEFINED_FILENAME },
for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
{
- for (j = 0; j < NUM_GLOBAL_ANIM_PARTS; j++)
+ for (j = 0; j < NUM_GLOBAL_ANIM_PARTS_ALL; j++)
{
for (k = 0; k < NUM_SPECIAL_GFX_ARGS; k++)
{
return;
/* always start with reliable default values (no global animations) */
- for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
- for (j = 0; j < NUM_GLOBAL_ANIM_PARTS; j++)
+ for (i = 0; i < NUM_GLOBAL_ANIM_TOKENS; i++)
+ for (j = 0; j < NUM_GLOBAL_ANIM_PARTS_ALL; j++)
for (k = 0; k < NUM_SPECIAL_GFX_ARGS; k++)
global_anim_info[i].graphic[j][k] = IMG_UNDEFINED;
/* initialize global animation definitions from static configuration */
- for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
- global_anim_info[i].graphic[0][GFX_SPECIAL_ARG_DEFAULT] =
- IMG_GLOBAL_ANIM_1 + i;
+ for (i = 0; i < NUM_GLOBAL_ANIM_TOKENS; i++)
+ {
+ int j = GLOBAL_ANIM_ID_PART_BASE;
+ int k = GFX_SPECIAL_ARG_DEFAULT;
+
+ global_anim_info[i].graphic[j][k] = IMG_GLOBAL_ANIM_1_GFX + i;
+ }
/* initialize global animation definitions from dynamic configuration */
for (i = 0; i < num_property_mappings; i++)
int special = property_mapping[i].ext3_index;
int graphic = property_mapping[i].artwork_index;
- if (anim_nr < 0 || anim_nr >= NUM_GLOBAL_ANIMS)
+ if (anim_nr < 0 || anim_nr >= NUM_GLOBAL_ANIM_TOKENS)
continue;
- /* map animation part to first part, if not specified */
- if (part_nr < 0)
- part_nr = 0;
+ /* set animation part to base part, if not specified */
+ if (!IS_GLOBAL_ANIM_PART(part_nr))
+ part_nr = GLOBAL_ANIM_ID_PART_BASE;
- /* map animation screen to default, if not specified */
+ /* set animation screen to default, if not specified */
if (!IS_SPECIAL_GFX_ARG(special))
special = GFX_SPECIAL_ARG_DEFAULT;
printf("::: InitGlobalAnimGraphicInfo\n");
for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
- for (j = 0; j < NUM_GLOBAL_ANIM_PARTS; j++)
+ for (j = 0; j < NUM_GLOBAL_ANIM_PARTS_ALL; j++)
for (k = 0; k < NUM_SPECIAL_GFX_ARGS; k++)
if (global_anim_info[i].graphic[j][k] != IMG_UNDEFINED &&
graphic_info[global_anim_info[i].graphic[j][k]].bitmap != NULL)
- printf("::: %d, %d, %d => %d\n",
+ printf("::: - anim %d, part %d, mode %d => %d\n",
i, j, k, global_anim_info[i].graphic[j][k]);
#endif
}
{
static char *image_id_prefix[MAX_NUM_ELEMENTS +
NUM_FONTS +
- NUM_GLOBAL_ANIMS + 1];
+ NUM_GLOBAL_ANIM_TOKENS + 1];
static char *sound_id_prefix[2 * MAX_NUM_ELEMENTS + 1];
static char *music_id_prefix[NUM_MUSIC_PREFIXES + 1];
static char *action_id_suffix[NUM_ACTIONS + 1];
image_id_prefix[i] = element_info[i].token_name;
for (i = 0; i < NUM_FONTS; i++)
image_id_prefix[MAX_NUM_ELEMENTS + i] = font_info[i].token_name;
- for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
+ for (i = 0; i < NUM_GLOBAL_ANIM_TOKENS; i++)
image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS + i] =
global_anim_info[i].token_name;
- image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS + NUM_GLOBAL_ANIMS] = NULL;
+ image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS + NUM_GLOBAL_ANIM_TOKENS] = NULL;
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
sound_id_prefix[i] = element_info[i].token_name;
{ NULL }
};
-struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIMS + 1] =
+struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIM_TOKENS + 1] =
{
+ /* (real) graphic definitions used to define animation graphics */
+ { "global.anim_1.gfx", },
+ { "global.anim_2.gfx", },
+ { "global.anim_3.gfx", },
+ { "global.anim_4.gfx", },
+ { "global.anim_5.gfx", },
+ { "global.anim_6.gfx", },
+ { "global.anim_7.gfx", },
+ { "global.anim_8.gfx", },
+
+ /* (dummy) graphic definitions used to define animation controls */
{ "global.anim_1", },
{ "global.anim_2", },
{ "global.anim_3", },
#define IS_SPECIAL_GFX_ARG(a) ((a) >= 0 && (a) < NUM_SPECIAL_GFX_ARGS)
+#define IS_GLOBAL_ANIM_PART(a) ((a) >= 0 && (a) < NUM_GLOBAL_ANIM_PARTS)
+
#define EL_CASCADE_ACTIVE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e))
#define EL_CASCADE_INACTIVE(e) (IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e))
#define EL_CASCADE_TOGGLE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : \
/* values for global animation configuration (must match those from main.c) */
#define NUM_GLOBAL_ANIMS 8
#define NUM_GLOBAL_ANIM_PARTS 8
+#define NUM_GLOBAL_ANIM_PARTS_ALL (NUM_GLOBAL_ANIM_PARTS + 1)
+#define NUM_GLOBAL_ANIM_TOKENS (2 * NUM_GLOBAL_ANIMS)
+
+#define GLOBAL_ANIM_ID_GRAPHIC_FIRST 0
+#define GLOBAL_ANIM_ID_GRAPHIC_LAST 7
+#define GLOBAL_ANIM_ID_CONTROL_FIRST (NUM_GLOBAL_ANIMS + 0)
+#define GLOBAL_ANIM_ID_CONTROL_LAST (NUM_GLOBAL_ANIMS + 7)
+
+#define GLOBAL_ANIM_ID_PART_FIRST 0
+#define GLOBAL_ANIM_ID_PART_LAST 7
+#define GLOBAL_ANIM_ID_PART_BASE 8
/* values for game_status (must match special image configuration suffixes) */
#define GAME_MODE_DEFAULT 0
{
char *token_name; /* global animation token in config files */
- /* global animation parts for certain screens */
- int graphic[NUM_GLOBAL_ANIM_PARTS][NUM_SPECIAL_GFX_ARGS];
+ /* global animation graphic and control definitions */
+ int graphic[NUM_GLOBAL_ANIM_PARTS_ALL][NUM_SPECIAL_GFX_ARGS];
};
struct GraphicInfo