When cloning graphic definitions using the ".clone_from" parameter in
custom graphics configurations, only the graphic parameters are cloned
(including bitmap pointers), but the position of the image file of the
cloned graphic does not change. This may lead to the wrong image being
scaled if the ".scale_up_factor" parameter is used to scale the cloned
graphic (which may cause further unintended side effects if the scaled
image was also used by other graphics definitions which do not intend
to scale this image).
This bug occurred when the game was started with the original Boulder
Dash graphics (used by a native Boulder Dash level set), followed by
selecting a level set which uses the classic default R'n'D graphics,
leading to broken (scaled up and truncated) fonts in the main menu.
{
struct GraphicInfo *g = &graphic_info[graphic];
+ // if graphic was cloned, scale cloned graphic
+ if (graphic_info[graphic].clone_from != -1)
+ graphic = graphic_info[graphic].clone_from;
+
// create small and game tile sized bitmaps (and scale up, if needed)
CreateImageWithSmallImages(graphic, g->scale_up_factor, g->tile_size);
}
{
struct GraphicInfo *g = &graphic_info[graphic];
+ // if graphic was cloned, scale cloned graphic
+ if (graphic_info[graphic].clone_from != -1)
+ graphic = graphic_info[graphic].clone_from;
+
ScaleImage(graphic, g->scale_up_factor);
}