Merge branch 'dumb-stuff' into 'next'

Fix TC_DASHMODE not accessible to v.getColormap; add missing skin flags

See merge request STJr/SRB2!1273
This commit is contained in:
James R 2020-12-10 15:17:28 -05:00
commit 703631956b
4 changed files with 19 additions and 10 deletions

View file

@ -51,7 +51,7 @@ typedef enum
SF_NONIGHTSSUPER = 1<<15, // Disable super colors for NiGHTS (if you have SF_SUPER) SF_NONIGHTSSUPER = 1<<15, // Disable super colors for NiGHTS (if you have SF_SUPER)
SF_NOSUPERSPRITES = 1<<16, // Don't use super sprites while super SF_NOSUPERSPRITES = 1<<16, // Don't use super sprites while super
SF_NOSUPERJUMPBOOST = 1<<17, // Disable the jump boost given while super (i.e. Knuckles) SF_NOSUPERJUMPBOOST = 1<<17, // Disable the jump boost given while super (i.e. Knuckles)
SF_CANBUSTWALLS = 1<<18, // Can naturally bust walls on contact? (i.e. Knuckles) SF_CANBUSTWALLS = 1<<18, // Can naturally bust walls on contact? (i.e. Knuckles)
// free up to and including 1<<31 // free up to and including 1<<31
} skinflags_t; } skinflags_t;

View file

@ -896,8 +896,10 @@ static int libd_getColormap(lua_State *L)
else if (lua_type(L, 1) == LUA_TNUMBER) // skin number else if (lua_type(L, 1) == LUA_TNUMBER) // skin number
{ {
skinnum = (INT32)luaL_checkinteger(L, 1); skinnum = (INT32)luaL_checkinteger(L, 1);
if (skinnum < TC_BLINK || skinnum >= MAXSKINS) if (skinnum >= MAXSKINS)
return luaL_error(L, "skin number %d is out of range (%d - %d)", skinnum, TC_BLINK, MAXSKINS-1); 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 else // skin name
{ {

View file

@ -106,13 +106,17 @@ extern lumpnum_t viewborderlump[8];
#define GTC_CACHE 1 #define GTC_CACHE 1
#define TC_DEFAULT -1 enum
#define TC_BOSS -2 {
#define TC_METALSONIC -3 // For Metal Sonic battle TC_BOSS = INT8_MIN,
#define TC_ALLWHITE -4 // For Cy-Brak-demon TC_METALSONIC, // For Metal Sonic battle
#define TC_RAINBOW -5 // For single colour TC_ALLWHITE, // For Cy-Brak-demon
#define TC_BLINK -6 // For item blinking, according to kart TC_RAINBOW, // For single colour
#define TC_DASHMODE -7 // For Metal Sonic's dashmode TC_BLINK, // For item blinking, according to kart
TC_DASHMODE, // For Metal Sonic's dashmode
TC_DEFAULT
};
// Custom player skin translation // Custom player skin translation
// Initialize color translation tables, for player rendering etc. // Initialize color translation tables, for player rendering etc.

View file

@ -511,6 +511,9 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
GETFLAG(MULTIABILITY) GETFLAG(MULTIABILITY)
GETFLAG(NONIGHTSROTATION) GETFLAG(NONIGHTSROTATION)
GETFLAG(NONIGHTSSUPER) GETFLAG(NONIGHTSSUPER)
GETFLAG(NOSUPERSPRITES)
GETFLAG(NOSUPERJUMPBOOST)
GETFLAG(CANBUSTWALLS)
#undef GETFLAG #undef GETFLAG
else // let's check if it's a sound, otherwise error out else // let's check if it's a sound, otherwise error out