mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Self-review: G_SetPlayerGamepadIndicator - use skincolor's ramp directly instead of cacheing and then indexing an entire colormap
This commit is contained in:
parent
dc72602b00
commit
986fbd06b9
1 changed files with 1 additions and 11 deletions
|
|
@ -208,7 +208,6 @@ void G_SetPlayerGamepadIndicatorToPlayerColor(INT32 player)
|
||||||
{
|
{
|
||||||
INT32 device;
|
INT32 device;
|
||||||
UINT16 skincolor;
|
UINT16 skincolor;
|
||||||
UINT8 *colormap;
|
|
||||||
byteColor_t byte_color;
|
byteColor_t byte_color;
|
||||||
|
|
||||||
I_Assert(player >= 0 && player < MAXSPLITSCREENPLAYERS);
|
I_Assert(player >= 0 && player < MAXSPLITSCREENPLAYERS);
|
||||||
|
|
@ -229,16 +228,7 @@ void G_SetPlayerGamepadIndicatorToPlayerColor(INT32 player)
|
||||||
skincolor = skins[skin].prefcolor;
|
skincolor = skins[skin].prefcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use TC_DEFAULT here rather than player skin because...
|
byte_color = V_GetColor(skincolors[skincolor].ramp[8]).s;
|
||||||
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;
|
|
||||||
|
|
||||||
I_SetGamepadIndicatorColor(device, byte_color.red, byte_color.green, byte_color.blue);
|
I_SetGamepadIndicatorColor(device, byte_color.red, byte_color.green, byte_color.blue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue