mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-26 04:41:09 +00:00
Merge branch 'moreskins' into 'next'
Convert SkinNums to UINT16 and raise skin limit to UINT16_MAX See merge request KartKrew/Kart-Public!350
This commit is contained in:
commit
90f03f4000
12 changed files with 38 additions and 35 deletions
|
@ -1649,7 +1649,7 @@ static void SV_SendPlayerInfo(INT32 node)
|
|||
|
||||
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
|
||||
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
|
||||
netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin;
|
||||
netbuffer->u.playerinfo[i].skin = (UINT16)players[i].skin;
|
||||
|
||||
// Extra data
|
||||
// Kart has extra skincolors, so we can't use this
|
||||
|
@ -1695,7 +1695,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||
|
||||
// we fill these structs with FFs so that any players not in game get sent as 0xFFFF
|
||||
// which is nice and easy for us to detect
|
||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||
memset(netbuffer->u.servercfg.playerskins, 0xFFFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
||||
|
||||
memset(netbuffer->u.servercfg.adminplayers, -1, sizeof(netbuffer->u.servercfg.adminplayers));
|
||||
|
@ -1707,7 +1707,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
|||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
netbuffer->u.servercfg.playerskins[i] = (UINT8)players[i].skin;
|
||||
netbuffer->u.servercfg.playerskins[i] = (UINT16)players[i].skin;
|
||||
netbuffer->u.servercfg.playercolor[i] = (UINT8)players[i].skincolor;
|
||||
}
|
||||
|
||||
|
@ -4800,7 +4800,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
memset(playeringame, 0, sizeof(playeringame));
|
||||
for (j = 0; j < MAXPLAYERS; j++)
|
||||
{
|
||||
if (netbuffer->u.servercfg.playerskins[j] == 0xFF
|
||||
if (netbuffer->u.servercfg.playerskins[j] == 0xFFFF
|
||||
&& netbuffer->u.servercfg.playercolor[j] == 0xFF)
|
||||
continue; // not in game
|
||||
|
||||
|
|
|
@ -322,8 +322,8 @@ typedef struct
|
|||
UINT8 clientnode;
|
||||
UINT8 gamestate;
|
||||
|
||||
// 0xFF == not in game; else player skin num
|
||||
UINT8 playerskins[MAXPLAYERS];
|
||||
// 0xFFFF == not in game; else player skin num
|
||||
UINT16 playerskins[MAXPLAYERS];
|
||||
UINT8 playercolor[MAXPLAYERS];
|
||||
|
||||
UINT8 gametype;
|
||||
|
@ -427,7 +427,7 @@ typedef struct
|
|||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
|
||||
UINT8 team;
|
||||
UINT8 skin;
|
||||
UINT16 skin;
|
||||
UINT8 data; // Color is first four bits, hasflag, isit and issuper have one bit each, the last is unused.
|
||||
UINT32 score;
|
||||
UINT16 timeinserver; // In seconds.
|
||||
|
@ -437,7 +437,7 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 skin;
|
||||
UINT16 skin;
|
||||
UINT8 color;
|
||||
UINT32 pflags;
|
||||
UINT32 score;
|
||||
|
|
|
@ -1472,7 +1472,7 @@ static void SendNameAndColor(void)
|
|||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin.value);
|
||||
WRITEUINT16(p, (UINT16)cv_skin.value);
|
||||
SendNetXCmd(XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ static void SendNameAndColor2(void)
|
|||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername2.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor2.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin2.value);
|
||||
WRITEUINT16(p, (UINT16)cv_skin2.value);
|
||||
SendNetXCmd2(XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
|
@ -1721,7 +1721,7 @@ static void SendNameAndColor3(void)
|
|||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername3.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor3.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin3.value);
|
||||
WRITEUINT16(p, (UINT16)cv_skin3.value);
|
||||
SendNetXCmd3(XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
|
@ -1849,7 +1849,7 @@ static void SendNameAndColor4(void)
|
|||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, cv_playername4.zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)cv_playercolor4.value);
|
||||
WRITEUINT8(p, (UINT8)cv_skin4.value);
|
||||
WRITEUINT16(p, (UINT16)cv_skin4.value);
|
||||
SendNetXCmd4(XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
|
@ -1857,7 +1857,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
{
|
||||
player_t *p = &players[playernum];
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 color, skin;
|
||||
UINT8 color;
|
||||
UINT16 skin;
|
||||
|
||||
#ifdef PARANOIA
|
||||
if (playernum < 0 || playernum > MAXPLAYERS)
|
||||
|
@ -1880,7 +1881,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
|
||||
READSTRINGN(*cp, name, MAXPLAYERNAME);
|
||||
color = READUINT8(*cp);
|
||||
skin = READUINT8(*cp);
|
||||
skin = READUINT16(*cp);
|
||||
|
||||
// set name
|
||||
if (player_name_changes[playernum] < MAXNAMECHANGES)
|
||||
|
|
|
@ -227,7 +227,7 @@ extern char logfilename[1024];
|
|||
// NOTE: it needs more than this to increase the number of players...
|
||||
|
||||
#define MAXPLAYERS 16
|
||||
#define MAXSKINS 255
|
||||
#define MAXSKINS UINT16_MAX
|
||||
#define PLAYERSMASK (MAXPLAYERS-1)
|
||||
#define MAXPLAYERNAME 21
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ gamestate_t gamestate = GS_NULL;
|
|||
UINT8 ultimatemode = false;
|
||||
|
||||
boolean botingame;
|
||||
UINT8 botskin;
|
||||
UINT16 botskin;
|
||||
UINT8 botcolor;
|
||||
|
||||
JoyType_t Joystick;
|
||||
|
|
|
@ -92,7 +92,8 @@ typedef struct menudemo_s {
|
|||
struct {
|
||||
UINT8 ranking;
|
||||
char name[17];
|
||||
UINT8 skin, color;
|
||||
UINT16 skin;
|
||||
UINT8 color;
|
||||
UINT32 timeorscore;
|
||||
} standings[MAXPLAYERS];
|
||||
} menudemo_t;
|
||||
|
|
|
@ -56,6 +56,7 @@ extern UINT8 ultimatemode; // was sk_insane
|
|||
extern gameaction_t gameaction;
|
||||
|
||||
extern boolean botingame;
|
||||
extern UINT8 botskin, botcolor;
|
||||
extern UINT16 botskin;
|
||||
extern UINT8 botcolor;
|
||||
|
||||
#endif //__G_STATE__
|
||||
|
|
|
@ -8169,7 +8169,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
|
|||
// am xpos & ypos are the icon's starting position. Withouht
|
||||
// it, they wouldn't 'spawn' on the top-right side of the HUD.
|
||||
|
||||
UINT8 skin = 0;
|
||||
UINT16 skin = 0;
|
||||
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
|
|
12
src/m_menu.c
12
src/m_menu.c
|
@ -3490,7 +3490,7 @@ void M_Ticker(void)
|
|||
//
|
||||
void M_Init(void)
|
||||
{
|
||||
UINT8 i;
|
||||
UINT16 i;
|
||||
|
||||
COM_AddCommand("manual", Command_Manual_f);
|
||||
|
||||
|
@ -3563,7 +3563,7 @@ void M_Init(void)
|
|||
|
||||
void M_InitCharacterTables(void)
|
||||
{
|
||||
UINT8 i;
|
||||
UINT16 i;
|
||||
|
||||
// Setup PlayerMenu table
|
||||
for (i = 0; i < MAXSKINS; i++)
|
||||
|
@ -9350,7 +9350,7 @@ Update the maxplayers label...
|
|||
#define iconwidth 32
|
||||
#define spacingwidth 32
|
||||
#define incrwidth (iconwidth + spacingwidth)
|
||||
UINT8 i = 0, pskin, pcol;
|
||||
UINT16 i = 0, pskin, pcol;
|
||||
// player arrangement width, but there's also a chance i'm a furry, shhhhhh
|
||||
const INT32 paw = iconwidth + 3*incrwidth;
|
||||
INT32 trans = 0;
|
||||
|
@ -9618,7 +9618,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
|||
UINT8 frame;
|
||||
UINT8 speed;
|
||||
UINT8 weight;
|
||||
UINT8 i;
|
||||
UINT16 i;
|
||||
const UINT8 *flashcol = V_GetStringColormap(highlightflags);
|
||||
INT32 statx, staty;
|
||||
|
||||
|
@ -9705,7 +9705,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
|||
{
|
||||
const INT32 colwidth = ((BASEVIDWIDTH-(2*mx))-charw)/(2*indexwidth);
|
||||
INT32 j = -colwidth;
|
||||
INT16 col = setupm_fakecolor - colwidth;
|
||||
INT32 col = setupm_fakecolor - colwidth;
|
||||
INT32 x = mx;
|
||||
INT32 w = indexwidth;
|
||||
UINT8 h;
|
||||
|
@ -9733,7 +9733,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
|||
{
|
||||
const INT32 icons = 4;
|
||||
INT32 k = -icons;
|
||||
INT16 col = setupm_fakeskin - icons;
|
||||
INT32 col = setupm_fakeskin - icons;
|
||||
INT32 x = BASEVIDWIDTH/2 - ((icons+1)*24) - 4;
|
||||
fixed_t scale = FRACUNIT/2;
|
||||
INT32 offx = 8, offy = 8;
|
||||
|
|
|
@ -225,8 +225,8 @@ typedef struct
|
|||
char levelname[32];
|
||||
UINT8 actnum;
|
||||
UINT8 skincolor;
|
||||
UINT8 skinnum;
|
||||
UINT8 botskin;
|
||||
UINT16 skinnum;
|
||||
UINT16 botskin;
|
||||
UINT8 botcolor;
|
||||
UINT8 numemeralds;
|
||||
INT32 lives;
|
||||
|
|
|
@ -68,7 +68,7 @@ static inline void P_ArchivePlayer(void)
|
|||
pllives = 3; // has less than that.
|
||||
|
||||
WRITEUINT8(save_p, player->skincolor);
|
||||
WRITEUINT8(save_p, player->skin);
|
||||
WRITEUINT16(save_p, player->skin);
|
||||
|
||||
WRITEUINT32(save_p, player->score);
|
||||
WRITEINT32(save_p, pllives);
|
||||
|
@ -76,7 +76,7 @@ static inline void P_ArchivePlayer(void)
|
|||
|
||||
if (botskin)
|
||||
{
|
||||
WRITEUINT8(save_p, botskin);
|
||||
WRITEUINT16(save_p, botskin);
|
||||
WRITEUINT8(save_p, botcolor);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static inline void P_ArchivePlayer(void)
|
|||
static inline void P_UnArchivePlayer(void)
|
||||
{
|
||||
savedata.skincolor = READUINT8(save_p);
|
||||
savedata.skin = READUINT8(save_p);
|
||||
savedata.skin = READUINT16(save_p);
|
||||
|
||||
savedata.score = READINT32(save_p);
|
||||
savedata.lives = READINT32(save_p);
|
||||
|
@ -95,7 +95,7 @@ static inline void P_UnArchivePlayer(void)
|
|||
|
||||
if (savedata.botcolor)
|
||||
{
|
||||
savedata.botskin = READUINT8(save_p);
|
||||
savedata.botskin = READUINT16(save_p);
|
||||
if (savedata.botskin-1 >= numskins)
|
||||
savedata.botskin = 0;
|
||||
savedata.botcolor = READUINT8(save_p);
|
||||
|
@ -1255,7 +1255,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
if (diff2 & MD2_CVMEM)
|
||||
WRITEINT32(save_p, mobj->cvmem);
|
||||
if (diff2 & MD2_SKIN)
|
||||
WRITEUINT8(save_p, (UINT8)((skin_t *)mobj->skin - skins));
|
||||
WRITEUINT16(save_p, (UINT16)((skin_t *)mobj->skin - skins));
|
||||
if (diff2 & MD2_COLOR)
|
||||
WRITEUINT8(save_p, mobj->color);
|
||||
if (diff2 & MD2_EXTVAL1)
|
||||
|
@ -2127,7 +2127,7 @@ static void LoadMobjThinker(actionf_p1 thinker)
|
|||
if (diff2 & MD2_CVMEM)
|
||||
mobj->cvmem = READINT32(save_p);
|
||||
if (diff2 & MD2_SKIN)
|
||||
mobj->skin = &skins[READUINT8(save_p)];
|
||||
mobj->skin = &skins[READUINT16(save_p)];
|
||||
if (diff2 & MD2_COLOR)
|
||||
mobj->color = READUINT8(save_p);
|
||||
if (diff2 & MD2_EXTVAL1)
|
||||
|
|
|
@ -31,8 +31,8 @@ mobj_t *P_FindNewPosition(UINT32 oldposition);
|
|||
typedef struct
|
||||
{
|
||||
UINT8 skincolor;
|
||||
UINT8 skin;
|
||||
UINT8 botskin;
|
||||
UINT16 skin;
|
||||
UINT16 botskin;
|
||||
UINT8 botcolor;
|
||||
INT32 score;
|
||||
INT32 lives;
|
||||
|
|
Loading…
Reference in a new issue