Merge branch 'master' into pet-robo

This commit is contained in:
Sally Coolatta 2020-05-18 15:18:37 -04:00
commit 0282615c38
43 changed files with 1152 additions and 907 deletions

View file

@ -164,6 +164,7 @@ set(SRB2_CORE_GAME_SOURCES
k_pathfind.c
k_pwrlv.c
k_waypoint.c
k_color.c
k_bot.c
p_local.h
@ -183,6 +184,7 @@ set(SRB2_CORE_GAME_SOURCES
k_pathfind.h
k_pwrlv.h
k_waypoint.h
k_color.h
k_bot.h
)

View file

@ -507,6 +507,7 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/st_stuff.o \
$(OBJDIR)/k_kart.o \
$(OBJDIR)/k_collide.o\
$(OBJDIR)/k_color.o \
$(OBJDIR)/k_battle.o \
$(OBJDIR)/k_pwrlv.o \
$(OBJDIR)/k_waypoint.o\

View file

@ -547,10 +547,7 @@ static void COM_ExecuteString(char *ptext)
if (!stricmp(com_argv[0], a->name))
{
if (recursion > MAX_ALIAS_RECURSION)
{
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
recursion = 0;
}
else
{
char buf[1024];
@ -582,8 +579,10 @@ static void COM_ExecuteString(char *ptext)
}
WRITESTRING(write, read);
// Monster Iestyn: keep track of how many levels of recursion we're in
recursion++;
COM_BufInsertText(buf);
recursion--;
}
return;
}

View file

@ -2491,6 +2491,7 @@ static void Command_ClearBans(void)
return;
I_ClearBans();
D_SaveBan();
reasontail = NULL;
while (reasonhead)
{

View file

@ -50,6 +50,7 @@
#include "k_battle.h"
#include "k_pwrlv.h"
#include "y_inter.h"
#include "k_color.h"
#ifdef NETGAME_DEVMODE
#define CV_RESTRICT CV_NETVAR

View file

@ -512,6 +512,7 @@ typedef struct player_s
UINT8 gotcontinue; // Got continue from this stage?
fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values)
fixed_t lastspeed;
UINT8 jumping; // Jump counter
UINT8 secondjump;

View file

@ -1164,6 +1164,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
}*/
else if (fastcmp(word, "MOBJSCALE"))
mapheaderinfo[num-1]->mobj_scale = get_number(word2);
else if (fastcmp(word, "DEFAULTWAYPOINTRADIUS"))
mapheaderinfo[num-1]->default_waypoint_radius = get_number(word2);
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
else if (fastcmp(word, "SCRIPTISFILE"))
@ -3755,88 +3757,52 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_THOK",
// SRB2kart Frames
"S_KART_STND1",
"S_KART_STND2",
"S_KART_STND1_L",
"S_KART_STND2_L",
"S_KART_STND1_R",
"S_KART_STND2_R",
"S_KART_WALK1",
"S_KART_WALK2",
"S_KART_WALK1_L",
"S_KART_WALK2_L",
"S_KART_WALK1_R",
"S_KART_WALK2_R",
"S_KART_RUN1",
"S_KART_RUN2",
"S_KART_RUN1_L",
"S_KART_RUN2_L",
"S_KART_RUN1_R",
"S_KART_RUN2_R",
"S_KART_STILL1",
"S_KART_STILL2",
"S_KART_STILL1_L",
"S_KART_STILL2_L",
"S_KART_STILL1_R",
"S_KART_STILL2_R",
"S_KART_SLOW1",
"S_KART_SLOW2",
"S_KART_SLOW1_L",
"S_KART_SLOW2_L",
"S_KART_SLOW1_R",
"S_KART_SLOW2_R",
"S_KART_FAST1",
"S_KART_FAST2",
"S_KART_FAST1_L",
"S_KART_FAST2_L",
"S_KART_FAST1_R",
"S_KART_FAST2_R",
"S_KART_DRIFT1_L",
"S_KART_DRIFT2_L",
"S_KART_DRIFT1_L_OUT",
"S_KART_DRIFT2_L_OUT",
"S_KART_DRIFT1_L_IN",
"S_KART_DRIFT2_L_IN",
"S_KART_DRIFT3_L_IN",
"S_KART_DRIFT4_L_IN",
"S_KART_DRIFT1_R",
"S_KART_DRIFT2_R",
"S_KART_DRIFT1_R_OUT",
"S_KART_DRIFT2_R_OUT",
"S_KART_DRIFT1_R_IN",
"S_KART_DRIFT2_R_IN",
"S_KART_DRIFT3_R_IN",
"S_KART_DRIFT4_R_IN",
"S_KART_SPIN",
"S_KART_PAIN",
"S_KART_SQUISH",
/*
"S_PLAY_STND",
"S_PLAY_TAP1",
"S_PLAY_TAP2",
"S_PLAY_RUN1",
"S_PLAY_RUN2",
"S_PLAY_RUN3",
"S_PLAY_RUN4",
"S_PLAY_RUN5",
"S_PLAY_RUN6",
"S_PLAY_RUN7",
"S_PLAY_RUN8",
"S_PLAY_SPD1",
"S_PLAY_SPD2",
"S_PLAY_SPD3",
"S_PLAY_SPD4",
"S_PLAY_ATK1",
"S_PLAY_ATK2",
"S_PLAY_ATK3",
"S_PLAY_ATK4",
"S_PLAY_SPRING",
"S_PLAY_FALL1",
"S_PLAY_FALL2",
"S_PLAY_ABL1",
"S_PLAY_ABL2",
"S_PLAY_SPC1",
"S_PLAY_SPC2",
"S_PLAY_SPC3",
"S_PLAY_SPC4",
"S_PLAY_CLIMB1",
"S_PLAY_CLIMB2",
"S_PLAY_CLIMB3",
"S_PLAY_CLIMB4",
"S_PLAY_CLIMB5",
"S_PLAY_GASP",
"S_PLAY_PAIN",
"S_PLAY_DIE",
"S_PLAY_TEETER1",
"S_PLAY_TEETER2",
"S_PLAY_CARRY",
"S_PLAY_SUPERSTAND",
"S_PLAY_SUPERWALK1",
"S_PLAY_SUPERWALK2",
"S_PLAY_SUPERFLY1",
"S_PLAY_SUPERFLY2",
"S_PLAY_SUPERTEETER",
"S_PLAY_SUPERHIT",
"S_PLAY_SUPERTRANS1",
"S_PLAY_SUPERTRANS2",
"S_PLAY_SUPERTRANS3",
"S_PLAY_SUPERTRANS4",
"S_PLAY_SUPERTRANS5",
"S_PLAY_SUPERTRANS6",
"S_PLAY_SUPERTRANS7",
"S_PLAY_SUPERTRANS8",
"S_PLAY_SUPERTRANS9", // This has special significance in the code. If you add more frames, search for it and make the appropriate changes.
*/
// technically the player goes here but it's an infinite tic state
"S_OBJPLACE_DUMMY",
@ -8149,6 +8115,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"GREY", // SKINCOLOR_GREY
"NICKEL", // SKINCOLOR_NICKEL
"BLACK", // SKINCOLOR_BLACK
"SKUNK", // SKINCOLOR_SKUNK
"FAIRY", // SKINCOLOR_FAIRY
"POPCORN", // SKINCOLOR_POPCORN
"ARTICHOKE", // SKINCOLOR_ARTICHOKE
@ -8159,7 +8126,6 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"PEACH", // SKINCOLOR_PEACH
"BROWN", // SKINCOLOR_BROWN
"LEATHER", // SKINCOLOR_LEATHER
"SALMON", // SKINCOLOR_SALMON
"PINK", // SKINCOLOR_PINK
"ROSE", // SKINCOLOR_ROSE
"CINNAMON", // SKINCOLOR_CINNAMON
@ -8197,7 +8163,6 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"PISTACHIO", // SKINCOLOR_PISTACHIO
"MOSS", // SKINCOLOR_MOSS
"CAMOUFLAGE", // SKINCOLOR_CAMOUFLAGE
"ROBOHOOD", // SKINCOLOR_ROBOHOOD
"MINT", // SKINCOLOR_MINT
"GREEN", // SKINCOLOR_GREEN
"PINETREE", // SKINCOLOR_PINETREE
@ -8207,11 +8172,10 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"PLAGUE", // SKINCOLOR_PLAGUE
"EMERALD", // SKINCOLOR_EMERALD
"ALGAE", // SKINCOLOR_ALGAE
"CARIBBEAN", // SKINCOLOR_CARIBBEAN
"AZURE", // SKINCOLOR_AZURE
"AQUAMARINE", // SKINCOLOR_AQUAMARINE
"TURQUOISE", // SKINCOLOR_TURQUOISE
"TEAL", // SKINCOLOR_TEAL
"ROBIN", // SKINCOLOR_ROBIN
"CYAN", // SKINCOLOR_CYAN
"JAWZ", // SKINCOLOR_JAWZ
"CERULEAN", // SKINCOLOR_CERULEAN
@ -8228,6 +8192,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"ULTRAMARINE", // SKINCOLOR_ULTRAMARINE
"PERIWINKLE", // SKINCOLOR_PERIWINKLE
"BLUE", // SKINCOLOR_BLUE
"MIDNIGHT", // SKINCOLOR_MIDNIGHT
"BLUEBERRY", // SKINCOLOR_BLUEBERRY
"THISTLE", // SKINCOLOR_THISTLE
"PURPLE", // SKINCOLOR_PURPLE
@ -8243,6 +8208,7 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
"BYZANTIUM", // SKINCOLOR_BYZANTIUM
"POMEGRANATE", // SKINCOLOR_POMEGRANATE
"LILAC", // SKINCOLOR_LILAC
"BLOSSOM", // SKINCOLOR_BLOSSOM
"TAFFY", // SKINCOLOR_TAFFY
// Special super colors

View file

@ -262,6 +262,7 @@ typedef enum
SKINCOLOR_GREY,
SKINCOLOR_NICKEL,
SKINCOLOR_BLACK,
SKINCOLOR_SKUNK,
SKINCOLOR_FAIRY,
SKINCOLOR_POPCORN,
SKINCOLOR_ARTICHOKE,
@ -272,7 +273,6 @@ typedef enum
SKINCOLOR_PEACH,
SKINCOLOR_BROWN,
SKINCOLOR_LEATHER,
SKINCOLOR_SALMON,
SKINCOLOR_PINK,
SKINCOLOR_ROSE,
SKINCOLOR_CINNAMON,
@ -310,7 +310,6 @@ typedef enum
SKINCOLOR_PISTACHIO,
SKINCOLOR_MOSS,
SKINCOLOR_CAMOUFLAGE,
SKINCOLOR_ROBOHOOD,
SKINCOLOR_MINT,
SKINCOLOR_GREEN,
SKINCOLOR_PINETREE,
@ -320,11 +319,10 @@ typedef enum
SKINCOLOR_PLAGUE,
SKINCOLOR_EMERALD,
SKINCOLOR_ALGAE,
SKINCOLOR_CARIBBEAN,
SKINCOLOR_AZURE,
SKINCOLOR_AQUAMARINE,
SKINCOLOR_TURQUOISE,
SKINCOLOR_TEAL,
SKINCOLOR_ROBIN,
SKINCOLOR_CYAN,
SKINCOLOR_JAWZ, // Oni's torment
SKINCOLOR_CERULEAN,
@ -341,6 +339,7 @@ typedef enum
SKINCOLOR_ULTRAMARINE,
SKINCOLOR_PERIWINKLE,
SKINCOLOR_BLUE,
SKINCOLOR_MIDNIGHT,
SKINCOLOR_BLUEBERRY,
SKINCOLOR_THISTLE,
SKINCOLOR_PURPLE,
@ -356,6 +355,7 @@ typedef enum
SKINCOLOR_BYZANTIUM,
SKINCOLOR_POMEGRANATE,
SKINCOLOR_LILAC,
SKINCOLOR_BLOSSOM,
SKINCOLOR_TAFFY,
// "Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now."

View file

@ -290,6 +290,7 @@ typedef struct
// SRB2kart
//boolean automap; ///< Displays a level's white map outline in modified games
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
fixed_t default_waypoint_radius; ///< 0 is a special value for DEFAULT_WAYPOINT_RADIUS, but scaled with mobjscale
// Music stuff.
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds

View file

@ -52,6 +52,7 @@
#include "k_kart.h" // SRB2kart
#include "k_battle.h"
#include "k_pwrlv.h"
#include "k_color.h"
gameaction_t gameaction;
gamestate_t gamestate = GS_NULL;
@ -7627,7 +7628,7 @@ void G_AddGhost(char *defdemoname)
}
gh->mo->z = z;
}
gh->mo->state = states+S_KART_STND1; // SRB2kart - was S_PLAY_STND
gh->mo->state = states+S_KART_STILL1; // SRB2kart - was S_PLAY_STND
gh->mo->sprite = gh->mo->state->sprite;
gh->mo->frame = (gh->mo->state->frame & FF_FRAMEMASK) | tr_trans20<<FF_TRANSSHIFT;
gh->mo->tics = -1;

View file

@ -2831,6 +2831,10 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v
static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
{
const fixed_t thingxpos = thing->x + thing->sprxoff;
const fixed_t thingypos = thing->y + thing->spryoff;
const fixed_t thingzpos = thing->z + thing->sprzoff;
GLPatch_t *gpatch;
FOutVector shadowVerts[4];
FSurfaceInfo sSurf;
@ -2848,7 +2852,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
pslope_t *floorslope;
floorz = R_GetShadowZ(thing, &floorslope);
floordiff = abs(thing->z - floorz);
floordiff = abs(thingzpos - floorz);
alpha = floordiff / (4*FRACUNIT) + 75;
if (alpha >= 255) return;
@ -2872,8 +2876,8 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
fscale = FIXED_TO_FLOAT(scalemul);
fx = FIXED_TO_FLOAT(thing->x);
fy = FIXED_TO_FLOAT(thing->y);
fx = FIXED_TO_FLOAT(thingxpos);
fy = FIXED_TO_FLOAT(thingypos);
// 3--2
// | /|
@ -4096,6 +4100,10 @@ void HWR_AddSprites(sector_t *sec)
// BP why not use xtoviexangle/viewangletox like in bsp ?....
void HWR_ProjectSprite(mobj_t *thing)
{
const fixed_t thingxpos = thing->x + thing->sprxoff;
const fixed_t thingypos = thing->y + thing->spryoff;
const fixed_t thingzpos = thing->z + thing->sprzoff;
gr_vissprite_t *vis;
float tr_x, tr_y;
float tz;
@ -4120,8 +4128,8 @@ void HWR_ProjectSprite(mobj_t *thing)
this_scale = FIXED_TO_FLOAT(thing->scale);
// transform the origin point
tr_x = FIXED_TO_FLOAT(thing->x) - gr_viewx;
tr_y = FIXED_TO_FLOAT(thing->y) - gr_viewy;
tr_x = FIXED_TO_FLOAT(thingxpos) - gr_viewx;
tr_y = FIXED_TO_FLOAT(thingypos) - gr_viewy;
// rotation around vertical axis
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
@ -4131,8 +4139,8 @@ void HWR_ProjectSprite(mobj_t *thing)
return;
// The above can stay as it works for cutting sprites that are too close
tr_x = FIXED_TO_FLOAT(thing->x);
tr_y = FIXED_TO_FLOAT(thing->y);
tr_x = FIXED_TO_FLOAT(thingxpos);
tr_y = FIXED_TO_FLOAT(thingypos);
// decide which patch to use for sprite relative to player
#ifdef RANGECHECK
@ -4168,9 +4176,9 @@ void HWR_ProjectSprite(mobj_t *thing)
#endif
if (thing->player)
ang = R_PointToAngle (thing->x, thing->y) - thing->player->frameangle;
ang = R_PointToAngle (thingxpos, thingypos) - thing->player->frameangle;
else
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
ang = R_PointToAngle (thingxpos, thingypos) - thing->angle;
if (sprframe->rotate == SRF_SINGLE)
{
@ -4242,12 +4250,12 @@ void HWR_ProjectSprite(mobj_t *thing)
if (vflip)
{
gz = FIXED_TO_FLOAT(thing->z+thing->height) - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale;
gz = FIXED_TO_FLOAT(thingzpos + thing->height) - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale;
gzt = gz + FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height) * this_scale;
}
else
{
gzt = FIXED_TO_FLOAT(thing->z) + FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale;
gzt = FIXED_TO_FLOAT(thingzpos) + FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale;
gz = gzt - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height) * this_scale;
}
@ -4266,12 +4274,12 @@ void HWR_ProjectSprite(mobj_t *thing)
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
{
if (gr_viewz < FIXED_TO_FLOAT(sectors[phs].floorheight) ?
FIXED_TO_FLOAT(thing->z) >= FIXED_TO_FLOAT(sectors[heightsec].floorheight) :
FIXED_TO_FLOAT(thingzpos) >= FIXED_TO_FLOAT(sectors[heightsec].floorheight) :
gzt < FIXED_TO_FLOAT(sectors[heightsec].floorheight))
return;
if (gr_viewz > FIXED_TO_FLOAT(sectors[phs].ceilingheight) ?
gzt < FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) && gr_viewz >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight) :
FIXED_TO_FLOAT(thing->z) >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight))
FIXED_TO_FLOAT(thingzpos) >= FIXED_TO_FLOAT(sectors[heightsec].ceilingheight))
return;
}

View file

