if (!DelayReached(&action_delay, action_delay_value))
return;
+ if (init_last.busy.x == -1)
+ init_last.busy.x = WIN_XSIZE / 2;
+ if (init_last.busy.y == -1)
+ init_last.busy.y = WIN_YSIZE / 2;
+
x = ALIGNED_TEXT_XPOS(&init_last.busy);
y = ALIGNED_TEXT_YPOS(&init_last.busy);
FrameCounter++;
}
+void DrawGlobalAnim()
+{
+}
+
void FreeGadgets()
{
FreeLevelEditorGadgets();
graphic_info[i].bitmap = graphic_info[i].bitmaps[IMG_BITMAP_STANDARD];
}
+static void InitGlobalAnimImages()
+{
+ int i, j, k;
+
+ 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++)
+ {
+ int graphic = global_anim_info[i].graphic[j][k];
+
+ if (graphic == IMG_UNDEFINED)
+ continue;
+
+ // create textures from images for fast GPU blitting, if possible
+ CreateImageTextures(graphic);
+ }
+ }
+ }
+}
+
#if 1
/* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */
void SetBitmaps_EM(Bitmap **em_bitmap)
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();
g->tile_size = TILESIZE; /* standard tile size */
#endif
-#if 0
- // CHECK: when setting tile size, should this set width and height?
+ // when setting tile size, also set width and height accordingly
g->width = g->tile_size;
g->height = g->tile_size;
-#endif
}
if (g->use_image_size)
print_timestamp_time("InitBitmapPointers");
InitFontGraphicInfo(); /* initialize text drawing functions */
print_timestamp_time("InitFontGraphicInfo");
+ InitGlobalAnimGraphicInfo(); /* initialize global animation config */
+ print_timestamp_time("InitGlobalAnimGraphicInfo");
+ InitGlobalAnimImages(); /* initialize global animation images */
+ print_timestamp_time("InitGlobalAnimImages");
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;
init.busy.height = anim_initial.height;
InitMenuDesignSettings_Static();
+
InitGfxDrawBusyAnimFunction(DrawInitAnim);
+ InitGfxDrawGlobalAnimFunction(DrawGlobalAnim);
/* use copy of busy animation to prevent change while reloading artwork */
init_last = init;