From 26111e8a6e3efa228a897f120f45776ad60f2d48 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 24 Nov 2023 00:21:38 +0100 Subject: [PATCH] fixed bug with loading artwork if only one special artwork set exists R'n'D supports using additional special artwork, like "ECS" and "AGA" graphics sets or "default" and "lowpass" sound sets, which can be selected from the game engines setup menu. This works fine if both artwork sets are defined (and also if no special artwork is defined). However, it did not work correctly if only one special artwork set was defined, in addition to the "standard" artwork set, like this: graphics_set: gfx_bond_mine_01 graphics_set.aga: gfx_bond_mine_01.aga In this case, it was not possible to use the "standard" graphics set, but only the "AGA" graphics set (because the "standard" graphics set was internally overridden by the "AGA" graphics set when selecting to use "AGA" graphics in the game engines setup menu, and selecting to use "ECS" graphics later could not recover this). (This bug could be seen in level set "emc_bond_mine_01" when starting the game with "AGA" graphics preferred in the setup menu, which resulted in not being able to select the "standard" graphics by setting graphics preference to "ECS" in the game engines setup menu.) This is fixed now (by internally setting the "ECS" artwork set, which is not explicitly defined, to the "standard" artwork before internally overriding it with either the "ECS" or "AGA" graphics set). This bug was caused by commit 4bc6719c. --- src/libgame/setup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libgame/setup.c b/src/libgame/setup.c index db49f467..493fc74e 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1713,12 +1713,26 @@ static boolean adjustTreeArtworkForEMC(char **artwork_set_1, char **artwork_set_2, char **artwork_set, boolean prefer_2) { + // do nothing if neither special artwork set 1 nor 2 are defined + if (!*artwork_set_1 && !*artwork_set_2) + return FALSE; + boolean want_1 = (prefer_2 == FALSE); boolean want_2 = (prefer_2 == TRUE); boolean has_only_1 = (!*artwork_set && !*artwork_set_2); boolean has_only_2 = (!*artwork_set && !*artwork_set_1); char *artwork_set_new = NULL; + // replace missing special artwork 1 or 2 with (optional) standard artwork + + if (!*artwork_set_1) + setString(artwork_set_1, *artwork_set); + + if (!*artwork_set_2) + setString(artwork_set_2, *artwork_set); + + // set standard artwork to either special artwork 1 or 2, as requested + if (*artwork_set_1 && (want_1 || has_only_1)) artwork_set_new = *artwork_set_1; -- 2.34.1