From 986fbd06b9fecbb786632b24a61354fc8b60f0a8 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 20 Oct 2023 14:47:28 +0100 Subject: [PATCH] Self-review: G_SetPlayerGamepadIndicator - use skincolor's ramp directly instead of cacheing and then indexing an entire colormap --- src/g_input.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index e5f7a7c0a..86ceb1d61 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -208,7 +208,6 @@ void G_SetPlayerGamepadIndicatorToPlayerColor(INT32 player) { INT32 device; UINT16 skincolor; - UINT8 *colormap; byteColor_t byte_color; I_Assert(player >= 0 && player < MAXSPLITSCREENPLAYERS); @@ -229,16 +228,7 @@ void G_SetPlayerGamepadIndicatorToPlayerColor(INT32 player) skincolor = skins[skin].prefcolor; } - // We use TC_DEFAULT here rather than player skin because... - colormap = R_GetTranslationColormap(TC_DEFAULT, skincolor, GTC_MENUCACHE); - - if (colormap == NULL) - { - return; - } - - // ...we're grabbing the same index as a reference point across remaps! - byte_color = V_GetColor(colormap[104]).s; + byte_color = V_GetColor(skincolors[skincolor].ramp[8]).s; I_SetGamepadIndicatorColor(device, byte_color.red, byte_color.green, byte_color.blue); }