From: Holger Schemel Date: Sat, 29 May 2021 09:25:39 +0000 (+0200) Subject: added marking all images from non-default graphics directory as "redefined" X-Git-Tag: 4.3.0.0~145 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=6d4b6a4bebf4a5b6f759aaf032d3ce2e5f82385f;p=rocksndiamonds.git added marking all images from non-default graphics directory as "redefined" This change is required for the case of custom graphics sets that replace graphics by simply adding an image file with the same filename as the default graphics, like "RocksElements.png", but without adding changed graphics definitions in a "graphicsinfo.conf" config file. This caused the new (custom) image file to be loaded instead of the default image file, but did not mark the affected game graphics in the custom image file to be "redefined" so far (which is required to invalidate related action or direction graphics loaded from other image files, which are now overridden by the new base graphics). This change marks all graphics in such images files as "redefined". --- diff --git a/src/libgame/misc.c b/src/libgame/misc.c index ff64284e..36e576bc 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -3769,6 +3769,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, char *basename = file_list_entry->filename; char *filename = getCustomArtworkFilename(basename, artwork_info->type); + // mark all images from non-default graphics directory as "redefined" + if (artwork_info->type == ARTWORK_TYPE_GRAPHICS && + !strPrefix(filename, options.graphics_directory)) + file_list_entry->redefined = TRUE; + if (filename == NULL) { Warn("cannot find artwork file '%s'", basename);