@ -37,7 +37,7 @@
#include "../r_things.h"
#include "../r_draw.h"
#include "../p_tick.h"
#include "../k_kart.h" // colortranslations
#include "../k_color.h" // colortranslations
#include "hw_model.h"
#include "hw_main.h"
@ -652,15 +652,6 @@ spritemd2found:
fclose(f);
}
// Define for getting accurate color brightness readings according to how the human eye sees them.
// https://en.wikipedia.org/wiki/Relative_luminance
// 0.2126 to red
// 0.7152 to green
// 0.0722 to blue
// (See this same define in hw_md2.c!)
#define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color)
{
UINT16 w = gpatch->width, h = gpatch->height;
@ -748,7 +739,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
for (i = 0; i < translen; i++) // moved from inside the loop to here
{
RGBA_t tempc = V_GetColor(translation[i]);
SETBRIGHTNESS(colorbrightnesses[i], tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison
colorbrightnesses[i] = K_ColorRelativeLuminance(tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison
}
// generate lookup table for color brightness matching
for (b = 0; b < 256; b++)
@ -826,8 +817,10 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
else
{
UINT16 imagebright, blendbright;
SETBRIGHTNESS(imagebright,image->s.red,image->s.green,image->s.blue);
SETBRIGHTNESS(blendbright,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
imagebright = K_ColorRelativeLuminance(image->s.red, image->s.green, image->s.blue);
blendbright = K_ColorRelativeLuminance(blendimage->s.red, blendimage->s.green, blendimage->s.blue);
// slightly dumb average between the blend image color and base image colour, usually one or the other will be fully opaque anyway
brightness = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255;
}
@ -841,7 +834,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
}
else
{
SETBRIGHTNESS(brightness,blendimage->s.red,blendimage->s.green,blendimage->s.blue);
brightness = K_ColorRelativeLuminance(blendimage->s.red, blendimage->s.green, blendimage->s.blue);
}
}
@ -948,9 +941,12 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
UINT32 tempcolor;
UINT16 colorbright;
SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue);
colorbright = K_ColorRelativeLuminance(blendcolor.s.red, blendcolor.s.green, blendcolor.s.blue);
if (colorbright == 0)
{
colorbright = 1; // no dividing by 0 please
}
tempcolor = (brightness * blendcolor.s.red) / colorbright;
tempcolor = min(255, tempcolor);
@ -1010,9 +1006,6 @@ skippixel:
return;
}
#undef SETBRIGHTNESS
static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT32 skinnum, const UINT8 *colormap, skincolors_t color)
{
// mostly copied from HWR_GetMappedPatch, hence the similarities and comment
@ -1121,6 +1114,10 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
// Look at HWR_ProjectSprite for more
{
const fixed_t thingxpos = spr->mobj->x + spr->mobj->sprxoff;
const fixed_t thingypos = spr->mobj->y + spr->mobj->spryoff;
const fixed_t thingzpos = spr->mobj->z + spr->mobj->sprzoff;
GLPatch_t *gpatch;
INT32 durs = spr->mobj->state->tics;
INT32 tics = spr->mobj->tics;
@ -1266,13 +1263,13 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
#endif
//Hurdler: it seems there is still a small problem with mobj angle
p.x = FIXED_TO_FLOAT(spr->mobj->x);
p.y = FIXED_TO_FLOAT(spr->mobj->y)+md2->offset;
p.x = FIXED_TO_FLOAT(thingxpos);
p.y = FIXED_TO_FLOAT(thingypos) + md2->offset;
if (spr->mobj->eflags & MFE_VERTICALFLIP)
p.z = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height);
p.z = FIXED_TO_FLOAT(thingzpos + spr->mobj->height);
else
p.z = FIXED_TO_FLOAT(spr->mobj->z);
p.z = FIXED_TO_FLOAT(thingzpos);
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
sprdef = &((skin_t *)spr->mobj->skin)->spritedef;
@ -1292,7 +1289,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
}
else
{
const fixed_t anglef = AngleFixed((R_PointToAngle(spr->mobj->x, spr->mobj->y))-ANGLE_180);
const fixed_t anglef = AngleFixed((R_PointToAngle(thingxpos, thingypos))-ANGLE_180);
p.angley = FIXED_TO_FLOAT(anglef);
}
p.anglex = 0.0f;

View file

@ -796,6 +796,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_GREY:
case SKINCOLOR_NICKEL:
case SKINCOLOR_BLACK:
case SKINCOLOR_SKUNK:
case SKINCOLOR_PLATINUM:
case SKINCOLOR_JET:
cstart = "\x86"; // V_GRAYMAP
@ -811,11 +812,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
cstart = "\x8e"; // V_BROWNMAP
break;
case SKINCOLOR_FAIRY:
case SKINCOLOR_SALMON:
case SKINCOLOR_PINK:
case SKINCOLOR_ROSE:
case SKINCOLOR_LEMONADE:
case SKINCOLOR_LILAC:
case SKINCOLOR_BLOSSOM:
case SKINCOLOR_TAFFY:
cstart = "\x8d"; // V_PINKMAP
break;
@ -866,7 +867,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_PISTACHIO:
case SKINCOLOR_MOSS:
case SKINCOLOR_CAMOUFLAGE:
case SKINCOLOR_ROBOHOOD:
case SKINCOLOR_MINT:
case SKINCOLOR_GREEN:
case SKINCOLOR_PINETREE:
@ -878,14 +878,13 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_ALGAE:
cstart = "\x83"; // V_GREENMAP
break;
case SKINCOLOR_CARIBBEAN:
case SKINCOLOR_AZURE:
case SKINCOLOR_AQUAMARINE:
case SKINCOLOR_TURQUOISE:
case SKINCOLOR_TEAL:
cstart = "\x8b"; // V_AQUAMAP
break;
case SKINCOLOR_PIGEON:
case SKINCOLOR_ROBIN:
case SKINCOLOR_CYAN:
case SKINCOLOR_JAWZ:
case SKINCOLOR_CERULEAN:
@ -897,6 +896,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
case SKINCOLOR_ULTRAMARINE:
case SKINCOLOR_PERIWINKLE:
case SKINCOLOR_BLUE:
case SKINCOLOR_MIDNIGHT:
case SKINCOLOR_BLUEBERRY:
case SKINCOLOR_NOVA:
cstart = "\x84"; // V_BLUEMAP
@ -2510,7 +2510,7 @@ Ping_gfx_num (int ping)
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags)
{
INT32 gfxnum; // gfx to draw
UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE);
UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
gfxnum = Ping_gfx_num(ping);

View file

