turn translation colormaps stuff into an enum

This commit is contained in:
Alug committed 2025-06-19 17:44:04 +02:00
1 parent 6317e9c510
commit 7ca6fa6772
2 files changed
+14 -8

No files matched your search

+4 -2
View File
@@ -1013,8 +1013,10 @@ static int libd_getColormap(lua_State *L)
else if (lua_type(L, 1) == LUA_TNUMBER) // skin number
{
skinnum = (INT32)luaL_checkinteger(L, 1);
if (skinnum < TC_BLINK || skinnum >= MAXSKINS)
return luaL_error(L, "skin number %d is out of range (%d - %d)", skinnum, TC_BLINK, MAXSKINS-1);
if (skinnum >= MAXSKINS)
return luaL_error(L, "skin number %d is out of range (>%d)", skinnum, MAXSKINS-1);
else if (skinnum < 0 && skinnum > TC_DEFAULT)
return luaL_error(L, "translation colormap index is out of range");
}
else // skin name
{
+10 -6
View File
@@ -179,12 +179,16 @@ extern lumpnum_t viewborderlump[8];
#define GTC_MENUCACHE GTC_CACHE
//@TODO Add a separate caching mechanism for menu colormaps distinct from in-level GTC_CACHE. For now this is still preferable to memory leaks...
#define TC_DEFAULT -1
#define TC_BOSS -2
#define TC_METALSONIC -3 // For Metal Sonic battle
#define TC_ALLWHITE -4 // For Cy-Brak-demon
#define TC_RAINBOW -5 // For invincibility power
#define TC_BLINK -6 // For item blinking
enum
{
TC_BOSS = INT8_MIN,
TC_METALSONIC, // For Metal Sonic battle
TC_ALLWHITE, // For Cy-Brak-demon
TC_RAINBOW, // For single colour
TC_BLINK, // For item blinking, according to kart
TC_DEFAULT
};
// Initialize color translation tables, for player rendering etc.
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags);