{ "toon_20.direction", "down" },
{ "toon_20.position", "any" },
+ { "global.anim_1", UNDEFINED_FILENAME },
+ { "global.anim_2", UNDEFINED_FILENAME },
+ { "global.anim_3", UNDEFINED_FILENAME },
+ { "global.anim_4", UNDEFINED_FILENAME },
+ { "global.anim_5", UNDEFINED_FILENAME },
+ { "global.anim_6", UNDEFINED_FILENAME },
+ { "global.anim_7", UNDEFINED_FILENAME },
+ { "global.anim_8", UNDEFINED_FILENAME },
+
{ "menu.calibrate_red", "RocksElements.png" },
{ "menu.calibrate_red.xpos", "12" },
{ "menu.calibrate_red.ypos", "8" },
getFontBitmapID, getFontFromToken);
}
+void InitGlobalAnimGraphicInfo()
+{
+ struct PropertyMapping *property_mapping = getImageListPropertyMapping();
+ int num_property_mappings = getImageListPropertyMappingSize();
+ int i, j, k;
+
+ if (graphic_info == NULL) /* still at startup phase */
+ 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 (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;
+
+ /* initialize global animation definitions from dynamic configuration */
+ for (i = 0; i < num_property_mappings; i++)
+ {
+ int anim_nr = property_mapping[i].base_index - MAX_NUM_ELEMENTS - NUM_FONTS;
+ int part_nr = property_mapping[i].ext1_index - ACTION_PART_1;
+ int special = property_mapping[i].ext3_index;
+ int graphic = property_mapping[i].artwork_index;
+
+ if (anim_nr < 0 || anim_nr >= NUM_GLOBAL_ANIMS)
+ continue;
+
+ /* map animation part to first part, if not specified */
+ if (part_nr < 0)
+ part_nr = 0;
+
+ /* map animation screen to default, if not specified */
+ if (!IS_SPECIAL_GFX_ARG(special))
+ special = GFX_SPECIAL_ARG_DEFAULT;
+
+ global_anim_info[anim_nr].graphic[part_nr][special] = graphic;
+ }
+
+#if 0
+ printf("::: InitGlobalAnimGraphicInfo\n");
+
+ for (i = 0; i < NUM_GLOBAL_ANIMS; i++)
+ for (j = 0; j < NUM_GLOBAL_ANIM_PARTS; 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",
+ i, j, k, global_anim_info[i].graphic[j][k]);
+#endif
+}
+
void InitElementGraphicInfo()
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
print_timestamp_time("InitBitmapPointers");
InitFontGraphicInfo(); /* initialize text drawing functions */
print_timestamp_time("InitFontGraphicInfo");
+ InitGlobalAnimGraphicInfo(); /* initialize global animations */
+ print_timestamp_time("InitGlobalAnimGraphicInfo");
InitGraphicInfo_EM(); /* graphic mapping for EM engine */
print_timestamp_time("InitGraphicInfo_EM");
static void InitArtworkConfig()
{
- static char *image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS + 1];
+ static char *image_id_prefix[MAX_NUM_ELEMENTS +
+ NUM_FONTS +
+ NUM_GLOBAL_ANIMS + 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;
- image_id_prefix[MAX_NUM_ELEMENTS + NUM_FONTS] = NULL;
+ for (i = 0; i < NUM_GLOBAL_ANIMS; 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;
for (i = 0; i < MAX_NUM_ELEMENTS; i++)
sound_id_prefix[i] = element_info[i].token_name;
{ ".page[30]", ACTION_PAGE_30, FALSE },
{ ".page[31]", ACTION_PAGE_31, FALSE },
{ ".page[32]", ACTION_PAGE_32, FALSE },
+ { ".part_1", ACTION_PART_1, FALSE },
+ { ".part_2", ACTION_PART_2, FALSE },
+ { ".part_3", ACTION_PART_3, FALSE },
+ { ".part_4", ACTION_PART_4, FALSE },
+ { ".part_5", ACTION_PART_5, FALSE },
+ { ".part_6", ACTION_PART_6, FALSE },
+ { ".part_7", ACTION_PART_7, FALSE },
+ { ".part_8", ACTION_PART_8, FALSE },
{ ".other", ACTION_OTHER, FALSE },
/* empty suffix always matches -- check as last entry in InitSoundInfo() */
{ NULL }
};
+struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIMS + 1] =
+{
+ { "global.anim_1", },
+ { "global.anim_2", },
+ { "global.anim_3", },
+ { "global.anim_4", },
+ { "global.anim_5", },
+ { "global.anim_6", },
+ { "global.anim_7", },
+ { "global.anim_8", },
+
+ { NULL }
+};
+
/* ------------------------------------------------------------------------- */
/* music token prefix definitions */
#define ACTION_PAGE_30 81
#define ACTION_PAGE_31 82
#define ACTION_PAGE_32 83
-#define ACTION_OTHER 84
-
-#define NUM_ACTIONS 85
+#define ACTION_PART_1 84
+#define ACTION_PART_2 85
+#define ACTION_PART_3 86
+#define ACTION_PART_4 87
+#define ACTION_PART_5 88
+#define ACTION_PART_6 89
+#define ACTION_PART_7 90
+#define ACTION_PART_8 91
+#define ACTION_OTHER 92
+
+#define NUM_ACTIONS 93
#define ACTION_BORING_LAST ACTION_BORING_10
#define ACTION_SLEEPING_LAST ACTION_SLEEPING_3
#define NUM_FONTS 38
#define NUM_INITIAL_FONTS 4
+/* values for global animation configuration (must match those from main.c) */
+#define NUM_GLOBAL_ANIMS 8
+#define NUM_GLOBAL_ANIM_PARTS 8
+
/* values for game_status (must match special image configuration suffixes) */
#define GAME_MODE_DEFAULT 0
#define GAME_MODE_LOADING 1
/* internal bitmap ID for special graphics */
};
+struct GlobalAnimInfo
+{
+ 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];
+};
+
struct GraphicInfo
{
Bitmap **bitmaps; /* bitmaps in all required sizes */
extern struct SpecialSuffixInfo special_suffix_info[];
extern struct TokenIntPtrInfo image_config_vars[];
extern struct FontInfo font_info[];
+extern struct GlobalAnimInfo global_anim_info[];
extern struct MusicPrefixInfo music_prefix_info[];
extern struct GraphicInfo *graphic_info;
extern struct SoundInfo *sound_info;