-#if 0
- /* optional zoom factor for scaling up the image to a larger size */
- if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE)
- g->scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR];
- if (g->scale_up_factor < 1)
- g->scale_up_factor = 1; /* no scaling */
-#endif
-
- if (src_bitmap)
- {
- /* get final bitmap size (with scaling, but without small images) */
- int src_image_width = get_scaled_graphic_width(graphic);
- int src_image_height = get_scaled_graphic_height(graphic);
-
- if (src_image_width == 0 || src_image_height == 0)
- {
- /* only happens when loaded outside artwork system (like "global.busy") */
- src_image_width = src_bitmap->width;
- src_image_height = src_bitmap->height;
- }
-
- anim_frames_per_row = src_image_width / g->width;
- anim_frames_per_col = src_image_height / g->height;
-
- g->src_image_width = src_image_width;
- g->src_image_height = src_image_height;
- }
-
- /* correct x or y offset dependent of vertical or horizontal frame order */
- if (parameter[GFX_ARG_VERTICAL]) /* frames are ordered vertically */
- {
- g->offset_y = (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ?
- parameter[GFX_ARG_OFFSET] : g->height);
- anim_frames_per_line = anim_frames_per_col;
- }
- else /* frames are ordered horizontally */
- {
- g->offset_x = (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ?
- parameter[GFX_ARG_OFFSET] : g->width);
- anim_frames_per_line = anim_frames_per_row;
- }
-
- /* optionally, the x and y offset of frames can be specified directly */
- if (parameter[GFX_ARG_XOFFSET] != ARG_UNDEFINED_VALUE)
- g->offset_x = parameter[GFX_ARG_XOFFSET];
- if (parameter[GFX_ARG_YOFFSET] != ARG_UNDEFINED_VALUE)
- g->offset_y = parameter[GFX_ARG_YOFFSET];
-
- /* optionally, moving animations may have separate start and end graphics */
- g->double_movement = parameter[GFX_ARG_2ND_MOVEMENT_TILE];
-
- if (parameter[GFX_ARG_2ND_VERTICAL] == ARG_UNDEFINED_VALUE)
- parameter[GFX_ARG_2ND_VERTICAL] = !parameter[GFX_ARG_VERTICAL];
-
- /* correct x or y offset2 dependent of vertical or horizontal frame order */
- if (parameter[GFX_ARG_2ND_VERTICAL]) /* frames are ordered vertically */
- g->offset2_y = (parameter[GFX_ARG_2ND_OFFSET] != ARG_UNDEFINED_VALUE ?
- parameter[GFX_ARG_2ND_OFFSET] : g->height);
- else /* frames are ordered horizontally */
- g->offset2_x = (parameter[GFX_ARG_2ND_OFFSET] != ARG_UNDEFINED_VALUE ?
- parameter[GFX_ARG_2ND_OFFSET] : g->width);
-
- /* optionally, the x and y offset of 2nd graphic can be specified directly */
- if (parameter[GFX_ARG_2ND_XOFFSET] != ARG_UNDEFINED_VALUE)
- g->offset2_x = parameter[GFX_ARG_2ND_XOFFSET];
- if (parameter[GFX_ARG_2ND_YOFFSET] != ARG_UNDEFINED_VALUE)
- g->offset2_y = parameter[GFX_ARG_2ND_YOFFSET];
-
- /* optionally, the second movement tile can be specified as start tile */
- if (parameter[GFX_ARG_2ND_SWAP_TILES] != ARG_UNDEFINED_VALUE)
- g->swap_double_tiles= parameter[GFX_ARG_2ND_SWAP_TILES];
-
- /* automatically determine correct number of frames, if not defined */
- if (parameter[GFX_ARG_FRAMES] != ARG_UNDEFINED_VALUE)
- g->anim_frames = parameter[GFX_ARG_FRAMES];
- else if (parameter[GFX_ARG_XPOS] == 0 && !parameter[GFX_ARG_VERTICAL])
- g->anim_frames = anim_frames_per_row;
- else if (parameter[GFX_ARG_YPOS] == 0 && parameter[GFX_ARG_VERTICAL])
- g->anim_frames = anim_frames_per_col;
- else
- g->anim_frames = 1;
-
- if (g->anim_frames == 0) /* frames must be at least 1 */
- g->anim_frames = 1;
-
- g->anim_frames_per_line =
- (parameter[GFX_ARG_FRAMES_PER_LINE] != ARG_UNDEFINED_VALUE ?
- parameter[GFX_ARG_FRAMES_PER_LINE] : anim_frames_per_line);
-
- g->anim_delay = parameter[GFX_ARG_DELAY];
- if (g->anim_delay == 0) /* delay must be at least 1 */
- g->anim_delay = 1;
-
- g->anim_mode = parameter[GFX_ARG_ANIM_MODE];
-#if 0
- if (g->anim_frames == 1)
- g->anim_mode = ANIM_NONE;
-#endif
-
- /* automatically determine correct start frame, if not defined */
- if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE)
- g->anim_start_frame = 0;
- else if (g->anim_mode & ANIM_REVERSE)
- g->anim_start_frame = g->anim_frames - parameter[GFX_ARG_START_FRAME] - 1;
- else
- g->anim_start_frame = parameter[GFX_ARG_START_FRAME];
-
- /* animation synchronized with global frame counter, not move position */
- g->anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
-
- /* optional element for cloning crumble graphics */
- if (parameter[GFX_ARG_CRUMBLED_LIKE] != ARG_UNDEFINED_VALUE)
- g->crumbled_like = parameter[GFX_ARG_CRUMBLED_LIKE];
-
- /* optional element for cloning digging graphics */
- if (parameter[GFX_ARG_DIGGABLE_LIKE] != ARG_UNDEFINED_VALUE)
- g->diggable_like = parameter[GFX_ARG_DIGGABLE_LIKE];
-
- /* optional border size for "crumbling" diggable graphics */
- if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE)
- g->border_size = parameter[GFX_ARG_BORDER_SIZE];
-
- /* this is only used for player "boring" and "sleeping" actions */
- if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE)
- g->anim_delay_fixed = parameter[GFX_ARG_ANIM_DELAY_FIXED];
- if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE)
- g->anim_delay_random = parameter[GFX_ARG_ANIM_DELAY_RANDOM];
- if (parameter[GFX_ARG_POST_DELAY_FIXED] != ARG_UNDEFINED_VALUE)
- g->post_delay_fixed = parameter[GFX_ARG_POST_DELAY_FIXED];
- if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE)
- g->post_delay_random = parameter[GFX_ARG_POST_DELAY_RANDOM];
-
- /* this is only used for toon animations */
- g->step_offset = parameter[GFX_ARG_STEP_OFFSET];
- g->step_delay = parameter[GFX_ARG_STEP_DELAY];
-
- /* this is only used for drawing font characters */
- g->draw_xoffset = parameter[GFX_ARG_DRAW_XOFFSET];
- g->draw_yoffset = parameter[GFX_ARG_DRAW_YOFFSET];
-
- /* this is only used for drawing envelope graphics */
- g->draw_masked = parameter[GFX_ARG_DRAW_MASKED];
-
- /* optional graphic for cloning all graphics settings */
- if (parameter[GFX_ARG_CLONE_FROM] != ARG_UNDEFINED_VALUE)
- g->clone_from = parameter[GFX_ARG_CLONE_FROM];
-
- /* optional settings for drawing title screens and title messages */
- if (parameter[GFX_ARG_FADE_MODE] != ARG_UNDEFINED_VALUE)
- g->fade_mode = parameter[GFX_ARG_FADE_MODE];
- if (parameter[GFX_ARG_FADE_DELAY] != ARG_UNDEFINED_VALUE)
- g->fade_delay = parameter[GFX_ARG_FADE_DELAY];
- if (parameter[GFX_ARG_POST_DELAY] != ARG_UNDEFINED_VALUE)
- g->post_delay = parameter[GFX_ARG_POST_DELAY];
- if (parameter[GFX_ARG_AUTO_DELAY] != ARG_UNDEFINED_VALUE)
- g->auto_delay = parameter[GFX_ARG_AUTO_DELAY];
- if (parameter[GFX_ARG_ALIGN] != ARG_UNDEFINED_VALUE)
- g->align = parameter[GFX_ARG_ALIGN];
- if (parameter[GFX_ARG_VALIGN] != ARG_UNDEFINED_VALUE)
- g->valign = parameter[GFX_ARG_VALIGN];
- if (parameter[GFX_ARG_SORT_PRIORITY] != ARG_UNDEFINED_VALUE)
- g->sort_priority = parameter[GFX_ARG_SORT_PRIORITY];
-
- if (parameter[GFX_ARG_CLASS] != ARG_UNDEFINED_VALUE)
- g->class = parameter[GFX_ARG_CLASS];
- if (parameter[GFX_ARG_STYLE] != ARG_UNDEFINED_VALUE)
- g->style = parameter[GFX_ARG_STYLE];
-}
-
-static void set_graphic_parameters(int graphic)
-{
-#if 1
- struct FileInfo *image = getImageListEntryFromImageID(graphic);
- char **parameter_raw = image->parameter;
- Bitmap *src_bitmap = getBitmapFromImageID(graphic);
- int parameter[NUM_GFX_ARGS];
- int i;
-
- /* if fallback to default artwork is done, also use the default parameters */
- if (image->fallback_to_default)
- parameter_raw = image->default_parameter;
-
- /* get integer values from string parameters */
- for (i = 0; i < NUM_GFX_ARGS; i++)
- parameter[i] = get_graphic_parameter_value(parameter_raw[i],
- image_config_suffix[i].token,
- image_config_suffix[i].type);
-
- set_graphic_parameters_ext(graphic, parameter, src_bitmap);
-
-#else
-
- struct FileInfo *image = getImageListEntryFromImageID(graphic);
- char **parameter_raw = image->parameter;
- Bitmap *src_bitmap = getBitmapFromImageID(graphic);
- int parameter[NUM_GFX_ARGS];
- int anim_frames_per_row = 1, anim_frames_per_col = 1;
- int anim_frames_per_line = 1;
- int i;
-
- /* if fallback to default artwork is done, also use the default parameters */
- if (image->fallback_to_default)
- parameter_raw = image->default_parameter;
-
- /* get integer values from string parameters */
- for (i = 0; i < NUM_GFX_ARGS; i++)
- parameter[i] = get_graphic_parameter_value(parameter_raw[i],
- image_config_suffix[i].token,
- image_config_suffix[i].type);
-
- graphic_info[graphic].bitmap = src_bitmap;
-
- /* always start with reliable default values */
- graphic_info[graphic].src_image_width = 0;
- graphic_info[graphic].src_image_height = 0;
- graphic_info[graphic].src_x = 0;
- graphic_info[graphic].src_y = 0;
- graphic_info[graphic].width = TILEX; /* default for element graphics */
- graphic_info[graphic].height = TILEY; /* default for element graphics */
- graphic_info[graphic].offset_x = 0; /* one or both of these values ... */
- graphic_info[graphic].offset_y = 0; /* ... will be corrected later */
- graphic_info[graphic].offset2_x = 0; /* one or both of these values ... */
- graphic_info[graphic].offset2_y = 0; /* ... will be corrected later */
- graphic_info[graphic].swap_double_tiles = -1; /* auto-detect tile swapping */
- graphic_info[graphic].crumbled_like = -1; /* do not use clone element */
- graphic_info[graphic].diggable_like = -1; /* do not use clone element */
- graphic_info[graphic].border_size = TILEX / 8; /* "CRUMBLED" border size */
- graphic_info[graphic].scale_up_factor = 1; /* default: no scaling up */
- graphic_info[graphic].clone_from = -1; /* do not use clone graphic */
- graphic_info[graphic].anim_delay_fixed = 0;
- graphic_info[graphic].anim_delay_random = 0;
- graphic_info[graphic].post_delay_fixed = 0;
- graphic_info[graphic].post_delay_random = 0;
- graphic_info[graphic].fade_mode = FADE_MODE_DEFAULT;
- graphic_info[graphic].fade_delay = -1;
- graphic_info[graphic].post_delay = -1;
- graphic_info[graphic].auto_delay = -1;
- graphic_info[graphic].align = ALIGN_CENTER; /* default for title screens */
- graphic_info[graphic].valign = VALIGN_MIDDLE; /* default for title screens */
- graphic_info[graphic].sort_priority = 0; /* default for title screens */
-
-#if 1
- /* optional zoom factor for scaling up the image to a larger size */
- if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE)
- graphic_info[graphic].scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR];
- if (graphic_info[graphic].scale_up_factor < 1)
- graphic_info[graphic].scale_up_factor = 1; /* no scaling */
-#endif
-
-#if 1
- if (graphic_info[graphic].use_image_size)
- {
- /* set new default bitmap size (with scaling, but without small images) */
- graphic_info[graphic].width = get_scaled_graphic_width(graphic);
- graphic_info[graphic].height = get_scaled_graphic_height(graphic);
- }
-#endif
-