@ -98,88 +98,43 @@ state_t states[NUMSTATES] =
{SPR_THOK, FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_THOK
// Player // SRB2kart
{SPR_PLAY, 0, 1, {NULL}, 0, 0, S_KART_STND2}, // S_KART_STND1 A
{SPR_PLAY, 1, 1, {NULL}, 0, 0, S_KART_STND1}, // S_KART_STND2 B
{SPR_PLAY, 2, 1, {NULL}, 0, 0, S_KART_STND2_L}, // S_KART_STND1_L C
{SPR_PLAY, 3, 1, {NULL}, 0, 0, S_KART_STND1_L}, // S_KART_STND2_L D
{SPR_PLAY, 4, 1, {NULL}, 0, 0, S_KART_STND2_R}, // S_KART_STND1_R E
{SPR_PLAY, 5, 1, {NULL}, 0, 0, S_KART_STND1_R}, // S_KART_STND2_R F
{SPR_PLAY, 9, 1, {NULL}, 0, 0, S_KART_WALK2}, // S_KART_WALK1 J
{SPR_PLAY, 6, 1, {NULL}, 0, 0, S_KART_WALK1}, // S_KART_WALK2 G
{SPR_PLAY, 10, 1, {NULL}, 0, 0, S_KART_WALK2_L}, // S_KART_WALK1_L K
{SPR_PLAY, 7, 1, {NULL}, 0, 0, S_KART_WALK1_L}, // S_KART_WALK2_L H
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_KART_WALK2_R}, // S_KART_WALK1_R L
{SPR_PLAY, 8, 1, {NULL}, 0, 0, S_KART_WALK1_R}, // S_KART_WALK2_R I
{SPR_PLAY, 0, 1, {NULL}, 0, 0, S_KART_RUN2}, // S_KART_RUN1 A
{SPR_PLAY, 9, 1, {NULL}, 0, 0, S_KART_RUN1}, // S_KART_RUN2 J
{SPR_PLAY, 2, 1, {NULL}, 0, 0, S_KART_RUN2_L}, // S_KART_RUN1_L C
{SPR_PLAY, 10, 1, {NULL}, 0, 0, S_KART_RUN1_L}, // S_KART_RUN2_L K
{SPR_PLAY, 4, 1, {NULL}, 0, 0, S_KART_RUN2_R}, // S_KART_RUN1_R E
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_KART_RUN1_R}, // S_KART_RUN2_R L
{SPR_PLAY, 12, 1, {NULL}, 0, 0, S_KART_DRIFT2_L}, // S_KART_DRIFT1_L M
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_KART_DRIFT1_L}, // S_KART_DRIFT2_L N
{SPR_PLAY, 14, 1, {NULL}, 0, 0, S_KART_DRIFT2_R}, // S_KART_DRIFT1_R O
{SPR_PLAY, 15, 1, {NULL}, 0, 0, S_KART_DRIFT1_R}, // S_KART_DRIFT2_R P
{SPR_PLAY, 16, -1, {NULL}, 0, 0, S_KART_SPIN}, // S_KART_SPIN Q
{SPR_PLAY, 16, 350, {NULL}, 0, 0, S_KART_STND1}, // S_KART_PAIN Q
{SPR_PLAY, 17, 350, {NULL}, 0, 0, S_KART_STND1}, // S_KART_SQUISH R
/*
{SPR_PLAY, 0, 105, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_STND
{SPR_PLAY, 1, 16, {NULL}, 0, 0, S_PLAY_TAP2}, // S_PLAY_TAP1
{SPR_PLAY, 2, 16, {NULL}, 0, 0, S_PLAY_TAP1}, // S_PLAY_TAP2
{SPR_PLAY, 3, 4, {NULL}, 0, 0, S_PLAY_RUN2}, // S_PLAY_RUN1
{SPR_PLAY, 4, 4, {NULL}, 0, 0, S_PLAY_RUN3}, // S_PLAY_RUN2
{SPR_PLAY, 5, 4, {NULL}, 0, 0, S_PLAY_RUN4}, // S_PLAY_RUN3
{SPR_PLAY, 6, 4, {NULL}, 0, 0, S_PLAY_RUN5}, // S_PLAY_RUN4
{SPR_PLAY, 7, 4, {NULL}, 0, 0, S_PLAY_RUN6}, // S_PLAY_RUN5
{SPR_PLAY, 8, 4, {NULL}, 0, 0, S_PLAY_RUN7}, // S_PLAY_RUN6
{SPR_PLAY, 9, 4, {NULL}, 0, 0, S_PLAY_RUN8}, // S_PLAY_RUN7
{SPR_PLAY, 10, 4, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_RUN8
{SPR_PLAY, 16, 2, {NULL}, 0, 0, S_PLAY_SPD2}, // S_PLAY_SPD1
{SPR_PLAY, 17, 2, {NULL}, 0, 0, S_PLAY_SPD3}, // S_PLAY_SPD2
{SPR_PLAY, 18, 2, {NULL}, 0, 0, S_PLAY_SPD4}, // S_PLAY_SPD3
{SPR_PLAY, 19, 2, {NULL}, 0, 0, S_PLAY_SPD1}, // S_PLAY_SPD4
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_PLAY_ATK2}, // S_PLAY_ATK1
{SPR_PLAY, 12, 1, {NULL}, 0, 0, S_PLAY_ATK3}, // S_PLAY_ATK2
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_PLAY_ATK4}, // S_PLAY_ATK3
{SPR_PLAY, 14, 1, {NULL}, 0, 0, S_PLAY_ATK1}, // S_PLAY_ATK4
{SPR_PLAY, 15, -1, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_SPRING
{SPR_PLAY, 31, 2, {NULL}, 0, 0, S_PLAY_FALL2}, // S_PLAY_FALL1
{SPR_PLAY, 32, 2, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_FALL2
{SPR_PLAY, 20, 2, {NULL}, 0, 0, S_PLAY_ABL2}, // S_PLAY_ABL1
{SPR_PLAY, 21, 2, {NULL}, 0, 0, S_PLAY_ABL1}, // S_PLAY_ABL2
{SPR_PLAY, 22, 6, {NULL}, 0, 0, S_PLAY_SPC2}, // S_PLAY_SPC1
{SPR_PLAY, 23, 6, {NULL}, 0, 0, S_PLAY_SPC3}, // S_PLAY_SPC2
{SPR_PLAY, 24, 6, {NULL}, 0, 0, S_PLAY_SPC4}, // S_PLAY_SPC3
{SPR_PLAY, 25, 6, {NULL}, 0, 0, S_PLAY_SPC1}, // S_PLAY_SPC4
{SPR_PLAY, 22, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_CLIMB1
{SPR_PLAY, 23, 5, {NULL}, 0, 0, S_PLAY_CLIMB3}, // S_PLAY_CLIMB2
{SPR_PLAY, 24, 5, {NULL}, 0, 0, S_PLAY_CLIMB4}, // S_PLAY_CLIMB3
{SPR_PLAY, 25, 5, {NULL}, 0, 0, S_PLAY_CLIMB5}, // S_PLAY_CLIMB4
{SPR_PLAY, 24, 5, {NULL}, 0, 0, S_PLAY_CLIMB2}, // S_PLAY_CLIMB5
{SPR_PLAY, 26, 14, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_GASP
{SPR_PLAY, 27, 350, {NULL}, 0, 0, S_PLAY_FALL1}, // S_PLAY_PAIN
{SPR_PLAY, 28, -1, {A_Fall}, 0, 0, S_NULL}, // S_PLAY_DIE
{SPR_PLAY, 29, 12, {NULL}, 0, 0, S_PLAY_TEETER2}, // S_PLAY_TEETER1
{SPR_PLAY, 30, 12, {NULL}, 0, 0, S_PLAY_TEETER1}, // S_PLAY_TEETER2
{SPR_PLAY, 33, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_CARRY
{SPR_PLAY, 20, -1, {NULL}, 0, 0, S_PLAY_SUPERSTAND}, // S_PLAY_SUPERSTAND
{SPR_PLAY, 20, 7, {NULL}, 0, 0, S_PLAY_SUPERWALK2}, // S_PLAY_SUPERWALK1
{SPR_PLAY, 21, 7, {NULL}, 0, 0, S_PLAY_SUPERWALK1}, // S_PLAY_SUPERWALK2
{SPR_PLAY, 22, 7, {NULL}, 0, 0, S_PLAY_SUPERFLY2}, // S_PLAY_SUPERFLY1
{SPR_PLAY, 23, 7, {NULL}, 0, 0, S_PLAY_SUPERFLY1}, // S_PLAY_SUPERFLY2
{SPR_PLAY, 24, 12, {NULL}, 0, 0, S_PLAY_SUPERTEETER}, // S_PLAY_SUPERTEETER
{SPR_PLAY, 25, -1, {NULL}, 0, 0, S_PLAY_SUPERSTAND}, // S_PLAY_SUPERHIT
{SPR_PLAY, 36, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS2}, // S_PLAY_SUPERTRANS1
{SPR_PLAY, 37, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS3}, // S_PLAY_SUPERTRANS2
{SPR_PLAY, 32806, 4, {NULL}, 0, 0, S_PLAY_SUPERTRANS4}, // S_PLAY_SUPERTRANS3
{SPR_PLAY, 39, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS5}, // S_PLAY_SUPERTRANS4
{SPR_PLAY, 40, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS6}, // S_PLAY_SUPERTRANS5
{SPR_PLAY, 41, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS7}, // S_PLAY_SUPERTRANS6
{SPR_PLAY, 42, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS8}, // S_PLAY_SUPERTRANS7
{SPR_PLAY, 43, 3, {NULL}, 0, 0, S_PLAY_SUPERTRANS9}, // S_PLAY_SUPERTRANS8
{SPR_PLAY, 44, 16, {NULL}, 0, 0, S_PLAY_RUN1}, // S_PLAY_SUPERTRANS9
*/
{SPR_PLAY, 0, 1, {NULL}, 0, 0, S_KART_STILL2}, // S_KART_STILL1 A
{SPR_PLAY, 1, 1, {NULL}, 0, 0, S_KART_STILL1}, // S_KART_STILL2 B
{SPR_PLAY, 2, 1, {NULL}, 0, 0, S_KART_STILL2_L}, // S_KART_STILL1_L C
{SPR_PLAY, 3, 1, {NULL}, 0, 0, S_KART_STILL1_L}, // S_KART_STILL2_L D
{SPR_PLAY, 4, 1, {NULL}, 0, 0, S_KART_STILL2_R}, // S_KART_STILL1_R E
{SPR_PLAY, 5, 1, {NULL}, 0, 0, S_KART_STILL1_R}, // S_KART_STILL2_R F
{SPR_PLAY, 9, 1, {NULL}, 0, 0, S_KART_SLOW2}, // S_KART_SLOW1 J
{SPR_PLAY, 6, 1, {NULL}, 0, 0, S_KART_SLOW1}, // S_KART_SLOW2 G
{SPR_PLAY, 10, 1, {NULL}, 0, 0, S_KART_SLOW2_L}, // S_KART_SLOW1_L K
{SPR_PLAY, 7, 1, {NULL}, 0, 0, S_KART_SLOW1_L}, // S_KART_SLOW2_L H
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_KART_SLOW2_R}, // S_KART_SLOW1_R L
{SPR_PLAY, 8, 1, {NULL}, 0, 0, S_KART_SLOW1_R}, // S_KART_SLOW2_R I
{SPR_PLAY, 0, 1, {NULL}, 0, 0, S_KART_FAST2}, // S_KART_FAST1 A
{SPR_PLAY, 9, 1, {NULL}, 0, 0, S_KART_FAST1}, // S_KART_FAST2 J
{SPR_PLAY, 2, 1, {NULL}, 0, 0, S_KART_FAST2_L}, // S_KART_FAST1_L C
{SPR_PLAY, 10, 1, {NULL}, 0, 0, S_KART_FAST1_L}, // S_KART_FAST2_L K
{SPR_PLAY, 4, 1, {NULL}, 0, 0, S_KART_FAST2_R}, // S_KART_FAST1_R E
{SPR_PLAY, 11, 1, {NULL}, 0, 0, S_KART_FAST1_R}, // S_KART_FAST2_R L
{SPR_PLAY, 12, 1, {NULL}, 0, 0, S_KART_DRIFT2_L}, // S_KART_DRIFT1_L M
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_KART_DRIFT1_L}, // S_KART_DRIFT2_L N
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_KART_DRIFT2_L_OUT}, // S_KART_DRIFT1_L_OUT N
{SPR_PLAY, 14, 1, {NULL}, 0, 0, S_KART_DRIFT1_L_OUT}, // S_KART_DRIFT2_L_OUT O
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_KART_DRIFT2_L_IN}, // S_KART_DRIFT1_L_IN N
{SPR_PLAY, 15, 1, {NULL}, 0, 0, S_KART_DRIFT3_L_IN}, // S_KART_DRIFT2_L_IN P
{SPR_PLAY, 13, 1, {NULL}, 0, 0, S_KART_DRIFT4_L_IN}, // S_KART_DRIFT3_L_IN N
{SPR_PLAY, 16, 1, {NULL}, 0, 0, S_KART_DRIFT1_L_IN}, // S_KART_DRIFT4_L_IN Q
{SPR_PLAY, 17, 1, {NULL}, 0, 0, S_KART_DRIFT2_R}, // S_KART_DRIFT1_R R
{SPR_PLAY, 18, 1, {NULL}, 0, 0, S_KART_DRIFT1_R}, // S_KART_DRIFT2_R S
{SPR_PLAY, 18, 1, {NULL}, 0, 0, S_KART_DRIFT2_R_OUT}, // S_KART_DRIFT1_R_OUT S
{SPR_PLAY, 19, 1, {NULL}, 0, 0, S_KART_DRIFT1_R_OUT}, // S_KART_DRIFT2_R_OUT T
{SPR_PLAY, 18, 1, {NULL}, 0, 0, S_KART_DRIFT2_R_IN}, // S_KART_DRIFT1_R_IN S
{SPR_PLAY, 20, 1, {NULL}, 0, 0, S_KART_DRIFT3_R_IN}, // S_KART_DRIFT2_R_IN U
{SPR_PLAY, 18, 1, {NULL}, 0, 0, S_KART_DRIFT4_R_IN}, // S_KART_DRIFT3_R_IN S
{SPR_PLAY, 21, 1, {NULL}, 0, 0, S_KART_DRIFT1_R_IN}, // S_KART_DRIFT4_R_IN V
{SPR_PLAY, 22, -1, {NULL}, 0, 0, S_KART_SPIN}, // S_KART_SPIN W
{SPR_PLAY, 22, 350, {NULL}, 0, 0, S_KART_STILL1}, // S_KART_PAIN W
{SPR_PLAY, 23, 350, {NULL}, 0, 0, S_KART_STILL1}, // S_KART_SQUISH X
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY}, //S_OBJPLACE_DUMMY
@ -192,7 +147,7 @@ state_t states[NUMSTATES] =
{SPR_NULL, 0, 18, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3
// Level end sign (uses player sprite)
{SPR_PLAY, 18|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_PLAY_SIGN}, // S_PLAY_SIGN
{SPR_PLAY, 24|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_PLAY_SIGN}, // S_PLAY_SIGN
// Blue Crawla
{SPR_POSS, 0, 5, {A_Look}, 0, 0, S_POSS_STND}, // S_POSS_STND
@ -3632,9 +3587,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_PLAYER
-1, // doomednum
S_KART_STND1, // spawnstate
S_KART_STILL1, // spawnstate
1, // spawnhealth
S_KART_WALK1, // seestate
S_KART_FAST1, // seestate
sfx_None, // seesound
0, // reactiontime
sfx_thok, // attacksound
@ -6199,7 +6154,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_SALMON, // painchance
SKINCOLOR_RASPBERRY, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
@ -6307,7 +6262,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_SALMON, // painchance
SKINCOLOR_RASPBERRY, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
@ -6415,7 +6370,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
SKINCOLOR_SALMON, // painchance
SKINCOLOR_RASPBERRY, // painchance
sfx_s3kb1, // painsound
S_NULL, // meleestate
S_NULL, // missilestate

View file

@ -826,88 +826,52 @@ typedef enum state
S_THOK,
// SRB2kart Frames
S_KART_STND1,
S_KART_STND2,
S_KART_STND1_L,
S_KART_STND2_L,
S_KART_STND1_R,
S_KART_STND2_R,
S_KART_WALK1,
S_KART_WALK2,
S_KART_WALK1_L,
S_KART_WALK2_L,
S_KART_WALK1_R,
S_KART_WALK2_R,
S_KART_RUN1,
S_KART_RUN2,
S_KART_RUN1_L,
S_KART_RUN2_L,
S_KART_RUN1_R,
S_KART_RUN2_R,
S_KART_STILL1,
S_KART_STILL2,
S_KART_STILL1_L,
S_KART_STILL2_L,
S_KART_STILL1_R,
S_KART_STILL2_R,
S_KART_SLOW1,
S_KART_SLOW2,
S_KART_SLOW1_L,
S_KART_SLOW2_L,
S_KART_SLOW1_R,
S_KART_SLOW2_R,
S_KART_FAST1,
S_KART_FAST2,
S_KART_FAST1_L,
S_KART_FAST2_L,
S_KART_FAST1_R,
S_KART_FAST2_R,
S_KART_DRIFT1_L,
S_KART_DRIFT2_L,
S_KART_DRIFT1_L_OUT,
S_KART_DRIFT2_L_OUT,
S_KART_DRIFT1_L_IN,
S_KART_DRIFT2_L_IN,
S_KART_DRIFT3_L_IN,
S_KART_DRIFT4_L_IN,
S_KART_DRIFT1_R,
S_KART_DRIFT2_R,
S_KART_DRIFT1_R_OUT,
S_KART_DRIFT2_R_OUT,
S_KART_DRIFT1_R_IN,
S_KART_DRIFT2_R_IN,
S_KART_DRIFT3_R_IN,
S_KART_DRIFT4_R_IN,
S_KART_SPIN,
S_KART_PAIN,
S_KART_SQUISH,
/*
S_PLAY_STND,
S_PLAY_TAP1,
S_PLAY_TAP2,
S_PLAY_RUN1,
S_PLAY_RUN2,
S_PLAY_RUN3,
S_PLAY_RUN4,
S_PLAY_RUN5,
S_PLAY_RUN6,
S_PLAY_RUN7,
S_PLAY_RUN8,
S_PLAY_SPD1,
S_PLAY_SPD2,
S_PLAY_SPD3,
S_PLAY_SPD4,
S_PLAY_ATK1,
S_PLAY_ATK2,
S_PLAY_ATK3,
S_PLAY_ATK4,
S_PLAY_SPRING,
S_PLAY_FALL1,
S_PLAY_FALL2,
S_PLAY_ABL1,
S_PLAY_ABL2,
S_PLAY_SPC1,
S_PLAY_SPC2,
S_PLAY_SPC3,
S_PLAY_SPC4,
S_PLAY_CLIMB1,
S_PLAY_CLIMB2,
S_PLAY_CLIMB3,
S_PLAY_CLIMB4,
S_PLAY_CLIMB5,
S_PLAY_GASP,
S_PLAY_PAIN,
S_PLAY_DIE,
S_PLAY_TEETER1,
S_PLAY_TEETER2,
S_PLAY_CARRY,
S_PLAY_SUPERSTAND,
S_PLAY_SUPERWALK1,
S_PLAY_SUPERWALK2,
S_PLAY_SUPERFLY1,
S_PLAY_SUPERFLY2,
S_PLAY_SUPERTEETER,
S_PLAY_SUPERHIT,
S_PLAY_SUPERTRANS1,
S_PLAY_SUPERTRANS2,
S_PLAY_SUPERTRANS3,
S_PLAY_SUPERTRANS4,
S_PLAY_SUPERTRANS5,
S_PLAY_SUPERTRANS6,
S_PLAY_SUPERTRANS7,
S_PLAY_SUPERTRANS8,
S_PLAY_SUPERTRANS9, // This has special significance in the code. If you add more frames, search for it and make the appropriate changes.
*/
// technically the player goes here but it's an infinite tic state
S_OBJPLACE_DUMMY,

525
src/k_color.c Normal file
View file

@ -0,0 +1,525 @@
// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Kart Krew
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file k_color.c
/// \brief Skincolor & colormapping code
#include "k_color.h"
#include "doomdef.h"
#include "doomtype.h"
#include "r_draw.h"
#include "r_things.h"
#include "v_video.h"
// These should be within 14 characters to fit on the character select screen
const char *KartColor_Names[MAXSKINCOLORS] =
{
"None", // SKINCOLOR_NONE
"White", // SKINCOLOR_WHITE
"Silver", // SKINCOLOR_SILVER
"Grey", // SKINCOLOR_GREY
"Nickel", // SKINCOLOR_NICKEL
"Black", // SKINCOLOR_BLACK
"Skunk", // SKINCOLOR_SKUNK
"Fairy", // SKINCOLOR_FAIRY
"Popcorn", // SKINCOLOR_POPCORN
"Artichoke", // SKINCOLOR_ARTICHOKE
"Pigeon", // SKINCOLOR_PIGEON
"Sepia", // SKINCOLOR_SEPIA
"Beige", // SKINCOLOR_BEIGE
"Caramel", // SKINCOLOR_CARAMEL
"Peach", // SKINCOLOR_PEACH
"Brown", // SKINCOLOR_BROWN
"Leather", // SKINCOLOR_LEATHER
"Pink", // SKINCOLOR_PINK
"Rose", // SKINCOLOR_ROSE
"Cinnamon", // SKINCOLOR_CINNAMON
"Ruby", // SKINCOLOR_RUBY
"Raspberry", // SKINCOLOR_RASPBERRY
"Red", // SKINCOLOR_RED
"Crimson", // SKINCOLOR_CRIMSON
"Maroon", // SKINCOLOR_MAROON
"Lemonade", // SKINCOLOR_LEMONADE
"Scarlet", // SKINCOLOR_SCARLET
"Ketchup", // SKINCOLOR_KETCHUP
"Dawn", // SKINCOLOR_DAWN
"Sunslam", // SKINCOLOR_SUNSLAM
"Creamsicle", // SKINCOLOR_CREAMSICLE
"Orange", // SKINCOLOR_ORANGE
"Rosewood", // SKINCOLOR_ROSEWOOD
"Tangerine", // SKINCOLOR_TANGERINE
"Tan", // SKINCOLOR_TAN
"Cream", // SKINCOLOR_CREAM
"Gold", // SKINCOLOR_GOLD
"Royal", // SKINCOLOR_ROYAL
"Bronze", // SKINCOLOR_BRONZE
"Copper", // SKINCOLOR_COPPER
"Yellow", // SKINCOLOR_YELLOW
"Mustard", // SKINCOLOR_MUSTARD
"Banana", // SKINCOLOR_BANANA
"Olive", // SKINCOLOR_OLIVE
"Crocodile", // SKINCOLOR_CROCODILE
"Peridot", // SKINCOLOR_PERIDOT
"Vomit", // SKINCOLOR_VOMIT
"Garden", // SKINCOLOR_GARDEN
"Lime", // SKINCOLOR_LIME
"Handheld", // SKINCOLOR_HANDHELD
"Tea", // SKINCOLOR_TEA
"Pistachio", // SKINCOLOR_PISTACHIO
"Moss", // SKINCOLOR_MOSS
"Camouflage", // SKINCOLOR_CAMOUFLAGE
"Mint", // SKINCOLOR_MINT
"Green", // SKINCOLOR_GREEN
"Pinetree", // SKINCOLOR_PINETREE
"Turtle", // SKINCOLOR_TURTLE
"Swamp", // SKINCOLOR_SWAMP
"Dream", // SKINCOLOR_DREAM
"Plague", // SKINCOLOR_PLAGUE
"Emerald", // SKINCOLOR_EMERALD
"Algae", // SKINCOLOR_ALGAE
"Aquamarine", // SKINCOLOR_AQUAMARINE
"Turquoise", // SKINCOLOR_TURQUOISE
"Teal", // SKINCOLOR_TEAL
"Robin", // SKINCOLOR_ROBIN
"Cyan", // SKINCOLOR_CYAN
"Jawz", // SKINCOLOR_JAWZ
"Cerulean", // SKINCOLOR_CERULEAN
"Navy", // SKINCOLOR_NAVY
"Platinum", // SKINCOLOR_PLATINUM
"Slate", // SKINCOLOR_SLATE
"Steel", // SKINCOLOR_STEEL
"Thunder", // SKINCOLOR_THUNDER
"Nova", // SKINCOLOR_NOVA
"Rust", // SKINCOLOR_RUST
"Wristwatch", // SKINCOLOR_WRISTWATCH
"Jet", // SKINCOLOR_JET
"Sapphire", // SKINCOLOR_SAPPHIRE
"Ultramarine", // SKINCOLOR_ULTRAMARINE
"Periwinkle", // SKINCOLOR_PERIWINKLE
"Blue", // SKINCOLOR_BLUE
"Midnight", // SKINCOLOR_MIDNIGHT
"Blueberry", // SKINCOLOR_BLUEBERRY
"Thistle", // SKINCOLOR_THISTLE
"Purple", // SKINCOLOR_PURPLE
"Pastel", // SKINCOLOR_PASTEL
"Moonset", // SKINCOLOR_MOONSET
"Dusk", // SKINCOLOR_DUSK
"Violet", // SKINCOLOR_VIOLET
"Magenta", // SKINCOLOR_MAGENTA
"Fuchsia", // SKINCOLOR_FUCHSIA
"Toxic", // SKINCOLOR_TOXIC
"Mauve", // SKINCOLOR_MAUVE
"Lavender", // SKINCOLOR_LAVENDER
"Byzantium", // SKINCOLOR_BYZANTIUM
"Pomegranate", // SKINCOLOR_POMEGRANATE
"Lilac", // SKINCOLOR_LILAC
"Blossom", // SKINCOLOR_BLOSSOM
"Taffy" // SKINCOLOR_TAFFY
};
// Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later
const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
{
SKINCOLOR_NONE,8, // SKINCOLOR_NONE
SKINCOLOR_BLACK,8, // SKINCOLOR_WHITE
SKINCOLOR_NICKEL,8, // SKINCOLOR_SILVER
SKINCOLOR_GREY,8, // SKINCOLOR_GREY
SKINCOLOR_SILVER,8, // SKINCOLOR_NICKEL
SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK
SKINCOLOR_VOMIT,8, // SKINCOLOR_SKUNK
SKINCOLOR_ARTICHOKE,12, // SKINCOLOR_FAIRY
SKINCOLOR_PIGEON,12, // SKINCOLOR_POPCORN
SKINCOLOR_FAIRY,12, // SKINCOLOR_ARTICHOKE
SKINCOLOR_POPCORN,12, // SKINCOLOR_PIGEON
SKINCOLOR_LEATHER,6, // SKINCOLOR_SEPIA
SKINCOLOR_BROWN,2, // SKINCOLOR_BEIGE
SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL
SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH
SKINCOLOR_BEIGE,8, // SKINCOLOR_BROWN
SKINCOLOR_SEPIA,8, // SKINCOLOR_LEATHER
SKINCOLOR_PISTACHIO,8, // SKINCOLOR_PINK
SKINCOLOR_MOSS,8, // SKINCOLOR_ROSE
SKINCOLOR_WRISTWATCH,6, // SKINCOLOR_CINNAMON
SKINCOLOR_SAPPHIRE,8, // SKINCOLOR_RUBY
SKINCOLOR_MINT,8, // SKINCOLOR_RASPBERRY
SKINCOLOR_GREEN,6, // SKINCOLOR_RED
SKINCOLOR_PINETREE,6, // SKINCOLOR_CRIMSON
SKINCOLOR_TOXIC,8, // SKINCOLOR_MAROON
SKINCOLOR_THUNDER,8, // SKINCOLOR_LEMONADE
SKINCOLOR_ALGAE,10, // SKINCOLOR_SCARLET
SKINCOLOR_MUSTARD,10, // SKINCOLOR_KETCHUP
SKINCOLOR_DUSK,8, // SKINCOLOR_DAWN
SKINCOLOR_MOONSET,8, // SKINCOLOR_SUNSLAM
SKINCOLOR_PERIWINKLE,8, // SKINCOLOR_CREAMSICLE
SKINCOLOR_BLUE,8, // SKINCOLOR_ORANGE
SKINCOLOR_BLUEBERRY,6, // SKINCOLOR_ROSEWOOD
SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE
SKINCOLOR_RUST,8, // SKINCOLOR_TAN
SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM
SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD
SKINCOLOR_PLATINUM,6, // SKINCOLOR_ROYAL
SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE
SKINCOLOR_CREAM,6, // SKINCOLOR_COPPER
SKINCOLOR_AQUAMARINE,8, // SKINCOLOR_YELLOW
SKINCOLOR_KETCHUP,8, // SKINCOLOR_MUSTARD
SKINCOLOR_EMERALD,8, // SKINCOLOR_BANANA
SKINCOLOR_TEAL,8, // SKINCOLOR_OLIVE
SKINCOLOR_VIOLET,8, // SKINCOLOR_CROCODILE
SKINCOLOR_NAVY,6, // SKINCOLOR_PERIDOT
SKINCOLOR_SKUNK,8, // SKINCOLOR_VOMIT
SKINCOLOR_LAVENDER,6, // SKINCOLOR_GARDEN
SKINCOLOR_TANGERINE,8, // SKINCOLOR_LIME
SKINCOLOR_ULTRAMARINE,8, // SKINCOLOR_HANDHELD
SKINCOLOR_BLOSSOM,8, // SKINCOLOR_TEA
SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO
SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS
SKINCOLOR_CAMOUFLAGE,8, // SKINCOLOR_CAMOUFLAGE
SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT
SKINCOLOR_RED,8, // SKINCOLOR_GREEN
SKINCOLOR_CRIMSON,8, // SKINCOLOR_PINETREE
SKINCOLOR_MAGENTA,8, // SKINCOLOR_TURTLE
SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP
SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM
SKINCOLOR_NOVA,8, // SKINCOLOR_PLAGUE
SKINCOLOR_BANANA,8, // SKINCOLOR_EMERALD
SKINCOLOR_SCARLET,10, // SKINCOLOR_ALGAE
SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUAMARINE
SKINCOLOR_MAUVE,10, // SKINCOLOR_TURQUOISE
SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL
SKINCOLOR_THISTLE,8, // SKINCOLOR_ROBIN
SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN
SKINCOLOR_LILAC,10, // SKINCOLOR_JAWZ
SKINCOLOR_CARAMEL,8, // SKINCOLOR_CERULEAN
SKINCOLOR_PERIDOT,8, // SKINCOLOR_NAVY
SKINCOLOR_ROYAL,8, // SKINCOLOR_PLATINUM
SKINCOLOR_GOLD,10, // SKINCOLOR_SLATE
SKINCOLOR_BRONZE,10, // SKINCOLOR_STEEL
SKINCOLOR_LEMONADE,8, // SKINCOLOR_THUNDER
SKINCOLOR_PLAGUE,10, // SKINCOLOR_NOVA
SKINCOLOR_TAN,8, // SKINCOLOR_RUST
SKINCOLOR_CINNAMON,8, // SKINCOLOR_WRISTWATCH
SKINCOLOR_TAFFY,8, // SKINCOLOR_JET
SKINCOLOR_RUBY,6, // SKINCOLOR_SAPPHIRE
SKINCOLOR_HANDHELD,10, // SKINCOLOR_ULTRAMARINE
SKINCOLOR_CREAMSICLE,8, // SKINCOLOR_PERIWINKLE
SKINCOLOR_ORANGE,8, // SKINCOLOR_BLUE
SKINCOLOR_ROSEWOOD,8, // SKINCOLOR_MIDNIGHT
SKINCOLOR_PURPLE,8, // SKINCOLOR_BLUEBERRY
SKINCOLOR_ROBIN,8, // SKINCOLOR_THISTLE
SKINCOLOR_MIDNIGHT,10, // SKINCOLOR_PURPLE
SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL
SKINCOLOR_SUNSLAM,10, // SKINCOLOR_MOONSET
SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK
SKINCOLOR_CROCODILE,8, // SKINCOLOR_VIOLET
SKINCOLOR_TURTLE,8, // SKINCOLOR_MAGENTA
SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA
SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC
SKINCOLOR_TURQUOISE,8, // SKINCOLOR_MAUVE
SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER
SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM
SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE
SKINCOLOR_JAWZ,6, // SKINCOLOR_LILAC
SKINCOLOR_TEA,8, // SKINCOLOR_BLOSSOM
SKINCOLOR_JET,8 // SKINCOLOR_TAFFY
};
UINT8 colortranslations[MAXTRANSLATIONS][16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE
{ 0, 0, 0, 0, 1, 2, 5, 8, 9, 11, 14, 17, 20, 22, 25, 28}, // SKINCOLOR_WHITE
{ 0, 1, 2, 3, 5, 7, 9, 12, 13, 15, 18, 20, 23, 25, 27, 30}, // SKINCOLOR_SILVER
{ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY
{ 3, 5, 8, 11, 15, 17, 19, 21, 23, 24, 25, 26, 27, 29, 30, 31}, // SKINCOLOR_NICKEL
{ 4, 7, 11, 15, 20, 22, 24, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK
{ 0, 1, 2, 3, 4, 10, 16, 21, 23, 24, 25, 26, 27, 28, 29, 31}, // SKINCOLOR_SKUNK
{ 0, 0, 252, 252, 200, 201, 211, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_FAIRY
{ 0, 80, 80, 81, 82, 218, 240, 11, 13, 16, 18, 21, 23, 26, 28, 31}, // SKINCOLOR_POPCORN
{ 80, 88, 89, 98, 99, 91, 12, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_ARTICHOKE
{ 0, 128, 129, 130, 146, 170, 14, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_PIGEON
{ 0, 1, 3, 5, 7, 9, 241, 242, 243, 245, 247, 249, 236, 237, 238, 239}, // SKINCOLOR_SEPIA
{ 0, 208, 216, 217, 240, 241, 242, 243, 245, 247, 249, 250, 251, 237, 238, 239}, // SKINCOLOR_BEIGE
{208, 48, 216, 217, 218, 220, 221, 223, 224, 226, 228, 230, 232, 234, 236, 239}, // SKINCOLOR_CARAMEL
{ 0, 208, 48, 216, 218, 221, 212, 213, 214, 215, 206, 207, 197, 198, 199, 254}, // SKINCOLOR_PEACH
{216, 217, 219, 221, 224, 225, 227, 229, 230, 232, 234, 235, 237, 239, 29, 30}, // SKINCOLOR_BROWN
{218, 221, 224, 227, 229, 231, 233, 235, 237, 239, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER
{ 0, 208, 208, 209, 209, 210, 211, 211, 212, 213, 214, 215, 41, 43, 45, 46}, // SKINCOLOR_PINK
{209, 210, 211, 211, 212, 213, 214, 215, 41, 42, 43, 44, 45, 71, 46, 47}, // SKINCOLOR_ROSE
{216, 221, 224, 226, 228, 60, 61, 43, 44, 45, 71, 46, 47, 29, 30, 31}, // SKINCOLOR_CINNAMON
{ 0, 208, 209, 210, 211, 213, 39, 40, 41, 43, 186, 186, 169, 169, 253, 254}, // SKINCOLOR_RUBY
{ 0, 208, 209, 210, 32, 33, 34, 35, 37, 39, 41, 43, 44, 45, 46, 47}, // SKINCOLOR_RASPBERRY
{209, 210, 32, 34, 36, 38, 39, 40, 41, 42, 43, 44 , 45, 71, 46, 47}, // SKINCOLOR_RED
{210, 33, 35, 38, 40, 42, 43, 45, 71, 71, 46, 46, 47, 47, 30, 31}, // SKINCOLOR_CRIMSON
{ 32, 33, 35, 37, 39, 41, 43, 237, 26, 26, 27, 27, 28, 29, 30, 31}, // SKINCOLOR_MAROON
{ 0, 80, 81, 82, 83, 216, 210, 211, 212, 213, 214, 215, 43, 44, 71, 47}, // SKINCOLOR_LEMONADE
{ 48, 49, 50, 51, 53, 34, 36, 38, 184, 185, 168, 168, 169, 169, 254, 31}, // SKINCOLOR_SCARLET
{ 72, 73, 64, 51, 52, 54, 34, 36, 38, 40, 42, 43, 44, 71, 46, 47}, // SKINCOLOR_KETCHUP
{ 0, 208, 216, 209, 210, 211, 212, 57, 58, 59, 60, 61, 63, 71, 47, 31}, // SKINCOLOR_DAWN
{ 82, 72, 73, 64, 51, 53, 55, 213, 214, 195, 195, 173, 174, 175, 253, 254}, // SKINCOLOR_SUNSLAM
{ 0, 0, 208, 208, 48, 49, 50, 52, 53, 54, 56, 57, 58, 60, 61, 63}, // SKINCOLOR_CREAMSICLE
{208, 48, 49, 50, 51, 52, 53, 54, 55, 57, 59, 60, 62, 44, 71, 47}, // SKINCOLOR_ORANGE
{ 50, 52, 55, 56, 58, 59, 60, 61, 62, 63, 44, 45, 71, 46, 47, 30}, // SKINCOLOR_ROSEWOOD
{ 80, 81, 82, 83, 64, 51, 52, 54, 55, 57, 58, 60, 61, 63, 71, 47}, // SKINCOLOR_TANGERINE
{ 0, 80, 81, 82, 83, 84, 85, 86, 87, 245, 246, 248, 249, 251, 237, 239}, // SKINCOLOR_TAN
{ 0, 80, 80, 81, 81, 49, 51, 222, 224, 227, 230, 233, 236, 239, 29, 31}, // SKINCOLOR_CREAM
{ 0, 80, 81, 83, 64, 65, 66, 67, 68, 215, 69, 70, 44, 71, 46, 47}, // SKINCOLOR_GOLD
{ 80, 81, 83, 64, 65, 223, 229, 196, 196, 197, 197, 198, 199, 29, 30, 31}, // SKINCOLOR_ROYAL
{ 83, 64, 65, 66, 67, 215, 69, 70, 44, 44, 45, 71, 46, 47, 29, 31}, // SKINCOLOR_BRONZE
{ 0, 82, 64, 65, 67, 68, 70, 237, 239, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_COPPER
{ 0, 80, 81, 82, 83, 73, 84, 74, 64, 65, 66, 67, 68, 69, 70, 71}, // SKINCOLOR_YELLOW
{ 80, 81, 82, 83, 64, 65, 65, 76, 76, 77, 77, 78, 79, 237, 239, 29}, // SKINCOLOR_MUSTARD
{ 80, 81, 83, 72, 73, 74, 75, 76, 77, 78, 79, 236, 237, 238, 239, 30}, // SKINCOLOR_BANANA
{ 80, 82, 73, 74, 75, 76, 77, 78, 79, 236, 237, 238, 239, 28, 29, 31}, // SKINCOLOR_OLIVE
{ 0, 80, 81, 88, 88, 188, 189, 76, 76, 77, 78, 79, 236, 237, 238, 239}, // SKINCOLOR_CROCODILE
{ 0, 80, 81, 88, 188, 189, 190, 191, 94, 94, 95, 95, 109, 110, 111, 31}, // SKINCOLOR_PERIDOT
{ 0, 208, 216, 209, 218, 51, 65, 76, 191, 191, 126, 143, 138, 175, 169, 254}, // SKINCOLOR_VOMIT
{ 81, 82, 83, 73, 64, 65, 66, 92, 92, 93, 93, 94, 95, 109, 110, 111}, // SKINCOLOR_GARDEN
{ 0, 80, 81, 88, 188, 189, 114, 114, 115, 115, 116, 116, 117, 118, 119, 111}, // SKINCOLOR_LIME
{ 83, 72, 73, 74, 75, 76, 102, 104, 105, 106, 107, 108, 109, 110, 111, 31}, // SKINCOLOR_HANDHELD
{ 0, 80, 80, 81, 88, 89, 90, 91, 92, 93, 94, 95, 109, 110, 111, 31}, // SKINCOLOR_TEA
{ 0, 80, 88, 88, 89, 90, 91, 102, 103, 104, 105, 106, 107, 108, 109, 110}, // SKINCOLOR_PISTACHIO
{ 88, 89, 90, 91, 91, 92, 93, 94, 107, 107, 108, 108, 109, 109, 110, 111}, // SKINCOLOR_MOSS
{208, 84, 85, 240, 241, 243, 245, 94, 107, 108, 108, 109, 109, 110, 110, 111}, // SKINCOLOR_CAMOUFLAGE
{ 0, 88, 88, 89, 89, 100, 101, 102, 125, 126, 143, 143, 138, 175, 169, 254}, // SKINCOLOR_MINT
{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}, // SKINCOLOR_GREEN
{ 97, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 30, 30, 31}, // SKINCOLOR_PINETREE
{ 96, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 111}, // SKINCOLOR_TURTLE
{ 96, 112, 113, 114, 115, 116, 117, 118, 119, 119, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP
{ 0, 0, 208, 208, 48, 89, 98, 100, 148, 148, 172, 172, 173, 173, 174, 175}, // SKINCOLOR_DREAM
{ 80, 88, 96, 112, 113, 124, 142, 149, 149, 173, 174, 175, 169, 253, 254, 31}, // SKINCOLOR_PLAGUE
{ 0, 120, 121, 112, 113, 114, 115, 125, 125, 126, 126, 127, 138, 175, 253, 254}, // SKINCOLOR_EMERALD
{128, 129, 130, 131, 132, 133, 134, 115, 115, 116, 116, 117, 118, 119, 110, 111}, // SKINCOLOR_ALGAE
{ 0, 128, 120, 121, 122, 123, 124, 125, 126, 126, 127, 127, 118, 118, 119, 111}, // SKINCOLOR_AQUAMARINE
{128, 120, 121, 122, 123, 141, 141, 142, 142, 143, 143, 138, 138, 139, 139, 31}, // SKINCOLOR_TURQUOISE
{ 0, 120, 120, 121, 140, 141, 142, 143, 143, 138, 138, 139, 139, 254, 254, 31}, // SKINCOLOR_TEAL
{ 0, 80, 81, 82, 83, 88, 121, 140, 133, 133, 134, 135, 136, 137, 138, 139}, // SKINCOLOR_ROBIN
{ 0, 0, 128, 128, 255, 131, 132, 134, 142, 142, 143, 127, 118, 119, 110, 111}, // SKINCOLOR_CYAN
{ 0, 0, 128, 128, 129, 146, 133, 134, 135, 149, 149, 173, 173, 174, 175, 31}, // SKINCOLOR_JAWZ
{ 0, 128, 129, 130, 131, 132, 133, 135, 136, 136, 137, 137, 138, 138, 139, 31}, // SKINCOLOR_CERULEAN
{128, 129, 130, 132, 134, 135, 136, 137, 137, 138, 138, 139, 139, 29, 30, 31}, // SKINCOLOR_NAVY
{ 0, 0, 0, 144, 144, 145, 9, 11, 14, 142, 136, 137, 138, 138, 139, 31}, // SKINCOLOR_PLATINUM
{ 0, 0, 144, 144, 144, 145, 145, 145, 170, 170, 171, 171, 172, 173, 174, 175}, // SKINCOLOR_SLATE
{ 0, 144, 144, 145, 145, 170, 170, 171, 171, 172, 172, 173, 173, 174, 175, 31}, // SKINCOLOR_STEEL
{ 80, 81, 82, 83, 64, 65, 11, 171, 172, 173, 173, 157, 158, 159, 254, 31}, // SKINCOLOR_THUNDER
{ 0, 83, 49, 50, 51, 32, 192, 148, 148, 172, 173, 174, 175, 29, 30, 31}, // SKINCOLOR_NOVA
{208, 48, 216, 217, 240, 241, 242, 171, 172, 173, 24, 25, 26, 28, 29, 31}, // SKINCOLOR_RUST
{ 48, 218, 221, 224, 227, 231, 196, 173, 173, 174, 159, 159, 253, 253, 254, 31}, // SKINCOLOR_WRISTWATCH
{145, 146, 147, 148, 149, 173, 173, 174, 175, 175, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET
{ 0, 128, 129, 131, 133, 135, 149, 150, 152, 154, 156, 158, 159, 253, 254, 31}, // SKINCOLOR_SAPPHIRE
{ 0, 0, 120, 120, 121, 133, 135, 149, 149, 166, 166, 167, 168, 169, 254, 31}, // SKINCOLOR_ULTRAMARINE
{ 0, 0, 144, 144, 145, 146, 147, 149, 150, 152, 154, 155, 157, 159, 253, 254}, // SKINCOLOR_PERIWINKLE
{144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 158, 253, 254, 31}, // SKINCOLOR_BLUE
{146, 148, 149, 150, 152, 153, 155, 157, 159, 253, 253, 254, 254, 31, 31, 31}, // SKINCOLOR_MIDNIGHT
{ 0, 144, 145, 146, 147, 171, 172, 166, 166, 167, 167, 168, 168, 175, 169, 253}, // SKINCOLOR_BLUEBERRY
{ 0, 0, 0, 252, 252, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_THISTLE
{ 0, 252, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 169, 253, 254}, // SKINCOLOR_PURPLE
{ 0, 128, 128, 129, 129, 146, 170, 162, 163, 164, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_PASTEL
{ 0, 144, 145, 146, 170, 162, 163, 184, 184, 207, 207, 44, 45, 46, 47, 31}, // SKINCOLOR_MOONSET
{252, 200, 201, 192, 193, 194, 172, 172, 173, 173, 174, 174, 175, 169, 253, 254}, // SKINCOLOR_DUSK
{176, 177, 178, 179, 180, 181, 182, 183, 184, 165, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_VIOLET
{252, 200, 177, 177, 178, 179, 180, 181, 182, 183, 183, 184, 185, 186, 187, 31}, // SKINCOLOR_MAGENTA
{208, 209, 209, 32, 33, 182, 183, 184, 185, 185, 186, 186, 187, 253, 254, 31}, // SKINCOLOR_FUCHSIA
{ 0, 0, 88, 88, 89, 6, 8, 10, 193, 194, 195, 184, 185, 186, 187, 31}, // SKINCOLOR_TOXIC
{ 80, 81, 82, 83, 64, 50, 201, 192, 193, 194, 195, 173, 174, 175, 253, 254}, // SKINCOLOR_MAUVE
{252, 177, 179, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_LAVENDER
{145, 192, 193, 194, 195, 196, 197, 198, 199, 199, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM
{208, 209, 210, 211, 212, 213, 214, 195, 195, 196, 196, 197, 198, 199, 29, 30}, // SKINCOLOR_POMEGRANATE
{ 0, 0, 0, 252, 252, 176, 200, 201, 179, 192, 193, 194, 195, 196, 197, 198}, // SKINCOLOR_LILAC
{ 0, 252, 252, 176, 200, 177, 201, 202, 202, 34, 36, 38, 40, 42, 45, 46}, // SKINCOLOR_BLOSSOM
{ 0, 252, 252, 200, 200, 201, 202, 203, 204, 204, 205, 206, 207, 43, 45, 47}, // SKINCOLOR_TAFFY
// THESE STILL NEED CONVERTED!!!
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2
{ 0, 0, 0, 0, 0, 0, 96, 98, 100, 102, 104, 113, 114, 116, 117, 119}, // SKINCOLOR_SUPER3
{ 0, 0, 0, 0, 96, 97, 99, 100, 102, 104, 113, 114, 115, 116, 117, 119}, // SKINCOLOR_SUPER4
{ 0, 0, 96, 0, 0, 0, 0, 0, 104, 113, 114, 115, 116, 117, 118, 119}, // SKINCOLOR_SUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 82, 85, 115, 117, 119}, // SKINCOLOR_TSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, 85, 115, 116, 117, 119}, // SKINCOLOR_TSUPER2
{ 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 85, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER3
{ 0, 0, 0, 0, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER4
{ 0, 0, 80, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 117, 118, 119}, // SKINCOLOR_TSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 123, 125, 127, 129, 132}, // SKINCOLOR_KSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 121, 122, 124, 125, 127, 128, 130, 132}, // SKINCOLOR_KSUPER2
{ 0, 0, 0, 0, 0, 0, 121, 122, 123, 124, 125, 127, 128, 129, 130, 132}, // SKINCOLOR_KSUPER3
{ 0, 0, 0, 0, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER4
{ 0, 0, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 122, 124, 248, 251, 255}, // SKINCOLOR_PSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 121, 122, 124, 248, 250, 252, 255}, // SKINCOLOR_PSUPER2
{ 0, 0, 0, 0, 0, 0, 1, 121, 122, 123, 124, 248, 249, 251, 253, 255}, // SKINCOLOR_PSUPER3
{ 0, 0, 0, 0, 1, 121, 122, 123, 124, 248, 249, 250, 251, 252, 253, 255}, // SKINCOLOR_PSUPER4
{ 0, 0, 1, 121, 122, 123, 124, 248, 248, 249, 250, 251, 252, 253, 254, 255}, // SKINCOLOR_PSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 225, 227, 228, 230, 232}, // SKINCOLOR_BSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 224, 225, 226, 227, 228, 229, 230, 232}, // SKINCOLOR_BSUPER2
{ 0, 0, 0, 0, 0, 0, 224, 224, 225, 226, 227, 228, 229, 230, 231, 232}, // SKINCOLOR_BSUPER3
{ 0, 0, 0, 0, 224, 224, 225, 226, 226, 227, 228, 229, 229, 230, 231, 232}, // SKINCOLOR_BSUPER4
{ 0, 0, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 232}, // SKINCOLOR_BSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2
{ 0, 0, 0, 0, 0, 0, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3
{ 0, 0, 0, 0, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4
{ 0, 0, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, 160, 163, 167, 171, 175}, // SKINCOLOR_GSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 176, 176, 160, 163, 166, 169, 172, 175}, // SKINCOLOR_GSUPER2
{ 0, 0, 0, 0, 0, 0, 176, 176, 160, 162, 164, 166, 168, 170, 172, 175}, // SKINCOLOR_GSUPER3
{ 0, 0, 0, 0, 176, 176, 176, 160, 161, 163, 165, 167, 169, 171, 173, 175}, // SKINCOLOR_GSUPER4
{ 0, 0, 176, 176, 176, 160, 161, 163, 164, 166, 167, 169, 170, 172, 173, 175}, // SKINCOLOR_GSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_WSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9}, // SKINCOLOR_WSUPER2
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 8, 11}, // SKINCOLOR_WSUPER3
{ 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 4, 6, 8, 9, 11, 13}, // SKINCOLOR_WSUPER4
{ 0, 0, 0, 0, 1, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 15}, // SKINCOLOR_WSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 98, 99, 81, 73, 79}, // SKINCOLOR_CSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 81, 81, 71, 75, 79}, // SKINCOLOR_CSUPER2
{ 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3
{ 0, 0, 0, 0, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4
{ 0, 0, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5
};
/*--------------------------------------------------
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b)
See header file for description.
--------------------------------------------------*/
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b)
{
UINT32 redweight = 1063 * r;
UINT32 greenweight = 3576 * g;
UINT32 blueweight = 361 * b;
UINT32 brightness = (redweight + greenweight + blueweight) / 5000;
return min(brightness, UINT8_MAX);
}
/*--------------------------------------------------
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
See header file for description.
--------------------------------------------------*/
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
{
INT32 i;
RGBA_t color;
UINT8 brightness;
INT32 j;
UINT8 colorbrightnesses[16];
UINT16 brightdif;
INT32 temp;
// first generate the brightness of all the colours of that skincolour
for (i = 0; i < 16; i++)
{
color = V_GetColor(colortranslations[skincolor][i]);
colorbrightnesses[i] = K_ColorRelativeLuminance(color.s.red, color.s.green, color.s.blue);
}
// next, for every colour in the palette, choose the transcolor that has the closest brightness
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (i == 0 || i == 31) // pure black and pure white don't change
{
dest_colormap[i] = (UINT8)i;
continue;
}
color = V_GetColor(i);
brightness = K_ColorRelativeLuminance(color.s.red, color.s.green, color.s.blue);
brightdif = 256;
for (j = 0; j < 16; j++)
{
temp = abs((INT16)brightness - (INT16)colorbrightnesses[j]);
if (temp < brightdif)
{
brightdif = (UINT16)temp;
dest_colormap[i] = colortranslations[skincolor][j];
}
}
}
}
/** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
\param dest_colormap colormap to populate
\param skinnum number of skin, TC_DEFAULT or TC_BOSS
\param color translation color
\return void
*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
INT32 i;
INT32 starttranscolor;
// Handle a couple of simple special cases
if (skinnum == TC_BOSS
|| skinnum == TC_ALLWHITE
|| skinnum == TC_METALSONIC
|| skinnum == TC_BLINK
|| color == SKINCOLOR_NONE)
{
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (skinnum == TC_ALLWHITE)
dest_colormap[i] = 0;
else if (skinnum == TC_BLINK)
dest_colormap[i] = colortranslations[color][3];
else
dest_colormap[i] = (UINT8)i;
}
// White!
if (skinnum == TC_BOSS)
dest_colormap[31] = 0;
else if (skinnum == TC_METALSONIC)
dest_colormap[143] = 0;
return;
}
else if (skinnum == TC_RAINBOW)
{
K_RainbowColormap(dest_colormap, color);
return;
}
starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
// Fill in the entries of the palette that are fixed
for (i = 0; i < starttranscolor; i++)
dest_colormap[i] = (UINT8)i;
for (i = (UINT8)(starttranscolor + 16); i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
// Build the translated ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
{
// Sryder 2017-10-26: What was here before was most definitely not particularly readable, check above for new color translation table
dest_colormap[starttranscolor + i] = colortranslations[color][i];
}
}
/** \brief Pulls kart color by name, to replace R_GetColorByName in r_draw.c
\param name color name
\return 0
*/
UINT8 K_GetKartColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);
if (color > 0 && color < MAXSKINCOLORS)
return color;
for (color = 1; color < MAXSKINCOLORS; color++)
if (!stricmp(KartColor_Names[color], name))
return color;
return 0;
}
//}

87
src/k_color.h Normal file
View file

@ -0,0 +1,87 @@
// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Kart Krew
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file k_color.h
/// \brief Skincolor & colormapping code
#ifndef __K_COLOR__
#define __K_COLOR__
#include "doomdef.h"
#include "doomtype.h"
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 96
#define NUM_PALETTE_ENTRIES 256
extern UINT8 colortranslations[MAXTRANSLATIONS][16];
extern const char *KartColor_Names[MAXSKINCOLORS];
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
/*--------------------------------------------------
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b);
Gives you the brightness value of the provided RGB value, based on how the human eye interprets it.
See https://en.wikipedia.org/wiki/Relative_luminance for more info.
Input Arguments:-
r - Red component
g - Green component
b - Blue component
Return:-
Brightness value from 0 to 255.
--------------------------------------------------*/
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b);
/*--------------------------------------------------
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
Generates a colormap to "colorize" all palette indicies
to the provided skincolor.
Input Arguments:-
dest_colormap - Colormap to populate.
skincolor - Translation color.
Return:-
None
--------------------------------------------------*/
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
/*--------------------------------------------------
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
Input Arguments:-
dest_colormap - Colormap to populate.
skinnum - Number of skin or translation mode (TC_ constants)
color - Translation color.
Return:-
None
--------------------------------------------------*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
/*--------------------------------------------------
UINT8 K_GetKartColorByName(const char *name);
Finds the corresponding SKINCOLOR_ constant to the string provided.
Input Arguments:-
name - The name of the color desired.
Return:-
SKINCOLOR_ constant, SKINCOLOR_NONE if invalid
--------------------------------------------------*/
UINT8 K_GetKartColorByName(const char *name);
#endif

View file

@ -7,6 +7,7 @@
#include "k_kart.h"
#include "k_battle.h"
#include "k_pwrlv.h"
#include "k_color.h"
#include "doomdef.h"
#include "hu_stuff.h"
#include "g_game.h"
@ -38,511 +39,6 @@
// indirectitemcooldown is timer before anyone's allowed another Shrink/SPB
// mapreset is set when enough players fill an empty server
//{ SRB2kart Color Code
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 96
#define NUM_PALETTE_ENTRIES 256
// These should be within 14 characters to fit on the character select screen
const char *KartColor_Names[MAXSKINCOLORS] =
{
"None", // SKINCOLOR_NONE
"White", // SKINCOLOR_WHITE
"Silver", // SKINCOLOR_SILVER
"Grey", // SKINCOLOR_GREY
"Nickel", // SKINCOLOR_NICKEL
"Black", // SKINCOLOR_BLACK
"Fairy", // SKINCOLOR_FAIRY
"Popcorn", // SKINCOLOR_POPCORN
"Artichoke", // SKINCOLOR_ARTICHOKE
"Pigeon", // SKINCOLOR_PIGEON
"Sepia", // SKINCOLOR_SEPIA
"Beige", // SKINCOLOR_BEIGE
"Caramel", // SKINCOLOR_CARAMEL
"Peach", // SKINCOLOR_PEACH
"Brown", // SKINCOLOR_BROWN
"Leather", // SKINCOLOR_LEATHER
"Salmon", // SKINCOLOR_SALMON
"Pink", // SKINCOLOR_PINK
"Rose", // SKINCOLOR_ROSE
"Cinnamon", // SKINCOLOR_CINNAMON
"Ruby", // SKINCOLOR_RUBY
"Raspberry", // SKINCOLOR_RASPBERRY
"Red", // SKINCOLOR_RED
"Crimson", // SKINCOLOR_CRIMSON
"Maroon", // SKINCOLOR_MAROON
"Lemonade", // SKINCOLOR_LEMONADE
"Scarlet", // SKINCOLOR_SCARLET
"Ketchup", // SKINCOLOR_KETCHUP
"Dawn", // SKINCOLOR_DAWN
"Sunslam", // SKINCOLOR_SUNSLAM
"Creamsicle", // SKINCOLOR_CREAMSICLE
"Orange", // SKINCOLOR_ORANGE
"Rosewood", // SKINCOLOR_ROSEWOOD
"Tangerine", // SKINCOLOR_TANGERINE
"Tan", // SKINCOLOR_TAN
"Cream", // SKINCOLOR_CREAM
"Gold", // SKINCOLOR_GOLD
"Royal", // SKINCOLOR_ROYAL
"Bronze", // SKINCOLOR_BRONZE
"Copper", // SKINCOLOR_COPPER
"Yellow", // SKINCOLOR_YELLOW
"Mustard", // SKINCOLOR_MUSTARD
"Banana", // SKINCOLOR_BANANA
"Olive", // SKINCOLOR_OLIVE
"Crocodile", // SKINCOLOR_CROCODILE
"Peridot", // SKINCOLOR_PERIDOT
"Vomit", // SKINCOLOR_VOMIT
"Garden", // SKINCOLOR_GARDEN
"Lime", // SKINCOLOR_LIME
"Handheld", // SKINCOLOR_HANDHELD
"Tea", // SKINCOLOR_TEA
"Pistachio", // SKINCOLOR_PISTACHIO
"Moss", // SKINCOLOR_MOSS
"Camouflage", // SKINCOLOR_CAMOUFLAGE
"Robo-Hood", // SKINCOLOR_ROBOHOOD
"Mint", // SKINCOLOR_MINT
"Green", // SKINCOLOR_GREEN
"Pinetree", // SKINCOLOR_PINETREE
"Turtle", // SKINCOLOR_TURTLE
"Swamp", // SKINCOLOR_SWAMP
"Dream", // SKINCOLOR_DREAM
"Plague", // SKINCOLOR_PLAGUE
"Emerald", // SKINCOLOR_EMERALD
"Algae", // SKINCOLOR_ALGAE
"Caribbean", // SKINCOLOR_CARIBBEAN
"Azure", // SKINCOLOR_AZURE
"Aquamarine", // SKINCOLOR_AQUAMARINE
"Turquoise", // SKINCOLOR_TURQUOISE
"Teal", // SKINCOLOR_TEAL
"Cyan", // SKINCOLOR_CYAN
"Jawz", // SKINCOLOR_JAWZ
"Cerulean", // SKINCOLOR_CERULEAN
"Navy", // SKINCOLOR_NAVY
"Platinum", // SKINCOLOR_PLATINUM
"Slate", // SKINCOLOR_SLATE
"Steel", // SKINCOLOR_STEEL
"Thunder", // SKINCOLOR_THUNDER
"Nova", // SKINCOLOR_NOVA
"Rust", // SKINCOLOR_RUST
"Wristwatch", // SKINCOLOR_WRISTWATCH
"Jet", // SKINCOLOR_JET
"Sapphire", // SKINCOLOR_SAPPHIRE
"Ultramarine", // SKINCOLOR_ULTRAMARINE
"Periwinkle", // SKINCOLOR_PERIWINKLE
"Blue", // SKINCOLOR_BLUE
"Blueberry", // SKINCOLOR_BLUEBERRY
"Thistle", // SKINCOLOR_THISTLE
"Purple", // SKINCOLOR_PURPLE
"Pastel", // SKINCOLOR_PASTEL
"Moonset", // SKINCOLOR_MOONSET
"Dusk", // SKINCOLOR_DUSK
"Violet", // SKINCOLOR_VIOLET
"Magenta", // SKINCOLOR_MAGENTA
"Fuchsia", // SKINCOLOR_FUCHSIA
"Toxic", // SKINCOLOR_TOXIC
"Mauve", // SKINCOLOR_MAUVE
"Lavender", // SKINCOLOR_LAVENDER
"Byzantium", // SKINCOLOR_BYZANTIUM
"Pomegranate", // SKINCOLOR_POMEGRANATE
"Lilac", // SKINCOLOR_LILAC
"Taffy" // SKINCOLOR_TAFFY
};
// Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later
const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] =
{
SKINCOLOR_NONE,8, // SKINCOLOR_NONE
SKINCOLOR_BLACK,8, // SKINCOLOR_WHITE
SKINCOLOR_NICKEL,8, // SKINCOLOR_SILVER
SKINCOLOR_GREY,8, // SKINCOLOR_GREY
SKINCOLOR_SILVER,8, // SKINCOLOR_NICKEL
SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK
SKINCOLOR_ARTICHOKE,12, // SKINCOLOR_FAIRY
SKINCOLOR_PIGEON,12, // SKINCOLOR_POPCORN
SKINCOLOR_FAIRY,12, // SKINCOLOR_ARTICHOKE
SKINCOLOR_POPCORN,12, // SKINCOLOR_PIGEON
SKINCOLOR_LEATHER,6, // SKINCOLOR_SEPIA
SKINCOLOR_BROWN,2, // SKINCOLOR_BEIGE
SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL
SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH
SKINCOLOR_BEIGE,8, // SKINCOLOR_BROWN
SKINCOLOR_SEPIA,8, // SKINCOLOR_LEATHER
SKINCOLOR_TEA,8, // SKINCOLOR_SALMON
SKINCOLOR_PISTACHIO,8, // SKINCOLOR_PINK
SKINCOLOR_MOSS,8, // SKINCOLOR_ROSE
SKINCOLOR_WRISTWATCH,6, // SKINCOLOR_CINNAMON
SKINCOLOR_SAPPHIRE,8, // SKINCOLOR_RUBY
SKINCOLOR_MINT,8, // SKINCOLOR_RASPBERRY
SKINCOLOR_GREEN,6, // SKINCOLOR_RED
SKINCOLOR_PINETREE,6, // SKINCOLOR_CRIMSON
SKINCOLOR_TOXIC,8, // SKINCOLOR_MAROON
SKINCOLOR_THUNDER,8, // SKINCOLOR_LEMONADE
SKINCOLOR_ALGAE,10, // SKINCOLOR_SCARLET
SKINCOLOR_MUSTARD,10, // SKINCOLOR_KETCHUP
SKINCOLOR_DUSK,8, // SKINCOLOR_DAWN
SKINCOLOR_MOONSET,8, // SKINCOLOR_SUNSLAM
SKINCOLOR_PERIWINKLE,8, // SKINCOLOR_CREAMSICLE
SKINCOLOR_BLUE,8, // SKINCOLOR_ORANGE
SKINCOLOR_BLUEBERRY,6, // SKINCOLOR_ROSEWOOD
SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE
SKINCOLOR_RUST,8, // SKINCOLOR_TAN
SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM
SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD
SKINCOLOR_PLATINUM,6, // SKINCOLOR_ROYAL
SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE
SKINCOLOR_CREAM,6, // SKINCOLOR_COPPER
SKINCOLOR_AQUAMARINE,8, // SKINCOLOR_YELLOW
SKINCOLOR_KETCHUP,8, // SKINCOLOR_MUSTARD
SKINCOLOR_EMERALD,8, // SKINCOLOR_BANANA
SKINCOLOR_TEAL,8, // SKINCOLOR_OLIVE
SKINCOLOR_VIOLET,8, // SKINCOLOR_CROCODILE
SKINCOLOR_NAVY,6, // SKINCOLOR_PERIDOT
SKINCOLOR_ROBOHOOD,8, // SKINCOLOR_VOMIT
SKINCOLOR_LAVENDER,6, // SKINCOLOR_GARDEN
SKINCOLOR_TANGERINE,8, // SKINCOLOR_LIME
SKINCOLOR_ULTRAMARINE,8, // SKINCOLOR_HANDHELD
SKINCOLOR_SALMON,8, // SKINCOLOR_TEA
SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO
SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS
SKINCOLOR_CAMOUFLAGE,8, // SKINCOLOR_CAMOUFLAGE
SKINCOLOR_VOMIT,8, // SKINCOLOR_ROBOHOOD
SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT
SKINCOLOR_RED,8, // SKINCOLOR_GREEN
SKINCOLOR_CRIMSON,8, // SKINCOLOR_PINETREE
SKINCOLOR_MAGENTA,8, // SKINCOLOR_TURTLE
SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP
SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM
SKINCOLOR_NOVA,8, // SKINCOLOR_PLAGUE
SKINCOLOR_BANANA,8, // SKINCOLOR_EMERALD
SKINCOLOR_SCARLET,10, // SKINCOLOR_ALGAE
SKINCOLOR_PURPLE,8, // SKINCOLOR_CARIBBEAN
SKINCOLOR_THISTLE,8, // SKINCOLOR_AZURE
SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUAMARINE
SKINCOLOR_MAUVE,10, // SKINCOLOR_TURQUOISE
SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL
SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN
SKINCOLOR_LILAC,10, // SKINCOLOR_JAWZ
SKINCOLOR_CARAMEL,8, // SKINCOLOR_CERULEAN
SKINCOLOR_PERIDOT,8, // SKINCOLOR_NAVY
SKINCOLOR_ROYAL,8, // SKINCOLOR_PLATINUM
SKINCOLOR_GOLD,10, // SKINCOLOR_SLATE
SKINCOLOR_BRONZE,10, // SKINCOLOR_STEEL
SKINCOLOR_LEMONADE,8, // SKINCOLOR_THUNDER
SKINCOLOR_PLAGUE,10, // SKINCOLOR_NOVA
SKINCOLOR_TAN,8, // SKINCOLOR_RUST
SKINCOLOR_CINNAMON,8, // SKINCOLOR_WRISTWATCH
SKINCOLOR_TAFFY,8, // SKINCOLOR_JET
SKINCOLOR_RUBY,6, // SKINCOLOR_SAPPHIRE
SKINCOLOR_HANDHELD,10, // SKINCOLOR_ULTRAMARINE
SKINCOLOR_CREAMSICLE,8, // SKINCOLOR_PERIWINKLE
SKINCOLOR_ORANGE,8, // SKINCOLOR_BLUE
SKINCOLOR_ROSEWOOD,8, // SKINCOLOR_BLUEBERRY
SKINCOLOR_AZURE,8, // SKINCOLOR_THISTLE
SKINCOLOR_CARIBBEAN,10, // SKINCOLOR_PURPLE
SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL
SKINCOLOR_SUNSLAM,10, // SKINCOLOR_MOONSET
SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK
SKINCOLOR_CROCODILE,8, // SKINCOLOR_VIOLET
SKINCOLOR_TURTLE,8, // SKINCOLOR_MAGENTA
SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA
SKINCOLOR_MAROON,8, // SKINCOLOR_TOXIC
SKINCOLOR_TURQUOISE,8, // SKINCOLOR_MAUVE
SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER
SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM
SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE
SKINCOLOR_JAWZ,6, // SKINCOLOR_LILAC
SKINCOLOR_JET,8 // SKINCOLOR_TAFFY
};
UINT8 colortranslations[MAXTRANSLATIONS][16] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE
{ 0, 0, 0, 0, 1, 2, 5, 8, 9, 11, 14, 17, 20, 22, 25, 28}, // SKINCOLOR_WHITE
{ 0, 1, 2, 3, 5, 7, 9, 12, 13, 15, 18, 20, 23, 25, 27, 30}, // SKINCOLOR_SILVER
{ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY
{ 3, 5, 8, 11, 15, 17, 19, 21, 23, 24, 25, 26, 27, 29, 30, 31}, // SKINCOLOR_NICKEL
{ 4, 7, 11, 15, 20, 22, 24, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK
{ 0, 0, 252, 252, 200, 201, 211, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_FAIRY
{ 0, 80, 80, 81, 82, 218, 240, 11, 13, 16, 18, 21, 23, 26, 28, 31}, // SKINCOLOR_POPCORN
{ 80, 88, 89, 98, 99, 91, 12, 14, 16, 18, 20, 22, 24, 26, 28, 31}, // SKINCOLOR_ARTICHOKE
{ 0, 128, 129, 130, 146, 170, 14, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_PIGEON
{ 0, 1, 3, 5, 7, 9, 241, 242, 243, 245, 247, 249, 236, 237, 238, 239}, // SKINCOLOR_SEPIA
{ 0, 208, 216, 217, 240, 241, 242, 243, 245, 247, 249, 250, 251, 237, 238, 239}, // SKINCOLOR_BEIGE
{208, 48, 216, 217, 218, 220, 221, 223, 224, 226, 228, 230, 232, 234, 236, 239}, // SKINCOLOR_CARAMEL
{ 0, 208, 48, 216, 218, 221, 212, 213, 214, 215, 206, 207, 197, 198, 199, 254}, // SKINCOLOR_PEACH
{216, 217, 219, 221, 224, 225, 227, 229, 230, 232, 234, 235, 237, 239, 29, 30}, // SKINCOLOR_BROWN
{218, 221, 224, 227, 229, 231, 233, 235, 237, 239, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER
{ 0, 0, 0, 208, 208, 209, 210, 32, 34, 35, 36, 38, 40, 42, 44, 46}, // SKINCOLOR_SALMON
{ 0, 208, 208, 209, 209, 210, 211, 211, 212, 213, 214, 215, 41, 43, 45, 46}, // SKINCOLOR_PINK
{209, 210, 211, 211, 212, 213, 214, 215, 41, 42, 43, 44, 45, 71, 46, 47}, // SKINCOLOR_ROSE
{216, 221, 224, 226, 228, 60, 61, 43, 44, 45, 71, 46, 47, 29, 30, 31}, // SKINCOLOR_CINNAMON
{ 0, 208, 209, 210, 211, 213, 39, 40, 41, 43, 186, 186, 169, 169, 253, 254}, // SKINCOLOR_RUBY
{ 0, 208, 209, 210, 32, 33, 34, 35, 37, 39, 41, 43, 44, 45, 46, 47}, // SKINCOLOR_RASPBERRY
{209, 210, 32, 34, 36, 38, 39, 40, 41, 42, 43, 44 , 45, 71, 46, 47}, // SKINCOLOR_RED
{210, 33, 35, 38, 40, 42, 43, 45, 71, 71, 46, 46, 47, 47, 30, 31}, // SKINCOLOR_CRIMSON
{ 32, 33, 35, 37, 39, 41, 43, 237, 26, 26, 27, 27, 28, 29, 30, 31}, // SKINCOLOR_MAROON
{ 0, 80, 81, 82, 83, 216, 210, 211, 212, 213, 214, 215, 43, 44, 71, 47}, // SKINCOLOR_LEMONADE
{ 48, 49, 50, 51, 53, 34, 36, 38, 184, 185, 168, 168, 169, 169, 254, 31}, // SKINCOLOR_SCARLET
{ 72, 73, 64, 51, 52, 54, 34, 36, 38, 40, 42, 43, 44, 71, 46, 47}, // SKINCOLOR_KETCHUP
{ 0, 208, 216, 209, 210, 211, 212, 57, 58, 59, 60, 61, 63, 71, 47, 31}, // SKINCOLOR_DAWN
{ 82, 72, 73, 64, 51, 53, 55, 213, 214, 195, 195, 173, 174, 175, 253, 254}, // SKINCOLOR_SUNSLAM
{ 0, 0, 208, 208, 48, 49, 50, 52, 53, 54, 56, 57, 58, 60, 61, 63}, // SKINCOLOR_CREAMSICLE
{208, 48, 49, 50, 51, 52, 53, 54, 55, 57, 59, 60, 62, 44, 71, 47}, // SKINCOLOR_ORANGE
{ 50, 52, 55, 56, 58, 59, 60, 61, 62, 63, 44, 45, 71, 46, 47, 30}, // SKINCOLOR_ROSEWOOD
{ 80, 81, 82, 83, 64, 51, 52, 54, 55, 57, 58, 60, 61, 63, 71, 47}, // SKINCOLOR_TANGERINE
{ 0, 80, 81, 82, 83, 84, 85, 86, 87, 245, 246, 248, 249, 251, 237, 239}, // SKINCOLOR_TAN
{ 0, 80, 80, 81, 81, 49, 51, 222, 224, 227, 230, 233, 236, 239, 29, 31}, // SKINCOLOR_CREAM
{ 0, 80, 81, 83, 64, 65, 66, 67, 68, 215, 69, 70, 44, 71, 46, 47}, // SKINCOLOR_GOLD
{ 80, 81, 83, 64, 65, 223, 229, 196, 196, 197, 197, 198, 199, 29, 30, 31}, // SKINCOLOR_ROYAL
{ 83, 64, 65, 66, 67, 215, 69, 70, 44, 44, 45, 71, 46, 47, 29, 31}, // SKINCOLOR_BRONZE
{ 0, 82, 64, 65, 67, 68, 70, 237, 239, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_COPPER
{ 0, 80, 81, 82, 83, 73, 84, 74, 64, 65, 66, 67, 68, 69, 70, 71}, // SKINCOLOR_YELLOW
{ 80, 81, 82, 83, 64, 65, 65, 76, 76, 77, 77, 78, 79, 237, 239, 29}, // SKINCOLOR_MUSTARD
{ 80, 81, 83, 72, 73, 74, 75, 76, 77, 78, 79, 236, 237, 238, 239, 30}, // SKINCOLOR_BANANA
{ 80, 82, 73, 74, 75, 76, 77, 78, 79, 236, 237, 238, 239, 28, 29, 31}, // SKINCOLOR_OLIVE
{ 0, 80, 81, 88, 88, 188, 189, 76, 76, 77, 78, 79, 236, 237, 238, 239}, // SKINCOLOR_CROCODILE
{ 0, 80, 81, 88, 188, 189, 190, 191, 94, 94, 95, 95, 109, 110, 111, 31}, // SKINCOLOR_PERIDOT
{ 0, 208, 216, 209, 218, 51, 65, 76, 191, 191, 126, 143, 138, 175, 169, 254}, // SKINCOLOR_VOMIT
{ 81, 82, 83, 73, 64, 65, 66, 92, 92, 93, 93, 94, 95, 109, 110, 111}, // SKINCOLOR_GARDEN
{ 0, 80, 81, 82, 83, 88, 89, 99, 100, 102, 104, 126, 143, 138, 139, 31}, // SKINCOLOR_LIME
{ 83, 72, 73, 74, 75, 76, 102, 104, 105, 106, 107, 108, 109, 110, 111, 31}, // SKINCOLOR_HANDHELD
{ 0, 80, 80, 81, 88, 89, 90, 91, 92, 93, 94, 95, 109, 110, 111, 31}, // SKINCOLOR_TEA
{ 0, 80, 88, 88, 89, 90, 91, 102, 103, 104, 105, 106, 107, 108, 109, 110}, // SKINCOLOR_PISTACHIO
{ 88, 89, 90, 91, 91, 92, 93, 94, 107, 107, 108, 108, 109, 109, 110, 111}, // SKINCOLOR_MOSS
{208, 84, 85, 240, 241, 243, 245, 94, 107, 108, 108, 109, 109, 110, 110, 111}, // SKINCOLOR_CAMOUFLAGE
{ 0, 88, 98, 101, 103, 104, 105, 94, 94, 107, 95, 109, 110, 111, 30, 31}, // SKINCOLOR_ROBOHOOD
{ 0, 88, 88, 89, 89, 100, 101, 102, 125, 126, 143, 143, 138, 175, 169, 254}, // SKINCOLOR_MINT
{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111}, // SKINCOLOR_GREEN
{ 97, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 30, 30, 31}, // SKINCOLOR_PINETREE
{ 96, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 119, 111}, // SKINCOLOR_TURTLE
{ 96, 112, 113, 114, 115, 116, 117, 118, 119, 119, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP
{ 0, 0, 208, 208, 48, 89, 98, 100, 148, 148, 172, 172, 173, 173, 174, 175}, // SKINCOLOR_DREAM
{ 80, 88, 96, 112, 113, 124, 142, 149, 149, 173, 174, 175, 169, 253, 254, 31}, // SKINCOLOR_PLAGUE
{ 0, 120, 121, 112, 113, 114, 115, 125, 125, 126, 126, 127, 138, 175, 253, 254}, // SKINCOLOR_EMERALD
{128, 128, 129, 129, 130, 140, 124, 103, 104, 116, 116, 117, 118, 119, 111, 31}, // SKINCOLOR_ALGAE
{ 0, 88, 89, 97, 113, 141, 135, 136, 136, 173, 173, 174, 174, 175, 199, 31}, // SKINCOLOR_CARIBBEAN
{ 0, 80, 81, 82, 89, 140, 134, 135, 136, 172, 196, 197, 198, 199, 30, 31}, // SKINCOLOR_AZURE
{ 0, 128, 120, 121, 122, 123, 124, 125, 126, 126, 127, 127, 118, 118, 119, 111}, // SKINCOLOR_AQUAMARINE
{128, 120, 121, 122, 123, 141, 141, 142, 142, 143, 143, 138, 138, 139, 139, 31}, // SKINCOLOR_TURQUOISE
{ 0, 120, 120, 121, 140, 141, 142, 143, 143, 138, 138, 139, 139, 254, 254, 31}, // SKINCOLOR_TEAL
{ 0, 0, 128, 128, 255, 131, 132, 134, 142, 142, 143, 127, 118, 119, 110, 111}, // SKINCOLOR_CYAN
{ 0, 0, 128, 128, 129, 146, 133, 134, 135, 149, 149, 173, 173, 174, 175, 31}, // SKINCOLOR_JAWZ
{ 0, 128, 129, 130, 131, 132, 133, 135, 136, 136, 137, 137, 138, 138, 139, 31}, // SKINCOLOR_CERULEAN
{128, 129, 130, 132, 134, 135, 136, 137, 137, 138, 138, 139, 139, 29, 30, 31}, // SKINCOLOR_NAVY
{ 0, 0, 0, 144, 144, 145, 9, 11, 14, 142, 136, 137, 138, 138, 139, 31}, // SKINCOLOR_PLATINUM
{ 0, 0, 144, 144, 144, 145, 145, 145, 170, 170, 171, 171, 172, 173, 174, 175}, // SKINCOLOR_SLATE
{ 0, 144, 144, 145, 145, 170, 170, 171, 171, 172, 172, 173, 173, 174, 175, 31}, // SKINCOLOR_STEEL
{ 80, 81, 82, 83, 64, 65, 11, 171, 172, 173, 173, 157, 158, 159, 254, 31}, // SKINCOLOR_THUNDER
{ 0, 83, 49, 50, 51, 32, 192, 148, 148, 172, 173, 174, 175, 29, 30, 31}, // SKINCOLOR_NOVA
{208, 48, 216, 217, 240, 241, 242, 171, 172, 173, 24, 25, 26, 28, 29, 31}, // SKINCOLOR_RUST
{ 48, 218, 221, 224, 227, 231, 196, 173, 173, 174, 159, 159, 253, 253, 254, 31}, // SKINCOLOR_WRISTWATCH
{145, 146, 147, 148, 149, 173, 173, 174, 175, 175, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET
{ 0, 128, 129, 131, 133, 135, 149, 150, 152, 154, 156, 158, 159, 253, 254, 31}, // SKINCOLOR_SAPPHIRE
{ 0, 0, 120, 120, 121, 133, 135, 149, 149, 166, 166, 167, 168, 169, 254, 31}, // SKINCOLOR_ULTRAMARINE
{ 0, 0, 144, 144, 145, 146, 147, 149, 150, 152, 154, 155, 157, 159, 253, 254}, // SKINCOLOR_PERIWINKLE
{144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 158, 253, 254, 31}, // SKINCOLOR_BLUE
{146, 148, 149, 150, 152, 153, 155, 157, 159, 253, 253, 254, 254, 31, 31, 31}, // SKINCOLOR_BLUEBERRY
{ 0, 0, 0, 252, 252, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_THISTLE
{ 0, 252, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 169, 253, 254}, // SKINCOLOR_PURPLE
{ 0, 128, 128, 129, 129, 146, 170, 162, 163, 164, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_PASTEL
{ 0, 144, 145, 146, 170, 162, 163, 184, 184, 207, 207, 44, 45, 46, 47, 31}, // SKINCOLOR_MOONSET
{252, 200, 201, 192, 193, 194, 172, 172, 173, 173, 174, 174, 175, 169, 253, 254}, // SKINCOLOR_DUSK
{176, 177, 178, 179, 180, 181, 182, 183, 184, 164, 165, 166, 167, 168, 169, 254}, // SKINCOLOR_VIOLET
{176, 177, 178, 179, 180, 181, 182, 183, 184, 184, 185, 185, 186, 187, 30, 31}, // SKINCOLOR_MAGENTA
{208, 209, 209, 32, 33, 182, 183, 184, 185, 185, 186, 186, 187, 253, 254, 31}, // SKINCOLOR_FUCHSIA
{ 0, 0, 88, 88, 89, 6, 8, 10, 193, 194, 195, 184, 185, 186, 187, 31}, // SKINCOLOR_TOXIC
{ 80, 81, 82, 83, 64, 50, 201, 192, 193, 194, 195, 173, 174, 175, 253, 254}, // SKINCOLOR_MAUVE
{252, 177, 179, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_LAVENDER
{145, 192, 193, 194, 195, 196, 197, 198, 199, 199, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM
{208, 209, 210, 211, 212, 213, 214, 195, 195, 196, 196, 197, 198, 199, 29, 30}, // SKINCOLOR_POMEGRANATE
{ 0, 0, 0, 252, 252, 176, 200, 201, 179, 192, 193, 194, 195, 196, 197, 198}, // SKINCOLOR_LILAC
{ 0, 252, 252, 200, 200, 201, 202, 203, 204, 204, 205, 206, 207, 43, 45, 47}, // SKINCOLOR_TAFFY
// THESE STILL NEED CONVERTED!!!
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2
{ 0, 0, 0, 0, 0, 0, 96, 98, 100, 102, 104, 113, 114, 116, 117, 119}, // SKINCOLOR_SUPER3
{ 0, 0, 0, 0, 96, 97, 99, 100, 102, 104, 113, 114, 115, 116, 117, 119}, // SKINCOLOR_SUPER4
{ 0, 0, 96, 0, 0, 0, 0, 0, 104, 113, 114, 115, 116, 117, 118, 119}, // SKINCOLOR_SUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 82, 85, 115, 117, 119}, // SKINCOLOR_TSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, 85, 115, 116, 117, 119}, // SKINCOLOR_TSUPER2
{ 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 85, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER3
{ 0, 0, 0, 0, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER4
{ 0, 0, 80, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 117, 118, 119}, // SKINCOLOR_TSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 123, 125, 127, 129, 132}, // SKINCOLOR_KSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 121, 122, 124, 125, 127, 128, 130, 132}, // SKINCOLOR_KSUPER2
{ 0, 0, 0, 0, 0, 0, 121, 122, 123, 124, 125, 127, 128, 129, 130, 132}, // SKINCOLOR_KSUPER3
{ 0, 0, 0, 0, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER4
{ 0, 0, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 122, 124, 248, 251, 255}, // SKINCOLOR_PSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 121, 122, 124, 248, 250, 252, 255}, // SKINCOLOR_PSUPER2
{ 0, 0, 0, 0, 0, 0, 1, 121, 122, 123, 124, 248, 249, 251, 253, 255}, // SKINCOLOR_PSUPER3
{ 0, 0, 0, 0, 1, 121, 122, 123, 124, 248, 249, 250, 251, 252, 253, 255}, // SKINCOLOR_PSUPER4
{ 0, 0, 1, 121, 122, 123, 124, 248, 248, 249, 250, 251, 252, 253, 254, 255}, // SKINCOLOR_PSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 225, 227, 228, 230, 232}, // SKINCOLOR_BSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 224, 225, 226, 227, 228, 229, 230, 232}, // SKINCOLOR_BSUPER2
{ 0, 0, 0, 0, 0, 0, 224, 224, 225, 226, 227, 228, 229, 230, 231, 232}, // SKINCOLOR_BSUPER3
{ 0, 0, 0, 0, 224, 224, 225, 226, 226, 227, 228, 229, 229, 230, 231, 232}, // SKINCOLOR_BSUPER4
{ 0, 0, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 232}, // SKINCOLOR_BSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2
{ 0, 0, 0, 0, 0, 0, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3
{ 0, 0, 0, 0, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4
{ 0, 0, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, 160, 163, 167, 171, 175}, // SKINCOLOR_GSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 176, 176, 160, 163, 166, 169, 172, 175}, // SKINCOLOR_GSUPER2
{ 0, 0, 0, 0, 0, 0, 176, 176, 160, 162, 164, 166, 168, 170, 172, 175}, // SKINCOLOR_GSUPER3
{ 0, 0, 0, 0, 176, 176, 176, 160, 161, 163, 165, 167, 169, 171, 173, 175}, // SKINCOLOR_GSUPER4
{ 0, 0, 176, 176, 176, 160, 161, 163, 164, 166, 167, 169, 170, 172, 173, 175}, // SKINCOLOR_GSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_WSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9}, // SKINCOLOR_WSUPER2
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 8, 11}, // SKINCOLOR_WSUPER3
{ 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 4, 6, 8, 9, 11, 13}, // SKINCOLOR_WSUPER4
{ 0, 0, 0, 0, 1, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 15}, // SKINCOLOR_WSUPER5
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 98, 99, 81, 73, 79}, // SKINCOLOR_CSUPER1
{ 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 81, 81, 71, 75, 79}, // SKINCOLOR_CSUPER2
{ 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3
{ 0, 0, 0, 0, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4
{ 0, 0, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5
};
// Define for getting accurate color brightness readings according to how the human eye sees them.
// https://en.wikipedia.org/wiki/Relative_luminance
// 0.2126 to red
// 0.7152 to green
// 0.0722 to blue
// (See this same define in hw_md2.c!)
#define SETBRIGHTNESS(brightness,r,g,b) \
brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000))
/** \brief Generates the rainbow colourmaps that are used when a player has the invincibility power
\param dest_colormap colormap to populate
\param skincolor translation color
*/
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
{
INT32 i;
RGBA_t color;
UINT8 brightness;
INT32 j;
UINT8 colorbrightnesses[16];
UINT16 brightdif;
INT32 temp;
// first generate the brightness of all the colours of that skincolour
for (i = 0; i < 16; i++)
{
color = V_GetColor(colortranslations[skincolor][i]);
SETBRIGHTNESS(colorbrightnesses[i], color.s.red, color.s.green, color.s.blue);
}
// next, for every colour in the palette, choose the transcolor that has the closest brightness
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (i == 0 || i == 31) // pure black and pure white don't change
{
dest_colormap[i] = (UINT8)i;
continue;
}
color = V_GetColor(i);
SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue);
brightdif = 256;
for (j = 0; j < 16; j++)
{
temp = abs((INT16)brightness - (INT16)colorbrightnesses[j]);
if (temp < brightdif)
{
brightdif = (UINT16)temp;
dest_colormap[i] = colortranslations[skincolor][j];
}
}
}
}
#undef SETBRIGHTNESS
/** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
\param dest_colormap colormap to populate
\param skinnum number of skin, TC_DEFAULT or TC_BOSS
\param color translation color
\return void
*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
{
INT32 i;
INT32 starttranscolor;
// Handle a couple of simple special cases
if (skinnum == TC_BOSS
|| skinnum == TC_ALLWHITE
|| skinnum == TC_METALSONIC
|| skinnum == TC_BLINK
|| color == SKINCOLOR_NONE)
{
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
{
if (skinnum == TC_ALLWHITE)
dest_colormap[i] = 0;
else if (skinnum == TC_BLINK)
dest_colormap[i] = colortranslations[color][3];
else
dest_colormap[i] = (UINT8)i;
}
// White!
if (skinnum == TC_BOSS)
dest_colormap[31] = 0;
else if (skinnum == TC_METALSONIC)
dest_colormap[143] = 0;
return;
}
else if (skinnum == TC_RAINBOW)
{
K_RainbowColormap(dest_colormap, color);
return;
}
starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
// Fill in the entries of the palette that are fixed
for (i = 0; i < starttranscolor; i++)
dest_colormap[i] = (UINT8)i;
for (i = (UINT8)(starttranscolor + 16); i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
// Build the translated ramp
for (i = 0; i < SKIN_RAMP_LENGTH; i++)
{
// Sryder 2017-10-26: What was here before was most definitely not particularly readable, check above for new color translation table
dest_colormap[starttranscolor + i] = colortranslations[color][i];
}
}
/** \brief Pulls kart color by name, to replace R_GetColorByName in r_draw.c
\param name color name
\return 0
*/
UINT8 K_GetKartColorByName(const char *name)
{
UINT8 color = (UINT8)atoi(name);
if (color > 0 && color < MAXSKINCOLORS)
return color;
for (color = 1; color < MAXSKINCOLORS; color++)
if (!stricmp(KartColor_Names[color], name))
return color;
return 0;
}
//}
player_t *K_GetItemBoxPlayer(mobj_t *mobj)
{
fixed_t closest = INT32_MAX;
@ -2448,49 +1944,183 @@ void K_RespawnChecker(player_t *player)
*/
void K_KartMoveAnimation(player_t *player)
{
const INT16 minturn = KART_FULLTURN/8;
SINT8 turndir = 0;
const fixed_t fastspeed = (K_GetKartSpeed(player, false) * 17) / 20; // 85%
const fixed_t speedthreshold = player->mo->scale / 8;
const boolean onground = P_IsObjectOnGround(player->mo);
ticcmd_t *cmd = &player->cmd;
// Standing frames - S_KART_STND1 S_KART_STND1_L S_KART_STND1_R
if (player->speed == 0)
const boolean spinningwheels = ((cmd->buttons & BT_ACCELERATE) || (onground && player->speed > 0));
if (cmd->driftturn < -minturn)
{
if (cmd->driftturn < 0 && !(player->mo->state >= &states[S_KART_STND1_R] && player->mo->state <= &states[S_KART_STND2_R]))
P_SetPlayerMobjState(player->mo, S_KART_STND1_R);
else if (cmd->driftturn > 0 && !(player->mo->state >= &states[S_KART_STND1_L] && player->mo->state <= &states[S_KART_STND2_L]))
P_SetPlayerMobjState(player->mo, S_KART_STND1_L);
else if (cmd->driftturn == 0 && !(player->mo->state >= &states[S_KART_STND1] && player->mo->state <= &states[S_KART_STND2]))
P_SetPlayerMobjState(player->mo, S_KART_STND1);
turndir = -1;
}
// Drifting Left - S_KART_DRIFT1_L
else if (player->kartstuff[k_drift] > 0 && P_IsObjectOnGround(player->mo))
else if (cmd->driftturn > minturn)
{
if (!(player->mo->state >= &states[S_KART_DRIFT1_L] && player->mo->state <= &states[S_KART_DRIFT2_L]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L);
turndir = 1;
}
// Drifting Right - S_KART_DRIFT1_R
else if (player->kartstuff[k_drift] < 0 && P_IsObjectOnGround(player->mo))
if (!onground)
{
if (!(player->mo->state >= &states[S_KART_DRIFT1_R] && player->mo->state <= &states[S_KART_DRIFT2_R]))
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R);
// Only use certain frames in the air, to make it look like your tires are spinning fruitlessly!
if (player->kartstuff[k_drift] > 0)
{
if (!spinningwheels || !(player->mo->state >= &states[S_KART_DRIFT1_L] && player->mo->state <= &states[S_KART_DRIFT2_L]))
{
// Neutral drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L);
}
}
else if (player->kartstuff[k_drift] > 0)
{
if (!spinningwheels || !(player->mo->state >= &states[S_KART_DRIFT1_R] && player->mo->state <= &states[S_KART_DRIFT2_R]))
{
// Neutral drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R);
}
}
else
{
if ((turndir == -1)
&& (!spinningwheels || !(player->mo->state >= &states[S_KART_FAST1_R] && player->mo->state <= &states[S_KART_FAST2_R])))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST2_R);
}
else if ((turndir == 1)
&& (!spinningwheels || !(player->mo->state >= &states[S_KART_FAST1_L] && player->mo->state <= &states[S_KART_FAST2_L])))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST2_L);
}
else if ((turndir == 0)
&& (!spinningwheels || !(player->mo->state >= &states[S_KART_FAST1] && player->mo->state <= &states[S_KART_FAST2])))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST2);
}
}
}
// Run frames - S_KART_RUN1 S_KART_RUN1_L S_KART_RUN1_R
else if (player->speed > (20*player->mo->scale))
else
{
if (cmd->driftturn < 0 && !(player->mo->state >= &states[S_KART_RUN1_R] && player->mo->state <= &states[S_KART_RUN2_R]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1_R);
else if (cmd->driftturn > 0 && !(player->mo->state >= &states[S_KART_RUN1_L] && player->mo->state <= &states[S_KART_RUN2_L]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1_L);
else if (cmd->driftturn == 0 && !(player->mo->state >= &states[S_KART_RUN1] && player->mo->state <= &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
}
// Walk frames - S_KART_WALK1 S_KART_WALK1_L S_KART_WALK1_R
else if (player->speed <= (20*player->mo->scale))
{
if (cmd->driftturn < 0 && !(player->mo->state >= &states[S_KART_WALK1_R] && player->mo->state <= &states[S_KART_WALK2_R]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1_R);
else if (cmd->driftturn > 0 && !(player->mo->state >= &states[S_KART_WALK1_L] && player->mo->state <= &states[S_KART_WALK2_L]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1_L);
else if (cmd->driftturn == 0 && !(player->mo->state >= &states[S_KART_WALK1] && player->mo->state <= &states[S_KART_WALK2]))
P_SetPlayerMobjState(player->mo, S_KART_WALK1);
if (player->kartstuff[k_drift] > 0)
{
// Drifting LEFT!
if ((turndir == -1)
&& !(player->mo->state >= &states[S_KART_DRIFT1_L_OUT] && player->mo->state <= &states[S_KART_DRIFT2_L_OUT]))
{
// Right -- outwards drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L_OUT);
}
else if ((turndir == 1)
&& !(player->mo->state >= &states[S_KART_DRIFT1_L_IN] && player->mo->state <= &states[S_KART_DRIFT4_L_IN]))
{
// Left -- inwards drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L_IN);
}
else if ((turndir == 0)
&& !(player->mo->state >= &states[S_KART_DRIFT1_L] && player->mo->state <= &states[S_KART_DRIFT2_L]))
{
// Neutral drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_L);
}
}
else if (player->kartstuff[k_drift] < 0)
{
// Drifting RIGHT!
if ((turndir == -1)
&& !(player->mo->state >= &states[S_KART_DRIFT1_R_IN] && player->mo->state <= &states[S_KART_DRIFT4_R_IN]))
{
// Right -- inwards drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R_IN);
}
else if ((turndir == 1)
&& !(player->mo->state >= &states[S_KART_DRIFT1_R_OUT] && player->mo->state <= &states[S_KART_DRIFT2_R_OUT]))
{
// Left -- outwards drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R_OUT);
}
else if ((turndir == 0)
&& !(player->mo->state >= &states[S_KART_DRIFT1_R] && player->mo->state <= &states[S_KART_DRIFT2_R]))
{
// Neutral drift
P_SetPlayerMobjState(player->mo, S_KART_DRIFT1_R);
}
}
else
{
if (player->speed >= fastspeed && player->speed >= (player->lastspeed - speedthreshold))
{
// Going REAL fast!
if ((turndir == -1)
&& !(player->mo->state >= &states[S_KART_FAST1_R] && player->mo->state <= &states[S_KART_FAST2_R]))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST1_R);
}
else if ((turndir == 1)
&& !(player->mo->state >= &states[S_KART_FAST1_L] && player->mo->state <= &states[S_KART_FAST2_L]))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST1_L);
}
else if ((turndir == 0)
&& !(player->mo->state >= &states[S_KART_FAST1] && player->mo->state <= &states[S_KART_FAST2]))
{
P_SetPlayerMobjState(player->mo, S_KART_FAST1);
}
}
else
{
if (spinningwheels)
{
// Drivin' slow.
if ((turndir == -1)
&& !(player->mo->state >= &states[S_KART_SLOW1_R] && player->mo->state <= &states[S_KART_SLOW2_R]))
{
P_SetPlayerMobjState(player->mo, S_KART_SLOW1_R);
}
else if ((turndir == 1)
&& !(player->mo->state >= &states[S_KART_SLOW1_L] && player->mo->state <= &states[S_KART_SLOW2_L]))
{
P_SetPlayerMobjState(player->mo, S_KART_SLOW1_L);
}
else if ((turndir == 0)
&& !(player->mo->state >= &states[S_KART_SLOW1] && player->mo->state <= &states[S_KART_SLOW2]))
{
P_SetPlayerMobjState(player->mo, S_KART_SLOW1);
}
}
else
{
// Completely still.
if ((turndir == -1)
&& !(player->mo->state >= &states[S_KART_STILL1_R] && player->mo->state <= &states[S_KART_STILL2_R]))
{
P_SetPlayerMobjState(player->mo, S_KART_STILL1_R);
}
else if ((turndir == 1)
&& !(player->mo->state >= &states[S_KART_STILL1_L] && player->mo->state <= &states[S_KART_STILL2_L]))
{
P_SetPlayerMobjState(player->mo, S_KART_STILL1_L);
}
else if ((turndir == 0)
&& !(player->mo->state >= &states[S_KART_STILL1] && player->mo->state <= &states[S_KART_STILL2]))
{
P_SetPlayerMobjState(player->mo, S_KART_STILL1);
}
}
}
}
}
// Update lastspeed value -- we use to display slow driving frames instead of fast driving when slowing down.
player->lastspeed = player->speed;
}
static void K_TauntVoiceTimers(player_t *player)
@ -5966,6 +5596,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale),
MT_FASTLINE);
P_SetTarget(&fast->target, player->mo);
fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
fast->momx = 3*player->mo->momx/4;
fast->momy = 3*player->mo->momy/4;
@ -6885,6 +6516,11 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
basedrift += (basedrift / greasetics) * player->kartstuff[k_tiregrease];
}
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
{
countersteer = 3*countersteer/2;
}
return basedrift + (FixedMul(driftadjust * FRACUNIT, countersteer) / FRACUNIT);
}
@ -6929,6 +6565,11 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
turnvalue = 5*turnvalue/4;
}
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
{
turnvalue = 3*turnvalue/2;
}
turnvalue = FixedMul(turnvalue * FRACUNIT, weightadjust) / FRACUNIT; // Weight has a small effect on turning
return turnvalue;
@ -8046,6 +7687,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
player->mo->friction += 1228;
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
player->mo->friction += 614;
// Wipeout slowdown
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
{

View file

@ -12,12 +12,6 @@
#define KART_FULLTURN 800
UINT8 colortranslations[MAXTRANSLATIONS][16];
extern const char *KartColor_Names[MAXSKINCOLORS];
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
UINT8 K_GetKartColorByName(const char *name);
player_t *K_GetItemBoxPlayer(mobj_t *mobj);
void K_RegisterKartStuff(void);

View file

@ -1967,8 +1967,7 @@ void K_AdjustWaypointsParameters (void)
waypointmobj;
waypointmobj = waypointmobj->tracer
){
if (K_AnchorWaypointRadius(waypointmobj, anchor))
break;
K_AnchorWaypointRadius(waypointmobj, anchor);
}
}
}

View file

@ -18,6 +18,8 @@
#include "p_mobj.h"
#include "k_pathfind.h"
#define DEFAULT_WAYPOINT_RADIUS (384)
typedef struct waypoint_s
{
mobj_t *mobj;

View file

@ -27,6 +27,7 @@
#include "console.h"
#include "k_kart.h" // SRB2Kart
#include "k_battle.h"
#include "k_color.h"
#include "d_netcmd.h" // IsPlayerAdmin
#include "lua_script.h"

View file

@ -16,7 +16,7 @@
#include "tables.h"
#include "p_local.h"
#include "doomstat.h" // for ALL7EMERALDS
#include "k_kart.h" // KartColor_Opposite
#include "k_color.h" // KartColor_Opposite
#include "lua_script.h"
#include "lua_libs.h"

View file

@ -87,7 +87,10 @@ enum mobj_e {
#endif
mobj_colorized,
mobj_shadowscale,
mobj_whiteshadow
mobj_whiteshadow,
mobj_sprxoff,
mobj_spryoff,
mobj_sprzoff
};
static const char *const mobj_opt[] = {
@ -153,6 +156,9 @@ static const char *const mobj_opt[] = {
"colorized",
"shadowscale",
"whiteshadow",
"sprxoff",
"spryoff",
"sprzoff",
NULL};
#define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field])
@ -370,6 +376,15 @@ static int mobj_get(lua_State *L)
case mobj_whiteshadow:
lua_pushboolean(L, mo->whiteshadow);
break;
case mobj_sprxoff:
lua_pushfixed(L, mo->sprxoff);
break;
case mobj_spryoff:
lua_pushfixed(L, mo->spryoff);
break;
case mobj_sprzoff:
lua_pushfixed(L, mo->sprzoff);
break;
default: // extra custom variables in Lua memory
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1));
@ -693,6 +708,15 @@ static int mobj_set(lua_State *L)
case mobj_whiteshadow:
mo->whiteshadow = luaL_checkboolean(L, 3);
break;
case mobj_sprxoff:
mo->sprxoff = luaL_checkfixed(L, 3);
break;
case mobj_spryoff:
mo->spryoff = luaL_checkfixed(L, 3);
break;
case mobj_sprzoff:
mo->sprzoff = luaL_checkfixed(L, 3);
break;
default:
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1));

View file

@ -17,6 +17,7 @@
#include "d_player.h"
#include "g_game.h"
#include "p_local.h"
#include "d_clisrv.h"
#include "lua_script.h"
#include "lua_libs.h"
@ -385,6 +386,8 @@ static int player_get(lua_State *L)
else if (fastcmp(field,"fovadd"))
lua_pushfixed(L, plr->fovadd);
#endif
else if (fastcmp(field,"ping"))
lua_pushinteger(L, playerpingtable[( plr - players )]);
else {
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1));

View file

@ -1308,7 +1308,7 @@ void Command_ObjectPlace_f(void)
op_oldmomy = players[0].mo->momy;
op_oldmomz = players[0].mo->momz;
op_oldheight = players[0].mo->height;
op_oldstate = S_KART_STND1; // SRB2kart - was S_PLAY_STND
op_oldstate = S_KART_STILL1; // SRB2kart - was S_PLAY_STND
op_oldcolor = players[0].mo->color; // save color too in case of super/fireflower
// Remove ALL flags and motion.

View file

@ -20,7 +20,7 @@
#include "g_game.h" // record info
#include "r_things.h" // numskins
//#include "r_draw.h" // R_GetColorByName
#include "k_kart.h" // K_GetKartColorByName
#include "k_color.h" // K_GetKartColorByName
#include "k_pwrlv.h"
// Map triggers for linedef executors

View file

@ -59,6 +59,7 @@
#include "k_kart.h" // SRB2kart
#include "k_pwrlv.h"
#include "d_player.h" // KITEM_ constants
#include "k_color.h"
#include "i_joy.h" // for joystick menu controls

View file

@ -8561,6 +8561,7 @@ static void SpawnSPBSpeedLines(mobj_t *actor)
actor->z + (actor->height/2) + (P_RandomRange(-24,24) * actor->scale),
MT_FASTLINE);
P_SetTarget(&fast->target, actor);
fast->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy);
fast->color = SKINCOLOR_RED;
fast->colorized = true;

View file

@ -1158,7 +1158,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_ResetPlayer(player);
P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetPlayerMobjState(toucher, S_KART_STILL1); // SRB2kart - was S_PLAY_FALL1
}
}
return;
@ -1454,7 +1454,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING)
{
player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetPlayerMobjState(toucher, S_KART_STILL1); // SRB2kart - was S_PLAY_FALL1
}
// Play a bounce sound?
@ -1521,7 +1521,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->pflags & PF_GLIDING)
{
player->pflags &= ~(PF_GLIDING|PF_JUMPED);
P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1
P_SetPlayerMobjState(toucher, S_KART_STILL1); // SRB2kart - was S_PLAY_FALL1
}
// Play a bounce sound?
@ -1577,7 +1577,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
player->pflags |= PF_MACESPIN;
S_StartSound(toucher, sfx_spin);
P_SetPlayerMobjState(toucher, S_KART_STND1); // SRB2kart - was S_PLAY_ATK1
P_SetPlayerMobjState(toucher, S_KART_STILL1); // SRB2kart - was S_PLAY_ATK1
}
else
player->pflags |= PF_ITEMHANG;

View file

@ -37,6 +37,7 @@
#include "k_kart.h"
#include "k_battle.h"
#include "k_color.h"
// protos.
//static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}};
@ -211,11 +212,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
// Set animation state
// The pflags version of this was just as convoluted.
// Rewriten for SRB2kart ... though I don't know what this is.
if ((state >= S_KART_STND1 && state <= S_KART_STND2_R) || state == S_KART_SQUISH || state == S_KART_SPIN)
if ((state >= S_KART_STILL1 && state <= S_KART_STILL2_R) || state == S_KART_SQUISH || state == S_KART_SPIN)
player->panim = PA_IDLE;
else if (state >= S_KART_WALK1 && state <= S_KART_WALK2_R)
else if (state >= S_KART_SLOW1 && state <= S_KART_SLOW2_R)
player->panim = PA_WALK;
else if (state >= S_KART_RUN1 && state <= S_KART_DRIFT2_R)
else if (state >= S_KART_FAST1 && state <= S_KART_DRIFT2_R)
player->panim = PA_RUN;
//else if (state >= S_PLAY_ATK1 && state <= S_PLAY_ATK4)
// player->panim = PA_ROLL;
@ -1248,29 +1249,45 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
}
// Less gravity underwater.
if (mo->eflags & MFE_UNDERWATER && !goopgravity)
gravityadd = gravityadd/3;
if ((mo->eflags & MFE_UNDERWATER) && !goopgravity)
{
if (mo->momz * P_MobjFlip(mo) <= 0)
{
gravityadd = 4*gravityadd/3;
}
else
{
gravityadd = gravityadd/3;
}
}
if (mo->player)
{
//if ((mo->player->pflags & PF_GLIDING)
//|| (mo->player->charability == CA_FLY && (mo->player->powers[pw_tailsfly]
// || (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4]))))
// gravityadd = gravityadd/3; // less gravity while flying/gliding
if (mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE))
{
return 0;
}
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
{
gravityadd = -gravityadd;
mo->eflags ^= MFE_VERTICALFLIP;
}
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
{
P_PlayerFlip(mo);
}
if (mo->player->kartstuff[k_pogospring])
{
gravityadd = (5*gravityadd)/2;
}
if (mo->player->kartstuff[k_waterskip])
{
gravityadd = (4*gravityadd)/3;
}
}
else
{
@ -1278,10 +1295,15 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
if (mo->flags2 & MF2_OBJECTFLIP)
{
mo->eflags |= MFE_VERTICALFLIP;
if (mo->z + mo->height >= mo->ceilingz)
{
gravityadd = 0;
}
else if (gravityadd < 0) // Don't sink, only rise up
gravityadd *= -1;
{
gravityadd = -gravityadd;
}
}
else //Otherwise, sort through the other exceptions.
{
@ -1316,7 +1338,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
}
break;
case MT_WATERDROP:
gravityadd >>= 1;
gravityadd /= 2;
break;
case MT_BANANA:
case MT_EGGMANITEM:
@ -1341,7 +1363,9 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
// Goop has slower, reversed gravity
if (goopgravity)
{
gravityadd = -gravityadd/5;
}
gravityadd = FixedMul(gravityadd, mo->scale);
@ -1445,7 +1469,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
{
// if in a walking frame, stop moving
if (player->panim == PA_WALK && player->kartstuff[k_spinouttimer] == 0)
P_SetPlayerMobjState(mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(mo, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
mo->momx = player->cmomx;
mo->momy = player->cmomy;
}
@ -2735,7 +2759,7 @@ static void P_PlayerZMovement(mobj_t *mo)
// Get up if you fell.
if ((mo->state == &states[mo->info->painstate] || mo->state == &states[S_KART_SPIN])
&& mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->kartstuff[k_squishedtimer] == 0) // SRB2kart
P_SetPlayerMobjState(mo, S_KART_STND1);
P_SetPlayerMobjState(mo, S_KART_STILL1);
#ifdef ESLOPE
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
@ -3848,7 +3872,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
{
mobj->player->secondjump = 0;
mobj->player->powers[pw_tailsfly] = 0;
P_SetPlayerMobjState(mobj, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
P_SetPlayerMobjState(mobj, S_KART_SLOW1); // SRB2kart - was S_PLAY_RUN1
}
mobj->eflags &= ~MFE_JUSTHITFLOOR;
}
@ -11934,7 +11958,7 @@ void P_AfterPlayerSpawn(INT32 playernum)
else
p->viewz = p->mo->z + p->viewheight;
P_SetPlayerMobjState(p->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(p->mo, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
p->pflags &= ~PF_SPINNING;
if (playernum == consoleplayer)
@ -12672,9 +12696,17 @@ ML_NOCLIMB : Direction not controllable
break;
case MT_WAYPOINT:
{
const fixed_t mobjscale =
mapheaderinfo[gamemap-1]->default_waypoint_radius;
// Just like MT_SPINMACEPOINT, this now works here too!
INT32 line = P_FindSpecialLineFromTag(2000, mthing->angle, -1);
mobj->radius = 384 * mapobjectscale;
if (mobjscale == 0)
mobj->radius = DEFAULT_WAYPOINT_RADIUS * mapobjectscale;
else
mobj->radius = mobjscale;
// Set the radius, mobj z, and mthing z to match what the parameters want
if (line != -1)
{
@ -12981,16 +13013,30 @@ ML_NOCLIMB : Direction not controllable
mobj->angle = FixedAngle(mthing->angle*FRACUNIT);
if ((mobj->flags & MF_SPRING)
&& mobj->info->damage != 0
&& mobj->info->mass == 0)
{
// Offset sprite of horizontal springs
angle_t a = mobj->angle + ANGLE_180;
mobj->sprxoff = FixedMul(mobj->radius, FINECOSINE(a >> ANGLETOFINESHIFT));
mobj->spryoff = FixedMul(mobj->radius, FINESINE(a >> ANGLETOFINESHIFT));
}
if ((mthing->options & MTF_AMBUSH)
&& (mthing->options & MTF_OBJECTSPECIAL)
&& (mobj->flags & MF_PUSHABLE))
{
mobj->flags2 |= MF2_CLASSICPUSH;
}
else
{
if (mthing->options & MTF_AMBUSH)
{
if (mobj->flags & MF_SPRING && mobj->info->damage)
if ((mobj->flags & MF_SPRING) && mobj->info->damage)
{
mobj->angle += ANGLE_22h;
}
if (mobj->flags & MF_NIGHTSITEM)
{

View file

@ -378,6 +378,8 @@ typedef struct mobj_s
fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius
boolean whiteshadow; // Use white shadow, set to true by default for fullbright objects
fixed_t sprxoff, spryoff, sprzoff; // Sprite offsets in real space, does NOT affect position or collision
// WARNING: New fields must be added separately to savegame and Lua.
} mobj_t;

View file

@ -259,6 +259,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
//mapheaderinfo[num]->automap = false;
DEH_WriteUndoline("MOBJSCALE", va("%d", mapheaderinfo[num]->mobj_scale), UNDO_NONE);
mapheaderinfo[num]->mobj_scale = FRACUNIT;
DEH_WriteUndoline("DEFAULTWAYPOINTRADIUS", va("%d", mapheaderinfo[num]->default_waypoint_radius), UNDO_NONE);
mapheaderinfo[num]->default_waypoint_radius = 0;
// an even further impossibility, delfile custom opts support
mapheaderinfo[num]->customopts = NULL;
mapheaderinfo[num]->numCustomOptions = 0;

View file

@ -2875,7 +2875,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
mo->player->rmomx = mo->player->rmomy = 1;
mo->player->cmomx = mo->player->cmomy = 0;
P_ResetPlayer(mo->player);
P_SetPlayerMobjState(mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(mo, S_KART_STILL1);
}
break;
@ -4314,8 +4314,8 @@ DoneSection2:
player->pflags &= ~PF_GLIDING;
player->climbing = 0;
if (!(player->mo->state >= &states[S_KART_RUN1] && player->mo->state <= &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
if (!(player->mo->state >= &states[S_KART_FAST1] && player->mo->state <= &states[S_KART_FAST2]))
P_SetPlayerMobjState(player->mo, S_KART_FAST1);
//if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4])) // SRB2kart
//{
@ -4389,8 +4389,8 @@ DoneSection2:
player->pflags &= ~PF_SPINNING; // SRB2kart 200117
player->pflags &= ~PF_JUMPED;
if (!(player->mo->state >= &states[S_KART_RUN1] && player->mo->state <= &states[S_KART_RUN2]))
P_SetPlayerMobjState(player->mo, S_KART_RUN1);
if (!(player->mo->state >= &states[S_KART_FAST1] && player->mo->state <= &states[S_KART_FAST2]))
P_SetPlayerMobjState(player->mo, S_KART_FAST1);
//if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4])) // SRB2kart
//{

View file

@ -100,7 +100,7 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
thing->player->starpostnum = starpostnum;
P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(thing, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
P_FlashPal(thing->player, PAL_MIXUP, 10);
}
@ -185,7 +185,7 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
thing->player->rmomx = thing->player->rmomy = 0;
thing->player->speed = 0;
P_ResetPlayer(thing->player);
P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(thing, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
}
if (flash)

View file

@ -1666,6 +1666,10 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
ghost->modeltilt = mobj->modeltilt;
#endif
ghost->sprxoff = mobj->sprxoff;
ghost->spryoff = mobj->spryoff;
ghost->sprzoff = mobj->sprzoff;
if (mobj->flags2 & MF2_OBJECTFLIP)
ghost->flags |= MF2_OBJECTFLIP;
@ -2926,7 +2930,7 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused
if (player->climbing && P_IsObjectOnGround(player->mo))
{
P_ResetPlayer(player);
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart
P_SetPlayerMobjState(player->mo, S_KART_STILL1); // SRB2kart
}
}
@ -3632,7 +3636,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
{
player->skidtime = 0;
player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_KART_STND1);
P_SetPlayerMobjState(player->mo, S_KART_STILL1);
player->mo->momx = player->cmomx;
player->mo->momy = player->cmomy;
}
@ -3828,14 +3832,14 @@ static void P_2dMovement(player_t *player)
else if (player->exiting)
{
player->pflags &= ~PF_GLIDING;
P_SetPlayerMobjState(player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
P_SetPlayerMobjState(player->mo, S_KART_SLOW1); // SRB2kart - was S_PLAY_RUN1
player->skidtime = 0;
}
}
if (player->pflags & PF_SPINNING && !player->exiting)
{
player->pflags &= ~PF_SPINNING;
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(player->mo, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
}
}
@ -5824,18 +5828,18 @@ static void P_MovePlayer(player_t *player)
// If the player is moving fast enough,
// break into a run!
if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
P_SetPlayerMobjState (player->mo, S_KART_RUN1); // SRB2kart - was S_PLAY_SPD1
P_SetPlayerMobjState (player->mo, S_KART_FAST1); // SRB2kart - was S_PLAY_SPD1
// Otherwise, just walk.
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
P_SetPlayerMobjState (player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
P_SetPlayerMobjState (player->mo, S_KART_SLOW1); // SRB2kart - was S_PLAY_RUN1
}
*/
// If your running animation is playing, and you're
// going too slow, switch back to the walking frames.
//if (player->panim == PA_RUN && player->speed < runspd && player->kartstuff[k_spinouttimer] == 0)
//P_SetPlayerMobjState(player->mo, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
//P_SetPlayerMobjState(player->mo, S_KART_SLOW1); // SRB2kart - was S_PLAY_RUN1
// If Springing, but travelling DOWNWARD, change back!
//if (player->mo->state == &states[S_PLAY_SPRING] && P_MobjFlip(player->mo)*player->mo->momz < 0)
@ -5883,17 +5887,23 @@ static void P_MovePlayer(player_t *player)
K_KartMoveAnimation(player);
if (player->kartstuff[k_pogospring])
{
player->frameangle += ANGLE_22h;
}
else
{
player->frameangle = player->mo->angle;
if (player->kartstuff[k_drift] != 0)
{
INT32 a = (ANGLE_45 / 5) * player->kartstuff[k_drift];
player->frameangle += a;
}
}
}
player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame.
// If you are stopped and are still walking, stand still!
if (!player->mo->momx && !player->mo->momy && !player->mo->momz && player->panim == PA_WALK)
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
//{ SRB2kart
// Drifting sound
@ -5923,7 +5933,7 @@ static void P_MovePlayer(player_t *player)
player->jumping = 0;
player->secondjump = 0;
player->pflags &= ~PF_THOKKED;
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
P_SetPlayerMobjState(player->mo, S_KART_STILL1); // SRB2kart - was S_PLAY_STND
}
if (/*!(player->charability == CA_GLIDEANDCLIMB) ||*/ player->gotflag) // If you can't glide, then why the heck would you be gliding?
@ -8727,7 +8737,7 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_ingoop])
{
if (player->mo->state == &states[S_KART_STND1]) // SRB2kart - was S_PLAY_STND
if (player->mo->state == &states[S_KART_STILL1]) // SRB2kart - was S_PLAY_STND
player->mo->tics = 2;
player->powers[pw_ingoop]--;

View file

@ -25,7 +25,7 @@
#include "w_wad.h"
#include "z_zone.h"
#include "console.h" // Until buffering gets finished
#include "k_kart.h" // SRB2kart
#include "k_color.h" // SRB2kart
#ifdef HWRENDER
#include "hardware/hw_main.h"

View file

@ -1147,7 +1147,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
aimingangle = player->aiming;
viewangle = viewmobj->angle;
if (/*!demo.playback && */player->playerstate != PST_DEAD)
if (!demo.playback && player->playerstate != PST_DEAD)
{
if (player == &players[consoleplayer])
{

View file

@ -28,7 +28,7 @@
#include "dehacked.h" // get_number (for thok)
#include "d_netfil.h" // blargh. for nameonly().
#include "m_cheat.h" // objectplace
#include "k_kart.h" // SRB2kart
#include "k_color.h" // SRB2kart
#include "p_local.h" // stplyr
#ifdef HWRENDER
#include "hardware/hw_md2.h"
@ -1436,6 +1436,10 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
//
static void R_ProjectSprite(mobj_t *thing)
{
const fixed_t thingxpos = thing->x + thing->sprxoff;
const fixed_t thingypos = thing->y + thing->spryoff;
const fixed_t thingzpos = thing->z + thing->sprzoff;
fixed_t tr_x, tr_y;
fixed_t gxt, gyt;
fixed_t tx, tz;
@ -1472,8 +1476,8 @@ static void R_ProjectSprite(mobj_t *thing)
fixed_t this_scale = thing->scale;
// transform the origin point
tr_x = thing->x - viewx;
tr_y = thing->y - viewy;
tr_x = thingxpos - viewx;
tr_y = thingypos - viewy;
gxt = FixedMul(tr_x, viewcos);
gyt = -FixedMul(tr_y, viewsin);
@ -1539,9 +1543,9 @@ static void R_ProjectSprite(mobj_t *thing)
if (sprframe->rotate != SRF_SINGLE || papersprite)
{
if (thing->player)
ang = R_PointToAngle (thing->x, thing->y) - thing->player->frameangle;
ang = R_PointToAngle (thingxpos, thingypos) - thing->player->frameangle;
else
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
ang = R_PointToAngle (thingxpos, thingypos) - thing->angle;
}
if (sprframe->rotate == SRF_SINGLE)
@ -1554,7 +1558,7 @@ static void R_ProjectSprite(mobj_t *thing)
else
{
// choose a different rotation based on player view
//ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
//ang = R_PointToAngle (thingxpos, thingypos) - thing->angle;
if ((ang < ANGLE_180) && (sprframe->rotate & SRF_RIGHT)) // See from right
rot = 6; // F7 slot
@ -1701,7 +1705,7 @@ static void R_ProjectSprite(mobj_t *thing)
if (x2 < portalclipstart || x1 > portalclipend)
return;
if (P_PointOnLineSide(thing->x, thing->y, portalclipline) != 0)
if (P_PointOnLineSide(thingxpos, thingypos, portalclipline) != 0)
return;
}
@ -1711,12 +1715,12 @@ static void R_ProjectSprite(mobj_t *thing)
// When vertical flipped, draw sprites from the top down, at least as far as offsets are concerned.
// sprite height - sprite topoffset is the proper inverse of the vertical offset, of course.
// remember gz and gzt should be seperated by sprite height, not thing height - thing height can be shorter than the sprite itself sometimes!
gz = thing->z + thing->height - FixedMul(spritecachedinfo[lump].topoffset, this_scale);
gz = thingzpos + thing->height - FixedMul(spritecachedinfo[lump].topoffset, this_scale);
gzt = gz + FixedMul(spritecachedinfo[lump].height, this_scale);
}
else
{
gzt = thing->z + FixedMul(spritecachedinfo[lump].topoffset, this_scale);
gzt = thingzpos + FixedMul(spritecachedinfo[lump].topoffset, this_scale);
gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale);
}
@ -1733,7 +1737,7 @@ static void R_ProjectSprite(mobj_t *thing)
light = thing->subsector->sector->numlights - 1;
for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y)
fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thingxpos, thingypos)
: thing->subsector->sector->lightlist[lightnum].height;
if (h <= gzt) {
light = lightnum - 1;
@ -1762,12 +1766,12 @@ static void R_ProjectSprite(mobj_t *thing)
if (heightsec != -1 && phs != -1) // only clip things which are in special sectors
{
if (viewz < sectors[phs].floorheight ?
thing->z >= sectors[heightsec].floorheight :
thingzpos >= sectors[heightsec].floorheight :
gzt < sectors[heightsec].floorheight)
return;
if (viewz > sectors[phs].ceilingheight ?
gzt < sectors[heightsec].ceilingheight && viewz >= sectors[heightsec].ceilingheight :
thing->z >= sectors[heightsec].ceilingheight)
thingzpos >= sectors[heightsec].ceilingheight)
return;
}
@ -1778,12 +1782,12 @@ static void R_ProjectSprite(mobj_t *thing)
vis->scale = yscale; //<<detailshift;
vis->sortscale = sortscale;
vis->dispoffset = thing->info->dispoffset; // Monster Iestyn: 23/11/15
vis->gx = thing->x;
vis->gy = thing->y;
vis->gx = thingxpos;
vis->gy = thingypos;
vis->gz = gz;
vis->gzt = gzt;
vis->thingheight = thing->height;
vis->pz = thing->z;
vis->pz = thingzpos;
vis->pzt = vis->pz + vis->thingheight;
vis->texturemid = vis->gzt - viewz;
vis->scalestep = scalestep;

View file

@ -418,7 +418,7 @@ void SCR_DisplayTicRate(void)
if (fpsgraph[i])
++totaltics;
if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE);
if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
else if (totaltics == TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
/*V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy),

View file

@ -1173,7 +1173,10 @@ void I_StartupSound(void)
const char *sdrv_name = NULL;
#endif
#ifndef HAVE_MIXER
midi_disabled = digital_disabled = true;
#ifndef NO_MIDI
midi_disabled =
#endif
digital_disabled = true;
#endif
memset(channels, 0, sizeof (channels)); //Alam: Clean it

View file

@ -1797,10 +1797,12 @@ static void ST_doItemFinderIconsAndSound(void) // SRB2kart - unused.
//
static void ST_overlayDrawer(void)
{
/* SRB2kart doesn't need this stuff
//hu_showscores = auto hide score/time/rings when tab rankings are shown
if (!(hu_showscores && (netgame || multiplayer)))
{
K_drawKartHUD();
/* SRB2kart doesn't need this stuff
if (maptol & TOL_NIGHTS)
ST_drawNiGHTSHUD();
else
@ -1824,8 +1826,8 @@ static void ST_overlayDrawer(void)
)
ST_drawLives();
}
}
*/
}
// GAME OVER pic
/*if (G_GametypeUsesLives() && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
@ -1845,8 +1847,6 @@ static void ST_overlayDrawer(void)
// Countdown timer for Race Mode
// ...moved to k_kart.c so we can take advantage of the LAPS_Y value
K_drawKartHUD();
/* SRB2kart doesn't need this stuff, I think
// If you are in overtime, put a big honkin' flashin' message on the screen.
if (G_BattleGametype() && cv_overtime.value

View file

@ -38,7 +38,7 @@
#include "m_random.h" // M_RandomKey
#include "g_input.h" // PLAYER1INPUTDOWN
#include "k_kart.h" // colortranslations
#include "k_color.h" // colortranslations
#include "k_battle.h"
#include "k_pwrlv.h"
#include "console.h" // cons_menuhighlight