Commit b37c73b0 by James Hale

Make colors UINT16, increase color freeslots to 1024

parent 46191cad
......@@ -1495,7 +1495,7 @@ static boolean SV_SendServerConfig(INT32 node)
if (!playeringame[i])
continue;
netbuffer->u.servercfg.playerskins[i] = (UINT8)players[i].skin;
netbuffer->u.servercfg.playercolor[i] = (UINT8)players[i].skincolor;
netbuffer->u.servercfg.playercolor[i] = (UINT16)players[i].skincolor;
netbuffer->u.servercfg.playeravailabilities[i] = (UINT32)LONG(players[i].availabilities);
}
......@@ -3877,7 +3877,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
for (j = 0; j < MAXPLAYERS; j++)
{
if (netbuffer->u.servercfg.playerskins[j] == 0xFF
&& netbuffer->u.servercfg.playercolor[j] == 0xFF
&& netbuffer->u.servercfg.playercolor[j] == 0xFFFF
&& netbuffer->u.servercfg.playeravailabilities[j] == 0xFFFFFFFF)
continue; // not in game
......
......@@ -188,7 +188,7 @@ typedef struct
SINT8 xtralife;
SINT8 pity;
UINT8 skincolor;
UINT16 skincolor;
INT32 skin;
UINT32 availabilities;
// Just in case Lua does something like
......@@ -308,7 +308,7 @@ typedef struct
// 0xFF == not in game; else player skin num
UINT8 playerskins[MAXPLAYERS];
UINT8 playercolor[MAXPLAYERS];
UINT16 playercolor[MAXPLAYERS];
UINT32 playeravailabilities[MAXPLAYERS];
UINT8 gametype;
......@@ -414,7 +414,7 @@ typedef struct
{
char name[MAXPLAYERNAME+1];
UINT8 skin;
UINT8 color;
UINT16 color;
UINT32 pflags;
UINT32 score;
UINT8 ctfteam;
......
......@@ -225,7 +225,7 @@ consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL,
consvar_t cv_playername = {"name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playername2 = {"name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
// player colors
UINT8 lastgoodcolor = SKINCOLOR_BLUE, lastgoodcolor2 = SKINCOLOR_BLUE;
UINT16 lastgoodcolor = SKINCOLOR_BLUE, lastgoodcolor2 = SKINCOLOR_BLUE;
consvar_t cv_playercolor = {"color", "Blue", CV_CALL|CV_NOINIT, Color_cons_t, Color_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playercolor2 = {"color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t, Color2_OnChange, 0, NULL, NULL, 0, 0, NULL};
// player's skin, saved for commodity, when using a favorite skins wad..
......@@ -1285,7 +1285,7 @@ static void SendNameAndColor(void)
players[consoleplayer].skincolor = cv_playercolor.value % numskincolors;
if (players[consoleplayer].mo)
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
players[consoleplayer].mo->color = (UINT16)players[consoleplayer].skincolor;
}*/
}
else
......@@ -1323,7 +1323,7 @@ static void SendNameAndColor(void)
// Finally write out the complete packet and send it off.
WRITESTRINGN(p, cv_playername.zstring, MAXPLAYERNAME);
WRITEUINT32(p, (UINT32)players[consoleplayer].availabilities);
WRITEUINT8(p, (UINT8)cv_playercolor.value);
WRITEUINT16(p, (UINT16)cv_playercolor.value);
WRITEUINT8(p, (UINT8)cv_skin.value);
SendNetXCmd(XD_NAMEANDCOLOR, buf, p - buf);
}
......@@ -1439,7 +1439,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
{
player_t *p = &players[playernum];
char name[MAXPLAYERNAME+1];
UINT8 color, skin;
UINT16 color;
UINT8 skin;
#ifdef PARANOIA
if (playernum < 0 || playernum > MAXPLAYERS)
......@@ -1458,7 +1459,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
READSTRINGN(*cp, name, MAXPLAYERNAME);
p->availabilities = READUINT32(*cp);
color = READUINT8(*cp);
color = READUINT16(*cp);
skin = READUINT8(*cp);
// set name
......@@ -1468,7 +1469,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
// set color
p->skincolor = color % numskincolors;
if (p->mo)
p->mo->color = (UINT8)p->skincolor;
p->mo->color = (UINT16)p->skincolor;
// normal player colors
if (server && (p != &players[consoleplayer] && p != &players[secondarydisplayplayer]))
......
......@@ -366,7 +366,7 @@ typedef struct player_s
UINT16 flashpal;
// Player skin colorshift, 0-15 for which color to draw player.
UINT8 skincolor;
UINT16 skincolor;
INT32 skin;
UINT32 availabilities;
......
......@@ -452,7 +452,7 @@ static void readPlayer(MYFILE *f, INT32 num)
else if (fastcmp(word, "OPPOSITECOLOR") || fastcmp(word, "OPPOSITECOLOUR"))
{
SLOTFOUND
description[num].oppositecolor = (UINT8)get_number(word2);
description[num].oppositecolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "NAMETAG") || fastcmp(word, "TAGNAME"))
{
......@@ -462,12 +462,12 @@ static void readPlayer(MYFILE *f, INT32 num)
else if (fastcmp(word, "TAGTEXTCOLOR") || fastcmp(word, "TAGTEXTCOLOUR"))
{
SLOTFOUND
description[num].tagtextcolor = (UINT8)get_number(word2);
description[num].tagtextcolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "TAGOUTLINECOLOR") || fastcmp(word, "TAGOUTLINECOLOUR"))
{
SLOTFOUND
description[num].tagoutlinecolor = (UINT8)get_number(word2);
description[num].tagoutlinecolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "STATUS"))
{
......@@ -821,11 +821,11 @@ static void readskincolor(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "INVCOLOR"))
{
skincolors[num].invcolor = (UINT8)get_number(word2);
skincolors[num].invcolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "INVSHADE"))
{
skincolors[num].invshade = get_number(word2);
skincolors[num].invshade = get_number(word2)%COLORRAMPSIZE;
}
else if (fastcmp(word, "CHATCOLOR"))
{
......@@ -4043,19 +4043,19 @@ static void readmaincfg(MYFILE *f)
}
else if (fastcmp(word, "REDTEAM"))
{
skincolor_redteam = (UINT8)get_number(word2);
skincolor_redteam = (UINT16)get_number(word2);
}
else if (fastcmp(word, "BLUETEAM"))
{
skincolor_blueteam = (UINT8)get_number(word2);
skincolor_blueteam = (UINT16)get_number(word2);
}
else if (fastcmp(word, "REDRING"))
{
skincolor_redring = (UINT8)get_number(word2);
skincolor_redring = (UINT16)get_number(word2);
}
else if (fastcmp(word, "BLUERING"))
{
skincolor_bluering = (UINT8)get_number(word2);
skincolor_bluering = (UINT16)get_number(word2);
}
else if (fastcmp(word, "INVULNTICS"))
{
......
......@@ -241,12 +241,13 @@ extern char logfilename[1024];
#define COLORRAMPSIZE 16
#define MAXCOLORNAME 32
#define NUMCOLORFREESLOTS 1024
typedef struct skincolor_s
{
char name[MAXCOLORNAME+1]; // Skincolor name
UINT8 ramp[COLORRAMPSIZE]; // Colormap ramp
UINT8 invcolor; // Signpost color
UINT16 invcolor; // Signpost color
UINT8 invshade; // Signpost color shade
UINT16 chatcolor; // Chat color
boolean accessible; // Accessible by the color command + setup menu
......@@ -388,7 +389,7 @@ typedef enum
SKINCOLOR_SUPERTAN5,
SKINCOLOR_FIRSTFREESLOT,
SKINCOLOR_LASTFREESLOT = 255,
SKINCOLOR_LASTFREESLOT = SKINCOLOR_FIRSTFREESLOT + NUMCOLORFREESLOTS - 1,
MAXSKINCOLORS,
......@@ -397,7 +398,6 @@ typedef enum
UINT16 numskincolors;
#define NUMCOLORFREESLOTS (SKINCOLOR_LASTFREESLOT-SKINCOLOR_FIRSTFREESLOT)+1
extern skincolor_t skincolors[MAXSKINCOLORS];
// State updates, number of tics / second.
......
......@@ -145,7 +145,7 @@ extern INT32 tutorialanalog; // store cv_analog[0] user value
extern boolean looptitle;
// CTF colors.
extern UINT8 skincolor_redteam, skincolor_blueteam, skincolor_redring, skincolor_bluering;
extern UINT16 skincolor_redteam, skincolor_blueteam, skincolor_redring, skincolor_bluering;
extern tic_t countdowntimer;
extern boolean countdowntimeup;
......
......@@ -68,7 +68,7 @@ static struct {
UINT8 flags; // EZT flags
// EZT_COLOR
UINT8 color, lastcolor;
UINT16 color, lastcolor;
// EZT_SCALE
fixed_t scale, lastscale;
......@@ -82,7 +82,8 @@ static struct {
// There is no conflict here.
typedef struct demoghost {
UINT8 checksum[16];
UINT8 *buffer, *p, color, fadein;
UINT8 *buffer, *p, fadein;
UINT16 color;
UINT16 version;
mobj_t oldmo, *mo;
struct demoghost *next;
......@@ -93,7 +94,7 @@ demoghost *ghosts = NULL;
// DEMO RECORDING
//
#define DEMOVERSION 0x000c
#define DEMOVERSION 0x000d
#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F"
#define DF_GHOST 0x01 // This demo contains ghost data too!
......@@ -280,13 +281,13 @@ void G_GhostAddColor(ghostcolor_t color)
{
if (!demorecording || !(demoflags & DF_GHOST))
return;
if (ghostext.lastcolor == (UINT8)color)
if (ghostext.lastcolor == (UINT16)color)
{
ghostext.flags &= ~EZT_COLOR;
return;
}
ghostext.flags |= EZT_COLOR;
ghostext.color = (UINT8)color;
ghostext.color = (UINT16)color;
}
void G_GhostAddScale(fixed_t scale)
......@@ -425,7 +426,7 @@ void G_WriteGhostTic(mobj_t *ghost)
WRITEUINT8(demo_p,ghostext.flags);
if (ghostext.flags & EZT_COLOR)
{
WRITEUINT8(demo_p,ghostext.color);
WRITEUINT16(demo_p,ghostext.color);
ghostext.lastcolor = ghostext.color;
}
if (ghostext.flags & EZT_SCALE)
......@@ -501,7 +502,7 @@ void G_WriteGhostTic(mobj_t *ghost)
WRITEUINT8(demo_p,ghost->player->followmobj->sprite2);
WRITEUINT16(demo_p,ghost->player->followmobj->sprite);
WRITEUINT8(demo_p,(ghost->player->followmobj->frame & FF_FRAMEMASK));
WRITEUINT8(demo_p,ghost->player->followmobj->color);
WRITEUINT16(demo_p,ghost->player->followmobj->color);
*followtic_p = followtic;
}
......@@ -566,7 +567,7 @@ void G_ConsGhostTic(void)
{ // But wait, there's more!
UINT8 xziptic = READUINT8(demo_p);
if (xziptic & EZT_COLOR)
demo_p++;
demo_p += (demoversion==0x000c) ? 1 : sizeof(UINT16);
if (xziptic & EZT_SCALE)
demo_p += sizeof(fixed_t);
if (xziptic & EZT_HIT)
......@@ -633,7 +634,7 @@ void G_ConsGhostTic(void)
demo_p++;
demo_p += sizeof(UINT16);
demo_p++;
demo_p++;
demo_p += (demoversion==0x000c) ? 1 : sizeof(UINT16);
}
// Re-synchronise
......@@ -731,7 +732,7 @@ void G_GhostTicker(void)
xziptic = READUINT8(g->p);
if (xziptic & EZT_COLOR)
{
g->color = READUINT8(g->p);
g->color = (g->version==0x000c) ? READUINT8(g->p) : READUINT16(g->p);
switch(g->color)
{
default:
......@@ -864,7 +865,7 @@ void G_GhostTicker(void)
g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4);
break;
case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours
g->mo->color = (UINT16)(SKINCOLOR_RUBY + (leveltime % (FIRSTSUPERCOLOR - SKINCOLOR_RUBY))); // Passes through all saturated colours
break;
default:
break;
......@@ -918,7 +919,7 @@ void G_GhostTicker(void)
follow->sprite = READUINT16(g->p);
follow->frame = (READUINT8(g->p)) | (g->mo->frame & FF_TRANSMASK);
follow->angle = g->mo->angle;
follow->color = READUINT8(g->p);
follow->color = (g->version==0x000c) ? READUINT8(g->p) : READUINT16(g->p);
if (!(followtic & FZT_SPAWNED))
{
......@@ -1158,7 +1159,7 @@ void G_ReadMetalTic(mobj_t *metal)
follow->sprite = READUINT16(metal_p);
follow->frame = READUINT32(metal_p); // NOT & FF_FRAMEMASK here, so 32 bits
follow->angle = metal->angle;
follow->color = READUINT8(metal_p);
follow->color = (metalversion==0x000c) ? READUINT8(metal_p) : READUINT16(metal_p);
if (!(followtic & FZT_SPAWNED))
{
......@@ -1340,7 +1341,7 @@ void G_WriteMetalTic(mobj_t *metal)
WRITEUINT8(demo_p,metal->player->followmobj->sprite2);
WRITEUINT16(demo_p,metal->player->followmobj->sprite);
WRITEUINT32(demo_p,metal->player->followmobj->frame); // NOT & FF_FRAMEMASK here, so 32 bits
WRITEUINT8(demo_p,metal->player->followmobj->color);
WRITEUINT16(demo_p,metal->player->followmobj->color);
*followtic_p = followtic;
}
......@@ -1394,7 +1395,7 @@ void G_RecordMetal(void)
void G_BeginRecording(void)
{
UINT8 i;
char name[16];
char name[MAXCOLORNAME+1];
player_t *player = &players[consoleplayer];
if (demo_p)
......@@ -1457,12 +1458,12 @@ void G_BeginRecording(void)
demo_p += 16;
// Color
for (i = 0; i < 16 && cv_playercolor.string[i]; i++)
for (i = 0; i < MAXCOLORNAME && cv_playercolor.string[i]; i++)
name[i] = cv_playercolor.string[i];
for (; i < 16; i++)
for (; i < MAXCOLORNAME; i++)
name[i] = '\0';
M_Memcpy(demo_p,name,16);
demo_p += 16;
M_Memcpy(demo_p,name,MAXCOLORNAME);
demo_p += MAXCOLORNAME;
// Stats
WRITEUINT8(demo_p,player->charability);
......@@ -1622,7 +1623,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
c = READUINT8(p); // SUBVERSION
I_Assert(c == SUBVERSION);
s = READUINT16(p);
I_Assert(s == DEMOVERSION);
I_Assert(s >= 0x000c);
p += 16; // demo checksum
I_Assert(!memcmp(p, "PLAY", 4));
p += 4; // PLAY
......@@ -1671,6 +1672,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
switch(oldversion) // demoversion
{
case DEMOVERSION: // latest always supported
case 0x000c: // all that changed between then and now was longer color name
break;
// too old, cannot support.
default:
......@@ -1744,15 +1746,15 @@ void G_DoPlayDemo(char *defdemoname)
{
UINT8 i;
lumpnum_t l;
char skin[17],color[17],*n,*pdemoname;
UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration;
char skin[17],color[MAXCOLORNAME+1],*n,*pdemoname;
UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration,cnamelen;
pflags_t pflags;
UINT32 randseed, followitem;
fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight;
char msg[1024];
skin[16] = '\0';
color[16] = '\0';
color[MAXCOLORNAME] = '\0';
n = defdemoname+strlen(defdemoname);
while (*n != '/' && *n != '\\' && n != defdemoname)
......@@ -1810,6 +1812,11 @@ void G_DoPlayDemo(char *defdemoname)
switch(demoversion)
{
case DEMOVERSION: // latest always supported
cnamelen = MAXCOLORNAME;
break;
// all that changed between then and now was longer color name
case 0x000c:
cnamelen = 16;
break;
// too old, cannot support.
default:
......@@ -1876,8 +1883,8 @@ void G_DoPlayDemo(char *defdemoname)
demo_p += 16;
// Color
M_Memcpy(color,demo_p,16);
demo_p += 16;
M_Memcpy(color,demo_p,cnamelen);
demo_p += cnamelen;
charability = READUINT8(demo_p);
charability2 = READUINT8(demo_p);
......@@ -1941,7 +1948,9 @@ void G_DoPlayDemo(char *defdemoname)
// Set skin
SetPlayerSkin(0, skin);
#ifdef HAVE_BLUA
LUAh_MapChange(gamemap);
#endif
displayplayer = consoleplayer = 0;
memset(playeringame,0,sizeof(playeringame));
playeringame[0] = true;
......@@ -1949,8 +1958,9 @@ void G_DoPlayDemo(char *defdemoname)
G_InitNew(false, G_BuildMapName(gamemap), true, true, false);
// Set color
for (i = 0; i < MAXSKINCOLORS; i++)
if (!stricmp(Color_Names[i],color))
players[0].skincolor = skins[players[0].skin].prefcolor;
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name,color))
{
players[0].skincolor = i;
break;
......@@ -1992,7 +2002,8 @@ void G_AddGhost(char *defdemoname)
{
INT32 i;
lumpnum_t l;
char name[17],skin[17],color[17],*n,*pdemoname,md5[16];
char name[17],skin[17],color[MAXCOLORNAME+1],*n,*pdemoname,md5[16];
UINT8 cnamelen;
demoghost *gh;
UINT8 flags;
UINT8 *buffer,*p;
......@@ -2047,6 +2058,11 @@ void G_AddGhost(char *defdemoname)
switch(ghostversion)
{
case DEMOVERSION: // latest always supported
cnamelen = MAXCOLORNAME;
break;
// all that changed between then and now was longer color name
case 0x000c:
cnamelen = 16;
break;
// too old, cannot support.
default:
......@@ -2109,8 +2125,8 @@ void G_AddGhost(char *defdemoname)
p += 16;
// Color
M_Memcpy(color, p,16);
p += 16;
M_Memcpy(color, p,cnamelen);
p += cnamelen;
// Ghosts do not have a player structure to put this in.
p++; // charability
......@@ -2198,10 +2214,10 @@ void G_AddGhost(char *defdemoname)
// Set color
gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor;
for (i = 0; i < MAXSKINCOLORS; i++)
if (!stricmp(Color_Names[i],color))
for (i = 0; i < numskincolors; i++)
if (!stricmp(skincolors[i].name,color))
{
gh->mo->color = (UINT8)i;
gh->mo->color = (UINT16)i;
break;
}
gh->oldmo.color = gh->mo->color;
......@@ -2292,6 +2308,7 @@ void G_DoPlayMetal(void)
switch(metalversion)
{
case DEMOVERSION: // latest always supported
case 0x000c: // all that changed between then and now was longer color name
break;
// too old, cannot support.
default:
......
......@@ -54,7 +54,7 @@ UINT8 ultimatemode = false;
boolean botingame;
UINT8 botskin;
UINT8 botcolor;
UINT16 botcolor;
JoyType_t Joystick;
JoyType_t Joystick2;
......@@ -135,10 +135,10 @@ INT32 tutorialanalog = 0; // store cv_analog[0] user value
boolean looptitle = false;
UINT8 skincolor_redteam = SKINCOLOR_RED;
UINT8 skincolor_blueteam = SKINCOLOR_BLUE;
UINT8 skincolor_redring = SKINCOLOR_SALMON;
UINT8 skincolor_bluering = SKINCOLOR_CORNFLOWER;
UINT16 skincolor_redteam = SKINCOLOR_RED;
UINT16 skincolor_blueteam = SKINCOLOR_BLUE;
UINT16 skincolor_redring = SKINCOLOR_SALMON;
UINT16 skincolor_bluering = SKINCOLOR_CORNFLOWER;
tic_t countdowntimer = 0;
boolean countdowntimeup = false;
......@@ -2381,7 +2381,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
INT16 totalring;
UINT8 laps;
UINT8 mare;
UINT8 skincolor;
UINT16 skincolor;
INT32 skin;
UINT32 availabilities;
tic_t jointime;
......@@ -4475,7 +4475,7 @@ cleanup:
//
void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, boolean SSSG, boolean FLS)
{
UINT8 color = skins[pickedchar].prefcolor;
UINT16 color = skins[pickedchar].prefcolor;
paused = false;
if (demoplayback)
......
......@@ -57,6 +57,7 @@ extern UINT8 ultimatemode; // was sk_insane
extern gameaction_t gameaction;
extern boolean botingame;
extern UINT8 botskin, botcolor;
extern UINT8 botskin;
extern UINT16 botcolor;
#endif //__G_STATE__
......@@ -682,7 +682,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor;
UINT8 translation[16]; // First the color index
UINT16 translation[16]; // First the color index
UINT8 cutoff[16]; // Brightness cutoff before using the next color
UINT8 translen = 0;
UINT8 i;
......@@ -741,7 +741,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
numdupes = 1;
translen++;
translation[translen] = (UINT8)skincolors[color].ramp[i];
translation[translen] = (UINT16)skincolors[color].ramp[i];
}
translen++;
......
......@@ -2424,6 +2424,17 @@ static int lib_rGetColorByName(lua_State *L)
return 1;
}
// Lua exclusive function, returns the name of a color from the SKINCOLOR_ constant.
// SKINCOLOR_GREEN > "Green" for example
static int lib_rGetNameByColor(lua_State *L)
{
UINT16 colornum = (UINT16)luaL_checkinteger(L, 1);
if (!colornum || colornum >= numskincolors)
return luaL_error(L, "skincolor %d out of range (1 - %d).", colornum, numskincolors-1);
lua_pushstring(L, skincolors[colornum].name);
return 1;
}
// S_SOUND
////////////
static int lib_sStartSound(lua_State *L)
......@@ -3337,6 +3348,7 @@ static luaL_Reg lib[] = {
// r_draw
{"R_GetColorByName", lib_rGetColorByName},
{"R_GetNameByColor", lib_rGetNameByColor},
// s_sound
{"S_StartSound",lib_sStartSound},
......
......@@ -878,8 +878,8 @@ static int libd_drawNameTag(lua_State *L)
INT32 y;
const char *str;
INT32 flags;
UINT8 basecolor;
UINT8 outlinecolor;
UINT16 basecolor;
UINT16 outlinecolor;
UINT8 *basecolormap = NULL;
UINT8 *outlinecolormap = NULL;
......@@ -908,8 +908,8 @@ static int libd_drawScaledNameTag(lua_State *L)
const char *str;
INT32 flags;
fixed_t scale;
UINT8 basecolor;
UINT8 outlinecolor;
UINT16 basecolor;
UINT16 outlinecolor;
UINT8 *basecolormap = NULL;
UINT8 *outlinecolormap = NULL;
......
......@@ -1508,10 +1508,10 @@ static int lib_setSkinColor(lua_State *L)
{
UINT32 j;
skincolor_t *info;
UINT8 cnum; //skincolor num
UINT16 cnum; //skincolor num
lua_remove(L, 1); // don't care about skincolors[] userdata.
{
cnum = (UINT8)luaL_checkinteger(L, 1);
cnum = (UINT16)luaL_checkinteger(L, 1);
if (cnum < SKINCOLOR_FIRSTFREESLOT || cnum >= numskincolors)
return luaL_error(L, "skincolors[] index %d out of range (%d - %d)", cnum, SKINCOLOR_FIRSTFREESLOT, numskincolors-1);
info = &skincolors[cnum]; // get the skincolor to assign to.
......@@ -1551,9 +1551,9 @@ static int lib_setSkinColor(lua_State *L)
info->ramp[j] = (*((UINT8 **)luaL_checkudata(L, 3, META_COLORRAMP)))[j];
R_FlushTranslationColormapCache();
} else if (i == 3 || (str && fastcmp(str,"invcolor")))
info->invcolor = (UINT8)luaL_checkinteger(L, 3);
info->invcolor = (UINT16)luaL_checkinteger(L, 3);
else if (i == 4 || (str && fastcmp(str,"invshade")))
info->invshade = (UINT8)luaL_checkinteger(L, 3);
info->invshade = (UINT8)luaL_checkinteger(L, 3)%COLORRAMPSIZE;
else if (i == 5 || (str && fastcmp(str,"chatcolor")))
info->chatcolor = (UINT16)luaL_checkinteger(L, 3);
else if (i == 6 || (str && fastcmp(str,"accessible"))) {
......@@ -1631,9 +1631,9 @@ static int skincolor_set(lua_State *L)
info->ramp[i] = (*((UINT8 **)luaL_checkudata(L, 3, META_COLORRAMP)))[i];
R_FlushTranslationColormapCache();
} else if (fastcmp(field,"invcolor"))
info->invcolor = (UINT8)luaL_checkinteger(L, 3);
info->invcolor = (UINT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"invshade"))
info->invshade = (UINT8)luaL_checkinteger(L, 3);
info->invshade = (UINT8)luaL_checkinteger(L, 3)%COLORRAMPSIZE;
else if (fastcmp(field,"chatcolor"))
info->chatcolor = (UINT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"accessible"))
......
......@@ -175,7 +175,7 @@ static int lib_all7emeralds(lua_State *L)
// Returns both color and signpost shade numbers!
static int lib_coloropposite(lua_State *L)
{
UINT8 colornum = (UINT8)luaL_checkinteger(L, 1);
UINT16 colornum = (UINT16)luaL_checkinteger(L, 1);
if (!colornum || colornum >= numskincolors)
return luaL_error(L, "skincolor %d out of range (1 - %d).", colornum, numskincolors-1);
lua_pushinteger(L, skincolors[colornum].invcolor); // push color
......
......@@ -574,7 +574,7 @@ static int mobj_set(lua_State *L)
}
case mobj_color:
{
UINT8 newcolor = (UINT8)luaL_checkinteger(L,3);
UINT16 newcolor = (UINT16)luaL_checkinteger(L,3);
if (newcolor >= numskincolors)
return luaL_error(L, "mobj.color %d out of range (0 - %d).", newcolor, numskincolors-1);
mo->color = newcolor;
......
......@@ -461,7 +461,7 @@ static int player_set(lua_State *L)
plr->flashpal = (UINT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"skincolor"))
{
UINT8 newcolor = (UINT8)luaL_checkinteger(L,3);
UINT16 newcolor = (UINT16)luaL_checkinteger(L,3);
if (newcolor >= numskincolors)
return luaL_error(L, "player.skincolor %d out of range (0 - %d).", newcolor, numskincolors-1);
plr->skincolor = newcolor;
......
......@@ -978,7 +978,7 @@ static mobjflag2_t op_oldflags2 = 0;
static UINT32 op_oldeflags = 0;
static fixed_t op_oldmomx = 0, op_oldmomy = 0, op_oldmomz = 0, op_oldheight = 0;
static statenum_t op_oldstate = 0;
static UINT8 op_oldcolor = 0;
static UINT16 op_oldcolor = 0;
//
// Static calculation / common output help
......
......@@ -90,7 +90,7 @@ typedef struct
INT16 tag; ///< Tag of emblem mapthing
INT16 level; ///< Level on which this emblem can be found.
UINT8 sprite; ///< emblem sprite to use, 0 - 25
UINT8 color; ///< skincolor to use
UINT16 color; ///< skincolor to use
INT32 var; ///< If needed, specifies information on the target amount to achieve (or target skin)
char hint[110]; ///< Hint for emblem hints menu
UINT8 collected; ///< Do you have this emblem?
......@@ -102,7 +102,7 @@ typedef struct
UINT8 conditionset; ///< Condition set that awards this emblem.
UINT8 showconditionset; ///< Condition set that shows this emblem.
UINT8 sprite; ///< emblem sprite to use, 0 - 25
UINT8 color; ///< skincolor to use
UINT16 color; ///< skincolor to use
UINT8 collected; ///< Do you have this emblem?
} extraemblem_t;
......
......@@ -9055,7 +9055,7 @@ static void M_DrawSetupChoosePlayerMenu(void)
skin_t *charskin = &skins[0];
INT32 skinnum = 0;
UINT8 col;
UINT16 col;
UINT8 *colormap = NULL;
INT32 prev = -1, next = -1;
......@@ -9145,8 +9145,8 @@ static void M_DrawSetupChoosePlayerMenu(void)
INT32 ox, oxsh = FixedInt(FixedMul(BASEVIDWIDTH*FRACUNIT, FixedDiv(char_scroll, 128*FRACUNIT))), txsh;
patch_t *curpatch = NULL, *prevpatch = NULL, *nextpatch = NULL;
const char *curtext = NULL, *prevtext = NULL, *nexttext = NULL;
UINT8 curtextcolor = 0, prevtextcolor = 0, nexttextcolor = 0;
UINT8 curoutlinecolor = 0, prevoutlinecolor = 0, nextoutlinecolor = 0;
UINT16 curtextcolor = 0, prevtextcolor = 0, nexttextcolor = 0;
UINT16 curoutlinecolor = 0, prevoutlinecolor = 0, nextoutlinecolor = 0;