InitElementSmallImagesScaledUp(special_graphics[i]);
}
+void InitScaledImages()
+{
+ int i;
+
+ /* scale normal images from static configuration, if not already scaled */
+ for (i = 0; i < NUM_IMAGE_FILES; i++)
+ ScaleImage(i, graphic_info[i].scale_up_factor);
+}
+
#if 1
/* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */
void SetBitmaps_EM(Bitmap **em_bitmap)
else
graphic_info[graphic].anim_frames = 1;
+ if (graphic_info[graphic].anim_frames == 0) /* frames must be at least 1 */
+ graphic_info[graphic].anim_frames = 1;
+
graphic_info[graphic].anim_frames_per_line =
(parameter[GFX_ARG_FRAMES_PER_LINE] != ARG_UNDEFINED_VALUE ?
parameter[GFX_ARG_FRAMES_PER_LINE] : anim_frames_per_line);
InitElementGraphicInfo(); /* element game graphic mapping */
InitElementSpecialGraphicInfo(); /* element special graphic mapping */
- InitElementSmallImages(); /* scale images to all needed sizes */
+ InitElementSmallImages(); /* scale elements to all needed sizes */
+ InitScaledImages(); /* scale all other images, if needed */
InitFontGraphicInfo(); /* initialize text drawing functions */
InitGraphicInfo_EM(); /* graphic mapping for EM engine */
-1
};
+ static int ep_obsolete[] =
+ {
+ EL_PLAYER_OBSOLETE,
+ EL_KEY_OBSOLETE,
+ EL_EM_KEY_1_FILE_OBSOLETE,
+ EL_EM_KEY_2_FILE_OBSOLETE,
+ EL_EM_KEY_3_FILE_OBSOLETE,
+ EL_EM_KEY_4_FILE_OBSOLETE,
+ EL_ENVELOPE_OBSOLETE,
+
+ -1
+ };
+
static struct
{
int *elements;
{ ep_editor_cascade_active, EP_EDITOR_CASCADE_ACTIVE },
{ ep_editor_cascade_inactive, EP_EDITOR_CASCADE_INACTIVE },
+ { ep_obsolete, EP_OBSOLETE },
+
{ NULL, -1 }
};
engine_version > VERSION_IDENT(2,0,1,0)));
}
+#if 0
/* set default push delay values (corrected since version 3.0.7-1) */
if (engine_version < VERSION_IDENT(3,0,7,1))
{
game.default_push_delay_fixed = 8;
game.default_push_delay_random = 8;
}
+#endif
+#if 0
/* set uninitialized push delay values of custom elements in older levels */
for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
if (element_info[element].push_delay_random == -1)
element_info[element].push_delay_random = game.default_push_delay_random;
}
+#endif
+#if 0
/* set some other uninitialized values of custom elements in older levels */
if (engine_version < VERSION_IDENT(3,1,0,0))
{
element_info[element].ignition_delay = 8;
}
}
+#endif
#if 0
/* set element properties that were handled incorrectly in older levels */
InitElementGraphicInfo();
}
+void InitElementPropertiesAfterLoading(int engine_version)
+{
+ int i;
+
+#if 0
+ /* set default push delay values (corrected since version 3.0.7-1) */
+ if (engine_version < VERSION_IDENT(3,0,7,1))
+ {
+ game.default_push_delay_fixed = 2;
+ game.default_push_delay_random = 8;
+ }
+ else
+ {
+ game.default_push_delay_fixed = 8;
+ game.default_push_delay_random = 8;
+ }
+#endif
+
+#if 0
+ /* set uninitialized push delay values of custom elements in older levels */
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ if (element_info[element].push_delay_fixed == -1)
+ element_info[element].push_delay_fixed = game.default_push_delay_fixed;
+ if (element_info[element].push_delay_random == -1)
+ element_info[element].push_delay_random = game.default_push_delay_random;
+ }
+#endif
+
+#if 1
+ /* set some other uninitialized values of custom elements in older levels */
+ if (engine_version < VERSION_IDENT(3,1,0,0))
+ {
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ element_info[element].access_direction = MV_ALL_DIRECTIONS;
+
+ element_info[element].explosion_delay = 17;
+ element_info[element].ignition_delay = 8;
+ }
+ }
+#endif
+}
+
static void InitGlobal()
{
int i;
if (filename_font_initial == NULL) /* should not happen */
Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_FONT_INITIAL);
- /* create additional image buffers for double-buffering */
+ /* create additional image buffers for double-buffering and cross-fading */
+ bitmap_db_title = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH);
bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
DrawInitText("Loading graphics:", 120, FC_GREEN);
}
+void RedrawBackground()
+{
+ BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
+ 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+
+ redraw_mask = REDRAW_ALL;
+}
+
void InitGfxBackground()
{
int x, y;
fieldbuffer = bitmap_db_field;
SetDrawtoField(DRAW_BACKBUFFER);
- BlitBitmap(graphic_info[IMG_GLOBAL_BORDER].bitmap, backbuffer,
- 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+ RedrawBackground();
+
ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
ClearRectangle(bitmap_db_door, 0, 0, 3 * DXSIZE, DYSIZE + VYSIZE);
if (redraw_screen)
{
+#if 1
+ RedrawBackground();
+#else
InitGfxBackground();
+#endif
/* force redraw of (open or closed) door graphics */
SetDoorState(DOOR_OPEN_ALL);