Clean up the skin_t struct

This commit is contained in:
wolfy852 2019-03-06 21:18:01 -06:00
parent 3873635629
commit 75661f44d7
4 changed files with 66 additions and 66 deletions

View File

@ -5113,17 +5113,17 @@ void G_GhostTicker(void)
INT32 type = -1; INT32 type = -1;
if (g->mo->skin) if (g->mo->skin)
{ {
skin_t *skin = (skin_t *)g->mo->skin; //skin_t *skin = (skin_t *)g->mo->skin;
switch (ziptic & EZT_THOKMASK) switch (ziptic & EZT_THOKMASK)
{ {
case EZT_THOK: case EZT_THOK:
type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; type = (UINT32)mobjinfo[MT_PLAYER].painchance; // skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
break; break;
case EZT_SPIN: case EZT_SPIN:
type = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; type = (UINT32)mobjinfo[MT_PLAYER].damage; // skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
break; break;
case EZT_REV: case EZT_REV:
type = skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; type = (UINT32)mobjinfo[MT_PLAYER].raisestate; // skin->revitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
break; break;
} }
} }

View File

@ -30,24 +30,24 @@ enum skin {
skin_facerank, skin_facerank,
skin_facewant, skin_facewant,
skin_facemmap, skin_facemmap,
skin_ability, /*skin_ability,
skin_ability2, skin_ability2,
skin_thokitem, skin_thokitem,
skin_spinitem, skin_spinitem,
skin_revitem, skin_revitem,
skin_actionspd, skin_actionspd,
skin_mindash, skin_mindash,
skin_maxdash, skin_maxdash,*/
// SRB2kart // SRB2kart
skin_kartspeed, skin_kartspeed,
skin_kartweight, skin_kartweight,
// //
skin_normalspeed, /*skin_normalspeed,
skin_runspeed, skin_runspeed,
skin_thrustfactor, skin_thrustfactor,
skin_accelstart, skin_accelstart,
skin_acceleration, skin_acceleration,
skin_jumpfactor, skin_jumpfactor,*/
skin_starttranscolor, skin_starttranscolor,
skin_prefcolor, skin_prefcolor,
skin_highresscale, skin_highresscale,
@ -64,24 +64,24 @@ static const char *const skin_opt[] = {
"facerank", "facerank",
"facewant", "facewant",
"facemmap", "facemmap",
"ability", /*"ability",
"ability2", "ability2",
"thokitem", "thokitem",
"spinitem", "spinitem",
"revitem", "revitem",
"actionspd", "actionspd",
"mindash", "mindash",
"maxdash", "maxdash",*/
// SRB2kart // SRB2kart
"kartspeed", "kartspeed",
"kartweight", "kartweight",
// //
"normalspeed", /*"normalspeed",
"runspeed", "runspeed",
"thrustfactor", "thrustfactor",
"accelstart", "accelstart",
"acceleration", "acceleration",
"jumpfactor", "jumpfactor",*/
"starttranscolor", "starttranscolor",
"prefcolor", "prefcolor",
"highresscale", "highresscale",
@ -139,7 +139,7 @@ static int skin_get(lua_State *L)
break; break;
lua_pushlstring(L, skin->facemmap, i); lua_pushlstring(L, skin->facemmap, i);
break; break;
case skin_ability: /*case skin_ability:
lua_pushinteger(L, skin->ability); lua_pushinteger(L, skin->ability);
break; break;
case skin_ability2: case skin_ability2:
@ -162,7 +162,7 @@ static int skin_get(lua_State *L)
break; break;
case skin_maxdash: case skin_maxdash:
lua_pushfixed(L, skin->maxdash); lua_pushfixed(L, skin->maxdash);
break; break;*/
// SRB2kart // SRB2kart
case skin_kartspeed: case skin_kartspeed:
lua_pushinteger(L, skin->kartspeed); lua_pushinteger(L, skin->kartspeed);
@ -171,7 +171,7 @@ static int skin_get(lua_State *L)
lua_pushinteger(L, skin->kartweight); lua_pushinteger(L, skin->kartweight);
break; break;
// //
case skin_normalspeed: /*case skin_normalspeed:
lua_pushfixed(L, skin->normalspeed); lua_pushfixed(L, skin->normalspeed);
break; break;
case skin_runspeed: case skin_runspeed:
@ -188,7 +188,7 @@ static int skin_get(lua_State *L)
break; break;
case skin_jumpfactor: case skin_jumpfactor:
lua_pushfixed(L, skin->jumpfactor); lua_pushfixed(L, skin->jumpfactor);
break; break;*/
case skin_starttranscolor: case skin_starttranscolor:
lua_pushinteger(L, skin->starttranscolor); lua_pushinteger(L, skin->starttranscolor);
break; break;

View File

@ -2537,22 +2537,22 @@ static void Sk_SetDefaultValue(skin_t *skin)
skin->kartweight = 5; skin->kartweight = 5;
// //
skin->normalspeed = 36<<FRACBITS; //skin->normalspeed = 36<<FRACBITS;
skin->runspeed = 28<<FRACBITS; //skin->runspeed = 28<<FRACBITS;
skin->thrustfactor = 5; //skin->thrustfactor = 5;
skin->accelstart = 96; //skin->accelstart = 96;
skin->acceleration = 40; //skin->acceleration = 40;
skin->ability = CA_NONE; //skin->ability = CA_NONE;
skin->ability2 = CA2_SPINDASH; //skin->ability2 = CA2_SPINDASH;
skin->jumpfactor = FRACUNIT; //skin->jumpfactor = FRACUNIT;
skin->actionspd = 30<<FRACBITS; //skin->actionspd = 30<<FRACBITS;
skin->mindash = 15<<FRACBITS; //skin->mindash = 15<<FRACBITS;
skin->maxdash = 90<<FRACBITS; //skin->maxdash = 90<<FRACBITS;
skin->thokitem = -1; //skin->thokitem = -1;
skin->spinitem = -1; //skin->spinitem = -1;
skin->revitem = -1; //skin->revitem = -1;
skin->highresscale = FRACUNIT>>1; skin->highresscale = FRACUNIT>>1;
@ -2596,19 +2596,19 @@ void R_InitSkins(void)
strncpy(skin->facemmap, "PLAYMMAP", 9); strncpy(skin->facemmap, "PLAYMMAP", 9);
skin->prefcolor = SKINCOLOR_BLUE; skin->prefcolor = SKINCOLOR_BLUE;
skin->ability = CA_THOK; //skin->ability = CA_THOK;
skin->actionspd = 60<<FRACBITS; //skin->actionspd = 60<<FRACBITS;
// SRB2kart // SRB2kart
skin->kartspeed = 8; skin->kartspeed = 8;
skin->kartweight = 2; skin->kartweight = 2;
// //
skin->normalspeed = 36<<FRACBITS; //skin->normalspeed = 36<<FRACBITS;
skin->runspeed = 28<<FRACBITS; //skin->runspeed = 28<<FRACBITS;
skin->thrustfactor = 5; //skin->thrustfactor = 5;
skin->accelstart = 96; //skin->accelstart = 96;
skin->acceleration = 40; //skin->acceleration = 40;
skin->spritedef.numframes = sprites[SPR_PLAY].numframes; skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes; skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
@ -2673,30 +2673,30 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
if (player->mo) if (player->mo)
player->mo->skin = skin; player->mo->skin = skin;
player->charability = (UINT8)skin->ability; //player->charability = (UINT8)skin->ability;
player->charability2 = (UINT8)skin->ability2; //player->charability2 = (UINT8)skin->ability2;
player->charflags = (UINT32)skin->flags; player->charflags = (UINT32)skin->flags;
player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; //player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem; //player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem; //player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
player->actionspd = skin->actionspd; //player->actionspd = skin->actionspd;
player->mindash = skin->mindash; //player->mindash = skin->mindash;
player->maxdash = skin->maxdash; //player->maxdash = skin->maxdash;
// SRB2kart // SRB2kart
player->kartspeed = skin->kartspeed; player->kartspeed = skin->kartspeed;
player->kartweight = skin->kartweight; player->kartweight = skin->kartweight;
player->normalspeed = skin->normalspeed; //player->normalspeed = skin->normalspeed;
player->runspeed = skin->runspeed; //player->runspeed = skin->runspeed;
player->thrustfactor = skin->thrustfactor; //player->thrustfactor = skin->thrustfactor;
player->accelstart = skin->accelstart; //player->accelstart = skin->accelstart;
player->acceleration = skin->acceleration; //player->acceleration = skin->acceleration;
player->jumpfactor = skin->jumpfactor; //player->jumpfactor = skin->jumpfactor;
/*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) /*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking))
{ {
@ -2906,7 +2906,7 @@ void R_AddSkins(UINT16 wadnum)
#define GETSPEED(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<<FRACBITS; #define GETSPEED(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<<FRACBITS;
//GETSPEED(normalspeed) //GETSPEED(normalspeed)
GETSPEED(runspeed) //GETSPEED(runspeed)
//GETSPEED(mindash) //GETSPEED(mindash)
//GETSPEED(maxdash) //GETSPEED(maxdash)
//GETSPEED(actionspd) //GETSPEED(actionspd)

View File

@ -83,28 +83,28 @@ typedef struct
char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long) char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long)
char facerank[9], facewant[9], facemmap[9]; // Arbitrarily named patch lumps char facerank[9], facewant[9], facemmap[9]; // Arbitrarily named patch lumps
UINT8 ability; // ability definition //UINT8 ability; // ability definition
UINT8 ability2; // secondary ability definition //UINT8 ability2; // secondary ability definition
INT32 thokitem; //INT32 thokitem;
INT32 spinitem; //INT32 spinitem;
INT32 revitem; //INT32 revitem;
fixed_t actionspd; //fixed_t actionspd;
fixed_t mindash; //fixed_t mindash;
fixed_t maxdash; //fixed_t maxdash;
// SRB2kart // SRB2kart
UINT8 kartspeed; UINT8 kartspeed;
UINT8 kartweight; UINT8 kartweight;
// //
fixed_t normalspeed; // Normal ground //fixed_t normalspeed; // Normal ground
fixed_t runspeed; // Speed that you break into your run animation //fixed_t runspeed; // Speed that you break into your run animation
UINT8 thrustfactor; // Thrust = thrustfactor * acceleration //UINT8 thrustfactor; // Thrust = thrustfactor * acceleration
UINT8 accelstart; // Acceleration if speed = 0 //UINT8 accelstart; // Acceleration if speed = 0
UINT8 acceleration; // Acceleration //UINT8 acceleration; // Acceleration
fixed_t jumpfactor; // multiple of standard jump height //fixed_t jumpfactor; // multiple of standard jump height
// Definable color translation table // Definable color translation table
UINT8 starttranscolor; UINT8 starttranscolor;