From 55c43a2161201ae4382565f3fd4616c0faddbca1 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 12 Sep 2018 07:24:22 -0400 Subject: [PATCH 1/2] R_AddColormap will not return an existing colormap, and new colormap is not added to chain --- src/r_data.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index 5a642f1b2..c8a648a0f 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1896,7 +1896,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3) // // R_AddColormaps() -// NOTE: The result colormap DOES get added to the extra_colormaps chain! +// NOTE: The result colormap is not added to the extra_colormaps chain. You must do that yourself! // extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend, boolean subR, boolean subG, boolean subB, boolean subA, @@ -1998,17 +1998,9 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex // put it together /////////////////// - if (!(exc = R_GetColormapFromList(exc_augend))) - { - exc_augend->colormap = lighttable ? R_CreateLightTable(exc_augend) : NULL; - R_AddColormapToList(exc_augend); - return exc_augend; - } - else - { - Z_Free(exc_augend); - return exc; - } + exc_augend->colormap = lighttable ? R_CreateLightTable(exc_augend) : NULL; + exc_augend->next = exc_augend->prev = NULL; + return exc_augend; } // Thanks to quake2 source! From 9a6a8b0b8255a34c6b85d31887cc2390a640c500 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 12 Sep 2018 08:07:34 -0400 Subject: [PATCH 2/2] Outdated comment; unused var --- src/p_setup.c | 3 --- src/r_data.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index edde5e701..c08c2ac58 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1459,9 +1459,6 @@ static void P_LoadRawSideDefs2(void *data) sd->sector = sec = §ors[sector_num]; } - // refined to allow colormaps to work as wall textures if invalid as colormaps - // but valid as textures. - sd->sector = sec = §ors[SHORT(msd->sector)]; // Colormaps! diff --git a/src/r_data.c b/src/r_data.c index c8a648a0f..c2e28fe9f 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1905,8 +1905,6 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha, boolean lighttable) { - extracolormap_t *exc; - // exc_augend is added (or subtracted) onto by exc_addend // In Rennaisance times, the first number was considered the augend, the second number the addend // But since the commutative property was discovered, today they're both called addends!