return -1;
}
-static int get_scaled_graphic_width(int graphic)
+static int get_scaled_graphic_width(Bitmap *src_bitmap, int graphic)
{
int original_width = getOriginalImageWidthFromImageID(graphic);
int scale_up_factor = graphic_info[graphic].scale_up_factor;
+ // only happens when loaded outside artwork system (like "global.busy")
+ if (graphic_info == image_initial && src_bitmap)
+ original_width = src_bitmap->width;
+
return original_width * scale_up_factor;
}
-static int get_scaled_graphic_height(int graphic)
+static int get_scaled_graphic_height(Bitmap *src_bitmap, int graphic)
{
int original_height = getOriginalImageHeightFromImageID(graphic);
int scale_up_factor = graphic_info[graphic].scale_up_factor;
+ // only happens when loaded outside artwork system (like "global.busy")
+ if (graphic_info == image_initial && src_bitmap)
+ original_height = src_bitmap->height;
+
return original_height * scale_up_factor;
}
if (g->use_image_size)
{
// set new default bitmap size (with scaling, but without small images)
- g->width = get_scaled_graphic_width(graphic);
- g->height = get_scaled_graphic_height(graphic);
+ g->width = get_scaled_graphic_width(src_bitmap, graphic);
+ g->height = get_scaled_graphic_height(src_bitmap, graphic);
}
// optional width and height of each animation frame
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;
- }
+ int src_image_width = get_scaled_graphic_width(src_bitmap, graphic);
+ int src_image_height = get_scaled_graphic_height(src_bitmap, graphic);
if (parameter[GFX_ARG_TILE_SIZE] != ARG_UNDEFINED_VALUE)
{
static void InitGameInfo(void)
{
game.restart_level = FALSE;
- game.restart_game_message = NULL;
game.request_active = FALSE;
game.request_active_or_moving = FALSE;
InitGfxBuffers_EM();
InitGfxBuffers_SP();
+ InitGfxBuffers_MM();
}
static void InitGfx(void)
InitFontGraphicInfo();
- DrawProgramInfo();
-
- DrawInitTextHead("Loading graphics");
-
InitMenuDesignSettings_Static();
// initialize settings for initial images with default values
checked_free(filename_image_initial[i]);
}
+ for (i = 0; i < NUM_INITIAL_IMAGES; i++)
+ image_initial[i].use_image_size = TRUE;
+
graphic_info = image_initial; // graphic == 0 => image_initial
for (i = 0; i < NUM_INITIAL_IMAGES; i++)
ClearRectangleOnBackground(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
+ DrawProgramInfo();
+
InitGfxDrawBusyAnimFunction(DrawInitAnim);
InitGfxDrawGlobalAnimFunction(DrawGlobalAnimations);
InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);