Up to screen.o

Lots of renderer files I didn't need to touch at all here :)
This commit is contained in:
Sally Coolatta 2020-08-15 00:55:30 -04:00
parent 9b9ab8a2d5
commit dfd733eb80
16 changed files with 179 additions and 329 deletions

View file

@ -4503,7 +4503,12 @@ retryscramble:
newteam = (INT16)((M_RandomByte() % 2) + 1);
repick = false;
}
else if (i != 2) // Mystic's secret sauce - ABBA is better than ABAB, so team B doesn't get worse players all around
// (i != 2) means it does ABBABABA, instead of ABABABAB.
// Team A gets 1st, 4th, 6th, 8th.
// Team B gets 2nd, 3rd, 5th, 7th.
// So 1st on one team, 2nd/3rd on the other, then alternates afterwards.
// Sounds strange on paper, but works really well in practice!
else if (i != 2)
{
// We will only randomly pick the team for the first guy.
// Otherwise, just alternate back and forth, distributing players.

View file

@ -539,7 +539,7 @@ typedef struct player_s
INT32 followerskin; // Kart: This player's follower "skin"
boolean followerready; // Kart: Used to know when we can have a follower or not. (This is set on the first NameAndColor follower update)
UINT8 followercolor; // Kart: Used to store the follower colour the player wishes to use
UINT16 followercolor; // Kart: Used to store the follower colour the player wishes to use
mobj_t *follower; // Kart: This is the follower object we have. (If any)
//

View file

@ -2070,7 +2070,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
boolean followerready;
INT32 followerskin;
UINT8 followercolor;
UINT16 followercolor;
mobj_t *follower; // old follower, will probably be removed by the time we're dead but you never know.
INT32 charflags;

View file

@ -5110,15 +5110,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
{
// New colormap stuff for skins Tails 06-07-2002
if (thing->colorized)
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
else if (thing->player && thing->player->dashmode >= DASHMODE_THRESHOLD
&& (thing->player->charflags & SF_DASHMODE)
&& ((leveltime/2) & 1))
{
if (thing->player->charflags & SF_MACHINE)
vis->colormap = R_GetTranslationColormap(TC_DASHMODE, 0, GTC_CACHE);
else
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
}
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
{
@ -5126,7 +5119,9 @@ static void HWR_ProjectSprite(mobj_t *thing)
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
}
else
{
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_GREEN, GTC_CACHE);
}
}
else
{

View file

@ -1058,8 +1058,7 @@ static void K_DebtStingPlayer(player_t *player, INT32 length)
player->kartstuff[k_spinouttimer] = length;
player->kartstuff[k_wipeoutslow] = min(length-1, wipeoutslowtime+1);
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
K_DropHnextList(player, false);
return;
@ -2475,8 +2474,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
P_PlayerRingBurst(player, 5);
K_PlayPainSound(player->mo);
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
player->kartstuff[k_instashield] = 15;
if (cv_kartdebughuddrop.value && !modeattacking)
@ -2725,8 +2723,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
if (player->mo->eflags & MFE_UNDERWATER)
player->mo->momz = (117 * player->mo->momz) / 200;
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
P_PlayRinglossSound(player->mo);
P_PlayerRingBurst(player, 5);
@ -3561,7 +3558,7 @@ void K_DriftDustHandling(mobj_t *spawner)
if (spawner->player)
{
if (spawner->player->pflags & PF_SKIDDOWN)
if (spawner->player->pflags & PF_WPNDOWN)
{
anglediff = abs((signed)(spawner->angle - spawner->player->frameangle));
if (leveltime % 6 == 0)
@ -5343,7 +5340,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
if (player->karthud[khud_tauntvoices])
player->karthud[khud_tauntvoices]--;
if (!(player->pflags & PF_SKIDDOWN))
if (!(player->pflags & PF_WPNDOWN))
player->karthud[khud_fault] = 0;
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
player->karthud[khud_fault]++;

View file

@ -240,7 +240,7 @@ static void P_NetArchivePlayers(void)
WRITEUINT8(save_p, players[i].followerskin);
WRITEUINT8(save_p, players[i].followerready); // booleans are really just numbers eh??
WRITEUINT8(save_p, players[i].followercolor);
WRITEUINT16(save_p, players[i].followercolor);
if (flags & FOLLOWER)
WRITEUINT32(save_p, players[i].follower->mobjnum);

View file

@ -328,8 +328,6 @@ static inline void P_RunThinkers(void)
}
/*
//
// P_DoAutobalanceTeams()
//
@ -449,7 +447,7 @@ void P_DoTeamscrambling(void)
CV_SetValue(&cv_teamscramble, 0);
}
static inline void P_DoCTFStuff(void)
static inline void P_DoTeamStuff(void)
{
// Automatic team balance for CTF and team match
if (leveltime % (TICRATE * 5) == 0) //only check once per five seconds for the sake of CPU conservation.
@ -470,8 +468,6 @@ static inline void P_DoCTFStuff(void)
}
}
*/
//
// P_Ticker
//
@ -604,10 +600,8 @@ void P_Ticker(boolean run)
if (!(modeattacking && !demo.playback) || leveltime >= starttime - TICRATE*4)
timeinmap++;
/*
if (G_GametypeHasTeams())
P_DoCTFStuff();
*/
P_DoTeamStuff();
if (run)
{

View file

@ -48,7 +48,6 @@
// SRB2kart
#include "m_cond.h" // M_UpdateUnlockablesAndExtraEmblems
#include "k_kart.h"
#include "k_color.h" // KartColor_Opposite
#include "console.h" // CON_LogMessage
#include "k_respawn.h"
#include "k_bot.h"
@ -233,6 +232,31 @@ void P_CalcHeight(player_t *player)
// move viewheight
pviewheight = P_GetPlayerViewHeight(player); // default eye view height
if (player->playerstate == PST_LIVE)
{
player->viewheight += player->deltaviewheight;
if (player->viewheight > pviewheight)
{
player->viewheight = pviewheight;
player->deltaviewheight = 0;
}
if (player->viewheight < pviewheight/2)
{
player->viewheight = pviewheight/2;
if (player->deltaviewheight <= 0)
player->deltaviewheight = 1;
}
if (player->deltaviewheight)
{
player->deltaviewheight += FixedMul(FRACUNIT/4, mo->scale);
if (!player->deltaviewheight)
player->deltaviewheight = 1;
}
}
if (player->mo->eflags & MFE_VERTICALFLIP)
player->viewz = mo->z + mo->height - player->viewheight - bob;
else
@ -518,15 +542,6 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
player->marescore += amount;
else
player->marescore = MAXSCORE;
// In team match, all awarded points are incremented to the team's running score.
if (gametype == GT_TEAMMATCH)
{
if (player->ctfteam == 1)
redscore += amount;
else if (player->ctfteam == 2)
bluescore += amount;
}
}
//
@ -537,7 +552,7 @@ void P_PlayLivesJingle(player_t *player)
if (player && !P_IsLocalPlayer(player))
return;
if (use1upSound || cv_1upsound.value)
if (use1upSound)
S_StartSound(NULL, sfx_oneup);
else
{
@ -625,7 +640,7 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
break;
case JT_SUPER: // Super Sonic
result = (players[i].powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC));
result = (players[i].powers[pw_super]);
break;
case JT_GOVER: // Game Over
@ -1416,6 +1431,8 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff)
{
boolean clipmomz;
(void)dorollstuff;
I_Assert(player->mo != NULL);
clipmomz = !(P_CheckDeathPitCollide(player->mo));
@ -1516,8 +1533,6 @@ static void P_CheckBustableBlocks(player_t *player)
// or you are recording for Metal Sonic
if (!((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED))
&& !(player->powers[pw_super])
&& !(((player->charflags & (SF_DASHMODE|SF_MACHINE)) == (SF_DASHMODE|SF_MACHINE)) && (player->dashmode >= DASHMODE_THRESHOLD))
&& !(player->pflags & PF_DRILLING)
&& !metalrecording)
continue;
@ -1873,12 +1888,10 @@ static void P_3dMovement(player_t *player)
fixed_t movepushforward = 0;
angle_t dangle; // replaces old quadrants bits
fixed_t oldMagnitude, newMagnitude;
#ifdef ESLOPE
vector3_t totalthrust;
totalthrust.x = totalthrust.y = 0; // I forget if this is needed
totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
#endif // ESLOPE
// Get the old momentum; this will be needed at the end of the function! -SH
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
@ -1921,13 +1934,12 @@ static void P_3dMovement(player_t *player)
if (dangle > ANGLE_180) //flip to keep to one side
{
dangle = InvAngle(dangle);
//dangleflip = true;
}
// anything else will leave both at 0, so no need to do anything else
//{ SRB2kart 220217 - Toaster Code for misplaced thrust
/*
#if 0
if (!player->kartstuff[k_drift]) // Not Drifting
{
angle_t difference = dangle/2;
@ -1941,7 +1953,7 @@ static void P_3dMovement(player_t *player)
P_InstaThrust(player->mo, player->mo->angle + difference, player->speed);
}
*/
#endif
//}
// Do not let the player control movement if not onground.
@ -2192,31 +2204,27 @@ void P_MovePlayer(player_t *player)
// Kart frames
if (player->kartstuff[k_squishedtimer] > 0)
{
if (player->mo->state != &states[S_KART_SQUISH])
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
}
else if (player->pflags & PF_SLIDING)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
player->frameangle -= ANGLE_22h;
}
else if (player->kartstuff[k_spinouttimer] > 0)
{
INT32 speed = max(1, min(8, player->kartstuff[k_spinouttimer]/8));
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
if (speed == 1 && abs((signed)(player->mo->angle - player->frameangle)) < ANGLE_22h)
player->frameangle = player->mo->angle; // Face forward at the end of the animation
else
player->frameangle -= (ANGLE_11hh * speed);
}
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
else if (player->powers[pw_nocontrol] && player->pflags & PF_WPNDOWN)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
if (((player->powers[pw_nocontrol] + 5) % 20) < 10)
player->frameangle += ANGLE_11hh;
@ -2514,8 +2522,7 @@ static void P_DoZoomTube(player_t *player)
P_SetPlayerAngle(player, player->mo->angle);
}
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
player->frameangle -= ANGLE_22h;
}
@ -2655,8 +2662,6 @@ static void P_ConsiderAllGone(void)
//
static void P_DeathThink(player_t *player)
{
INT32 j = MAXPLAYERS;
ticcmd_t *cmd = &player->cmd;
player->deltaviewheight = 0;
if (player->deadtimer < INT32_MAX)
@ -2726,40 +2731,38 @@ camera_t camera[MAXSPLITSCREENPLAYERS]; // Four cameras, three for splitscreen
static void CV_CamRotate_OnChange(void)
{
if (cv_cam_rotate.value < 0)
CV_SetValue(&cv_cam_rotate, cv_cam_rotate.value + 360);
else if (cv_cam_rotate.value > 359)
CV_SetValue(&cv_cam_rotate, cv_cam_rotate.value % 360);
if (cv_cam_rotate[0].value < 0)
CV_SetValue(&cv_cam_rotate[0], cv_cam_rotate[0].value + 360);
else if (cv_cam_rotate[0].value > 359)
CV_SetValue(&cv_cam_rotate[0], cv_cam_rotate[0].value % 360);
}
static void CV_CamRotate2_OnChange(void)
{
if (cv_cam2_rotate.value < 0)
CV_SetValue(&cv_cam2_rotate, cv_cam2_rotate.value + 360);
else if (cv_cam2_rotate.value > 359)
CV_SetValue(&cv_cam2_rotate, cv_cam2_rotate.value % 360);
if (cv_cam_rotate[1].value < 0)
CV_SetValue(&cv_cam_rotate[1], cv_cam_rotate[1].value + 360);
else if (cv_cam_rotate[1].value > 359)
CV_SetValue(&cv_cam_rotate[1], cv_cam_rotate[1].value % 360);
}
static void CV_CamRotate3_OnChange(void)
{
if (cv_cam3_rotate.value < 0)
CV_SetValue(&cv_cam3_rotate, cv_cam3_rotate.value + 360);
else if (cv_cam3_rotate.value > 359)
CV_SetValue(&cv_cam3_rotate, cv_cam3_rotate.value % 360);
if (cv_cam_rotate[2].value < 0)
CV_SetValue(&cv_cam_rotate[2], cv_cam_rotate[2].value + 360);
else if (cv_cam_rotate[2].value > 359)
CV_SetValue(&cv_cam_rotate[2], cv_cam_rotate[2].value % 360);
}
static void CV_CamRotate4_OnChange(void)
{
if (cv_cam4_rotate.value < 0)
CV_SetValue(&cv_cam4_rotate, cv_cam4_rotate.value + 360);
else if (cv_cam4_rotate.value > 359)
CV_SetValue(&cv_cam4_rotate, cv_cam4_rotate.value % 360);
if (cv_cam_rotate[3].value < 0)
CV_SetValue(&cv_cam_rotate[3], cv_cam_rotate[3].value + 360);
else if (cv_cam_rotate[3].value > 359)
CV_SetValue(&cv_cam_rotate[3], cv_cam_rotate[3].value % 360);
}
static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, NULL}};
static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {25, "MAX"}, {0, NULL}};
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}};
static CV_PossibleValue_t multiplier_cons_t[] = {{0, "MIN"}, {3*FRACUNIT, "MAX"}, {0, NULL}};
consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS] = {
{"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL},
@ -2791,21 +2794,14 @@ consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS] = {
consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = {
{"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"cam3_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL}
{"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"cam3_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate3_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL}
};
consvar_t cv_cam_rotspeed[MAXSPLITSCREENPLAYERS] = {
{"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
{"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
{"cam3_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
{"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
};
fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = -42;
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = -42;
fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS] = -42;
fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
// Heavily simplified version of G_BuildTicCmd that only takes the local first player's control input and converts it to readable ticcmd_t
// we then throw that ticcmd garbage in the camera and make it move
@ -2853,7 +2849,7 @@ static ticcmd_t *P_CameraCmd(camera_t *cam)
mouseaiming = true;
invertmouse = cv_invertmouse.value;
lookaxis = cv_lookaxis.value;
lookaxis = cv_lookaxis[0].value;
usejoystick = true;
turnright = PlayerInputDown(1, gc_turnright);
@ -3055,11 +3051,8 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
thiscam->y = y;
thiscam->z = z;
if (!cv_cam_still[num].value)
{
thiscam->angle = player->mo->angle;
thiscam->aiming = 0;
}
thiscam->angle = player->mo->angle;
thiscam->aiming = 0;
thiscam->relativex = 0;
thiscam->subsector = R_PointInSubsector(thiscam->x,thiscam->y);
@ -3091,9 +3084,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
democam.soundmobj = NULL; // reset this each frame, we don't want the game crashing for stupid reasons now do we
static fixed_t camsideshift[2] = {0, 0};
fixed_t shiftx = 0, shifty = 0;
// We probably shouldn't move the camera if there is no player or player mobj somehow
if (!player || !player->mo)
return true;
@ -3128,7 +3118,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
mo = player->mo;
#ifndef NOCLIPCAM
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
cameranoclip = ((player->pflags & PF_NOCLIP)
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|| (leveltime < introtime)); // Kart intro cam
#endif
@ -3290,11 +3280,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
}
pitch = thiscam->pitch + (angle_t)FixedMul(pitch - thiscam->pitch, camspeed/4);
if (rendermode == render_opengl
#ifdef GL_SHADERS/* just so we can't possibly forget about it */
&& !cv_grshearing.value
#endif
)
if (rendermode == render_opengl && !cv_glshearing.value)
distxy = FixedMul(dist, FINECOSINE((pitch>>ANGLETOFINESHIFT) & FINEMASK));
else
distxy = dist;
@ -3600,7 +3586,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
angle -= (angle - thiscam->pitch)/2;
}
if (player->playerstate != PST_DEAD && !((player->pflags & PF_NIGHTSMODE) && player->exiting))
if (player->playerstate != PST_DEAD)
angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;'
if (!camstill && !timeover) // Keep the view still...
@ -3866,7 +3852,7 @@ void P_DoTimeOver(player_t *player)
if (player->mo)
{
S_StopSound(player->mo);
P_DamageMobj(player->mo, NULL, NULL, 10000);
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
}
P_EndingMusic(player);
@ -3875,6 +3861,9 @@ void P_DoTimeOver(player_t *player)
exitcountdown = 5*TICRATE;
}
// SRB2Kart: These are useful functions, but we aren't using them yet.
#if 0
// Get an axis of a certain ID number
static mobj_t *P_GetAxis(INT32 num)
{
@ -3962,6 +3951,8 @@ static void P_ParabolicMove(mobj_t *mo, fixed_t x, fixed_t y, fixed_t z, fixed_t
mo->momz = FixedDiv(dh, 2*fixConst) + FixedDiv(dz, FixedDiv(dh, fixConst/2));
}
#endif
/* set follower state with our weird hacks
the reason we do this is to avoid followers ever using actions (majormods, yikes!)
without having to touch p_mobj.c.
@ -4006,7 +3997,7 @@ static void P_HandleFollower(player_t *player)
angle_t an;
fixed_t zoffs;
fixed_t sx, sy, sz;
UINT8 color;
UINT16 color;
fixed_t bubble; // bubble scale (0 if no bubble)
mobj_t *bmobj; // temp bubble mobj
@ -4056,17 +4047,17 @@ static void P_HandleFollower(player_t *player)
switch (player->followercolor)
{
case MAXSKINCOLORS: // "Match"
case MAXSKINCOLORS: // "Match"
color = player->skincolor;
break;
case MAXSKINCOLORS+1: // "Opposite"
color = KartColor_Opposite[player->skincolor*2];
case MAXSKINCOLORS+1: // "Opposite"
color = skincolors[player->skincolor].invcolor;
break;
default:
color = player->followercolor;
if (!color || color > MAXSKINCOLORS+2) // Make sure this isn't garbage
color = player->skincolor; // "Match" as fallback.
if (!color || color > MAXSKINCOLORS+2) // Make sure this isn't garbage
color = player->skincolor; // "Match" as fallback.
break;
}
@ -4179,7 +4170,7 @@ static void P_HandleFollower(player_t *player)
// handle follower animations. Could probably be better...
// hurt or dead
if (player->kartstuff[k_spinouttimer] || player->mo->state == &states[S_KART_SPIN] || player->mo->health <= 0)
if (player->kartstuff[k_spinouttimer] || player->mo->state == &states[S_KART_SPINOUT] || player->mo->health <= 0)
{
player->follower->movecount = 0; // cancel hit confirm.
player->follower->angle = player->frameangle; // spin out
@ -4413,7 +4404,9 @@ void P_PlayerThink(player_t *player)
if (player->spectator &&
#endif
(gametyperules & GTR_LIVES))
{
/*P_ConsiderAllGone()*/;
}
if (player->playerstate == PST_DEAD)
{
@ -4614,7 +4607,7 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_nocontrol] & ((1<<15)-1) && player->powers[pw_nocontrol] < UINT16_MAX)
{
if (!(--player->powers[pw_nocontrol]))
player->pflags &= ~PF_SKIDDOWN;
player->pflags &= ~PF_WPNDOWN;
}
else
player->powers[pw_nocontrol] = 0;
@ -4629,8 +4622,7 @@ void P_PlayerThink(player_t *player)
player->powers[pw_super]++;
// Flash player after being hit.
if (!(//player->pflags & PF_NIGHTSMODE ||
player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
if (!(player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| (player->respawn.state != RESPAWNST_NONE) // Respawn timer (for drop dash effect)
|| (player->pflags & PF_GAMETYPEOVER) // NO CONTEST explosion
@ -4651,36 +4643,6 @@ void P_PlayerThink(player_t *player)
LUAh_PlayerThink(player);
}
// Checks if the mobj is above lava. Used by Pterabyte.
static boolean P_MobjAboveLava(mobj_t *mobj)
{
sector_t *sector = mobj->subsector->sector;
if (sector->ffloors)
{
ffloor_t *rover;
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || GETSECSPECIAL(rover->master->frontsector->special, 1) != 3)
continue;
if (mobj->eflags & MFE_VERTICALFLIP)
{
if (*rover->bottomheight <= mobj->ceilingz && *rover->bottomheight >= mobj->z)
return true;
}
else
{
if (*rover->topheight >= mobj->floorz && *rover->topheight <= mobj->z)
return true;
}
}
}
return false;
}
//
// P_PlayerAfterThink
//
@ -4688,8 +4650,6 @@ static boolean P_MobjAboveLava(mobj_t *mobj)
//
void P_PlayerAfterThink(player_t *player)
{
ticcmd_t *cmd;
//INT32 oldweapon = player->currentweapon; // SRB2kart - unused
camera_t *thiscam = NULL; // if not one of the displayed players, just don't bother
UINT8 i;
@ -4701,8 +4661,6 @@ void P_PlayerAfterThink(player_t *player)
}
#endif
cmd = &player->cmd;
#ifdef SECTORSPECIALSAFTERTHINK
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
player->onconveyor = 0;

View file

@ -974,7 +974,7 @@ static void R_Subsector(size_t num)
&& ((viewz < heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz > heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
{
UINT8 newlightlevel;
INT32 newlightlevel;
light = R_GetPlaneLight(frontsector, planecenterz,
viewz < heightcheck);
@ -1010,7 +1010,7 @@ static void R_Subsector(size_t num)
&& ((viewz > heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)))
|| (viewz < heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES))))
{
UINT8 newlightlevel;
INT32 newlightlevel;
light = R_GetPlaneLight(frontsector, planecenterz, viewz < heightcheck);
@ -1059,12 +1059,12 @@ static void R_Subsector(size_t num)
&& polysec->floorheight >= floorcenterz
&& (viewz < polysec->floorheight))
{
UINT8 newlightlevel;
INT32 newlightlevel;
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
newlightlevel = (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel);
R_PlaneLightOverride(polysec, false, newlightlevel);
R_PlaneLightOverride(polysec, false, &newlightlevel);
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs,
@ -1090,12 +1090,12 @@ static void R_Subsector(size_t num)
&& polysec->ceilingheight <= ceilingcenterz
&& (viewz > polysec->ceilingheight))
{
UINT8 newlightlevel;
INT32 newlightlevel;
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
newlightlevel = (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel);
R_PlaneLightOverride(polysec, true, newlightlevel);
R_PlaneLightOverride(polysec, true, &newlightlevel);
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,

View file

@ -1671,94 +1671,6 @@ static void R_InitSpriteLumps(void)
Z_Malloc(max_spritelumps*sizeof(*spritecachedinfo), PU_STATIC, &spritecachedinfo);
}
//
// R_CreateFadeColormaps
//
static void R_CreateFadeColormaps(void)
{
UINT8 px, fade;
RGBA_t rgba;
INT32 r, g, b;
size_t len, i;
len = (256 * FADECOLORMAPROWS);
fadecolormap = Z_MallocAlign(len*2, PU_STATIC, NULL, 8);
for (i = 0; i < len*2; i++)
fadecolormap[i] = (i%256);
// Load in the light tables, now 64k aligned for smokie...
{
lumpnum_t lump = W_CheckNumForName("FADECMAP");
lumpnum_t wlump = W_CheckNumForName("FADEWMAP");
// to black
if (lump != LUMPERROR)
W_ReadLumpHeader(lump, fadecolormap, len, 0U);
// to white
if (wlump != LUMPERROR)
W_ReadLumpHeader(wlump, fadecolormap+len, len, 0U);
// missing "to white" colormap lump
if (lump != LUMPERROR && wlump == LUMPERROR)
goto makewhite;
// missing "to black" colormap lump
else if (lump == LUMPERROR && wlump != LUMPERROR)
goto makeblack;
// both lumps found
else if (lump != LUMPERROR && wlump != LUMPERROR)
return;
}
#define GETCOLOR \
px = colormaps[i%256]; \
fade = (i/256) * (256 / FADECOLORMAPROWS); \
rgba = V_GetMasterColor(px);
// to black
makeblack:
for (i = 0; i < len; i++)
{
// find pixel and fade amount
GETCOLOR;
// subtractive color blending
r = rgba.s.red - FADEREDFACTOR*fade/10;
g = rgba.s.green - FADEGREENFACTOR*fade/10;
b = rgba.s.blue - FADEBLUEFACTOR*fade/10;
// clamp values
if (r < 0) r = 0;
if (g < 0) g = 0;
if (b < 0) b = 0;
// find nearest color in palette
fadecolormap[i] = NearestColor(r,g,b);
}
// to white
makewhite:
for (i = len; i < len*2; i++)
{
// find pixel and fade amount
GETCOLOR;
// additive color blending
r = rgba.s.red + FADEREDFACTOR*fade/10;
g = rgba.s.green + FADEGREENFACTOR*fade/10;
b = rgba.s.blue + FADEBLUEFACTOR*fade/10;
// clamp values
if (r > 255) r = 255;
if (g > 255) g = 255;
if (b > 255) b = 255;
// find nearest color in palette
fadecolormap[i] = NearestColor(r,g,b);
}
#undef GETCOLOR
}
//
// R_InitColormaps
//
@ -1774,9 +1686,6 @@ static void R_InitColormaps(void)
W_ReadLump(lump, colormaps);
// no need to init encoremap at this stage
// Make colormap for fades
R_CreateFadeColormaps();
// Init Boom colormaps.
R_ClearColormaps();
@ -1806,9 +1715,6 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap)
}
W_ReadLumpHeader(lump, colormaps, W_LumpLength(basecolormaplump), 0U);
if (fadecolormap)
Z_Free(fadecolormap);
R_CreateFadeColormaps();
// Encore mode.
if (newencoremap != LUMPERROR)
@ -2171,6 +2077,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
// This code creates the colormap array used by software renderer
/////////////////////
{
double r, g, b, cbrightness;
int p;
lighttable_t *colormap_p;
@ -2241,7 +2148,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
if (encoremap)
{
lighttable_t *colormap_p2 = extra_colormaps[mapnum].colormap;
lighttable_t *colormap_p2 = lighttable;
for (p = 0; p < 32; p++)
{

View file

@ -215,7 +215,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolornum_t color, UINT8 flags
{
for (i = 0; i < (INT32)(sizeof(translationtablecache) / sizeof(translationtablecache[0])); i++)
if (translationtablecache[i] && translationtablecache[i][color])
R_GenerateTranslationColormap(translationtablecache[i][color], i>=MAXSKINS ? MAXSKINS-i-1 : i, color);
K_GenerateKartColormap(translationtablecache[i][color], i>=MAXSKINS ? MAXSKINS-i-1 : i, color);
skincolor_modified[color] = false;
}
}
@ -225,7 +225,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolornum_t color, UINT8 flags
if (!ret)
{
ret = Z_MallocAlign(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL, 8);
K_GenerateKartColormap(ret, skinnum, color); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
K_GenerateKartColormap(ret, skinnum, color); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
// Cache the colormap if desired
if (flags & GTC_CACHE)

View file

@ -79,32 +79,6 @@ mobj_t *r_viewmobj;
int r_splitscreen;
// PORTALS!
// You can thank and/or curse JTE for these.
UINT8 portalrender;
sector_t *portalcullsector;
typedef struct portal_pair
{
INT32 line1;
INT32 line2;
UINT8 pass;
struct portal_pair *next;
fixed_t viewx;
fixed_t viewy;
fixed_t viewz;
angle_t viewangle;
INT32 start;
INT32 end;
INT16 *ceilingclip;
INT16 *floorclip;
fixed_t *frontscale;
} portal_pair;
portal_pair *portal_base, *portal_cap;
line_t *portalclipline;
INT32 portalclipstart, portalclipend;
//
// precalculated math tables
//
@ -172,10 +146,12 @@ void SendWeaponPref3(void);
void SendWeaponPref4(void);
consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam = {"chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam3 = {"chasecam3", "On", CV_CALL, CV_OnOff, ChaseCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam4 = {"chasecam4", "On", CV_CALL, CV_OnOff, ChaseCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
{"chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"chasecam3", "On", CV_CALL, CV_OnOff, ChaseCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"chasecam4", "On", CV_CALL, CV_OnOff, ChaseCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
};
consvar_t cv_shadow = {"shadow", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_skybox = {"skybox", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -1664,7 +1640,6 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_cam_height[i]);
CV_RegisterVar(&cv_cam_speed[i]);
CV_RegisterVar(&cv_cam_rotate[i]);
CV_RegisterVar(&cv_cam_rotspeed[i]);
}
CV_RegisterVar(&cv_showhud);

View file

@ -1028,7 +1028,7 @@ void R_DrawSinglePlane(visplane_t *pl)
}
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
#ifndef NOWATER
#ifndef NOWATER
if (pl->ffloor->flags & FF_RIPPLE)
{
INT32 top, bottom;
@ -1036,6 +1036,8 @@ void R_DrawSinglePlane(visplane_t *pl)
itswater = true;
if (spanfunctype == SPANDRAWFUNC_TRANS)
{
UINT8 i;
spanfunctype = SPANDRAWFUNC_WATER;
// Copy the current scene, ugh
@ -1048,12 +1050,45 @@ void R_DrawSinglePlane(visplane_t *pl)
bottom = vid.height;
// Only copy the part of the screen we need
VID_BlitLinearScreen((splitscreen && viewplayer == &players[secondarydisplayplayer]) ? screens[0] + (top+(vid.height>>1))*vid.width : screens[0]+((top)*vid.width), screens[1]+((top)*vid.width),
vid.width, bottom-top,
vid.width, vid.width);
for (i = 0; i <= r_splitscreen; i++)
{
if (viewplayer == &players[displayplayers[i]])
{
INT32 scrx = 0;
INT32 scry = top;
INT32 offset;
if (r_splitscreen == 1)
{
if (i & 1)
{
scry += viewheight;
}
}
else
{
if (i & 1)
{
scrx += viewwidth;
}
if (i / 2)
{
scry += viewheight;
}
}
offset = (scry*vid.width) + scrx;
// No idea if this works
VID_BlitLinearScreen(screens[0] + offset, screens[1] + offset,
viewwidth, bottom-top,
vid.width, vid.width);
}
}
}
}
#endif
#endif
}
else
light = (pl->lightlevel >> LIGHTSEGSHIFT);

View file

@ -55,6 +55,8 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
{
UINT8 super = 0, i = 0;
(void)player;
if (!skin)
return 0;
@ -74,13 +76,13 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
switch(spr2)
{
// Normal special cases.
// (none in kart)
// Normal special cases.
// (none in kart)
// Use the handy list, that's what it's there for!
default:
spr2 = spr2defaults[spr2];
break;
// Use the handy list, that's what it's there for!
default:
spr2 = spr2defaults[spr2];
break;
}
spr2 |= super;
@ -107,7 +109,6 @@ static void Sk_SetDefaultValue(skin_t *skin)
skin->flags = 0;
strcpy(skin->realname, "Someone");
strcpy(skin->hudname, "???");
skin->starttranscolor = 96;
skin->prefcolor = SKINCOLOR_GREEN;
@ -150,7 +151,7 @@ UINT32 R_GetSkinAvailabilities(void)
UINT8 i;
UINT32 response = 0;
for (i = 0; i < MAXUNLOCKABLES; s++)
for (i = 0; i < MAXUNLOCKABLES; i++)
{
if (unlockables[i].type == SECRET_SKIN && unlockables[i].unlocked)
{
@ -274,7 +275,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
player_t *player = &players[playernum];
skin_t *skin = &skins[skinnum];
UINT16 newcolor = 0;
UINT8 i;
//UINT8 i;
if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists!
{
@ -360,8 +361,6 @@ static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
return INT16_MAX; // not found
}
#define HUDNAMEWRITE(value) STRBUFCPY(skin->hudname, value)
// turn _ into spaces and . into katana dot
#define SYMBOLCONVERT(name) for (value = name; *value; value++)\
{\
@ -681,8 +680,8 @@ next_token:
R_FlushTranslationColormapCache();
if (!skin->availability) // Safe to print...
CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
#ifdef SKINVALUES
skin_cons_t[numskins].value = numskins;
skin_cons_t[numskins].strvalue = skin->name;
@ -847,13 +846,11 @@ next_token:
R_FlushTranslationColormapCache();
if (!skin->availability) // Safe to print...
CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name);
CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name);
}
return;
}
#undef HUDNAMEWRITE
#undef SYMBOLCONVERT
// SRB2Kart: Followers!

View file

@ -791,16 +791,8 @@ static void R_DrawVisSprite(vissprite_t *vis)
colfunc = colfuncs[COLDRAWFUNC_TRANSTRANS];
dc_transmap = vis->transmap;
if (!(vis->cut & SC_PRECIP) && vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
else if (!(vis->cut & SC_PRECIP)
&& vis->mobj->player && vis->mobj->player->dashmode >= DASHMODE_THRESHOLD
&& (vis->mobj->player->charflags & SF_DASHMODE)
&& ((leveltime/2) & 1))
{
if (vis->mobj->player->charflags & SF_MACHINE)
dc_translation = R_GetTranslationColormap(TC_DASHMODE, 0, GTC_CACHE);
else
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
}
else if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_>
{
@ -808,7 +800,9 @@ static void R_DrawVisSprite(vissprite_t *vis)
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
else // Use the defaults
{
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
}
}
else if (vis->transmap)
{
@ -822,16 +816,8 @@ static void R_DrawVisSprite(vissprite_t *vis)
// New colormap stuff for skins Tails 06-07-2002
if (!(vis->cut & SC_PRECIP) && vis->mobj->colorized)
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
else if (!(vis->cut & SC_PRECIP)
&& vis->mobj->player && vis->mobj->player->dashmode >= DASHMODE_THRESHOLD
&& (vis->mobj->player->charflags & SF_DASHMODE)
&& ((leveltime/2) & 1))
{
if (vis->mobj->player->charflags & SF_MACHINE)
dc_translation = R_GetTranslationColormap(TC_DASHMODE, 0, GTC_CACHE);
else
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
}
else if (!(vis->cut & SC_PRECIP) && vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
{
@ -839,7 +825,9 @@ static void R_DrawVisSprite(vissprite_t *vis)
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
}
else // Use the defaults
{
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
}
}
else if (vis->mobj->sprite == SPR_PLAY) // Looks like a player, but doesn't have a color? Get rid of green sonic syndrome.
{
@ -1388,8 +1376,8 @@ static void R_ProjectSprite(mobj_t *thing)
mobj_t *oldthing = thing;
const fixed_t oldthingxpos = oldthing->x + oldthing->sprxoff;
const fixed_t oldthingypos = oldthing->y + oldthing->spryoff;
//const fixed_t oldthingxpos = oldthing->x + oldthing->sprxoff;
//const fixed_t oldthingypos = oldthing->y + oldthing->spryoff;
const fixed_t oldthingzpos = oldthing->z + oldthing->sprzoff;
fixed_t tr_x, tr_y;

View file

@ -69,8 +69,7 @@ void R_ClipSprites(drawseg_t* dsstart, portal_t* portal);
boolean R_ThingVisible (mobj_t *thing);
boolean R_ThingVisibleWithinDist (mobj_t *thing,
fixed_t draw_dist,
fixed_t nights_draw_dist);
fixed_t draw_dist);
boolean R_PrecipThingVisible (precipmobj_t *precipthing,
fixed_t precip_draw_dist);