wipe a bunch of crap
This commit is contained in:
1 parent
6301389546
commit
4bddf1118c
16 files changed
+102
-113
No files matched your search
+40
-14
@@ -159,6 +159,7 @@ boolean nodeingame[MAXNETNODES] = {}; // set false as nodes leave game
|
||||
|
||||
tic_t servermaxping = 20; // server's max delay, in frames. Defaults to 20
|
||||
static tic_t nettics[MAXNETNODES]; // what tic the client have received
|
||||
static tic_t supposedtics[MAXNETNODES]; // nettics prevision for smaller packet
|
||||
static UINT8 nodewaiting[MAXNETNODES];
|
||||
static tic_t firstticstosend; // min of the nettics
|
||||
static tic_t tictoclear = 0; // optimize d_clearticcmd
|
||||
@@ -185,6 +186,7 @@ boolean hu_stopped = false;
|
||||
|
||||
// Client specific
|
||||
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS][MAXGENTLEMENDELAY];
|
||||
static boolean cl_packetmissed;
|
||||
// here it is for the secondary local player (splitscreen)
|
||||
static UINT8 mynode; // my address pointofview server
|
||||
|
||||
@@ -4298,6 +4300,7 @@ static void ResetNode(INT32 node)
|
||||
playerpernode[node] = 0;
|
||||
|
||||
nettics[node] = gametic;
|
||||
supposedtics[node] = gametic;
|
||||
|
||||
sendingsavegame[node] = false;
|
||||
|
||||
@@ -4352,7 +4355,7 @@ void SV_ResetServer(void)
|
||||
ClearAdminPlayers();
|
||||
|
||||
mynode = 0;
|
||||
|
||||
cl_packetmissed = false;
|
||||
#ifdef SATURNPAK
|
||||
cl_redownloadinggamestate = false;
|
||||
#endif
|
||||
@@ -4454,7 +4457,7 @@ void D_QuitNetGame(void)
|
||||
static inline void SV_AddNode(INT32 node)
|
||||
{
|
||||
nettics[node] = gametic;
|
||||
|
||||
supposedtics[node] = gametic;
|
||||
// little hack because the server connects to itself and puts
|
||||
// nodeingame when connected not here
|
||||
if (node)
|
||||
@@ -5536,6 +5539,14 @@ static void PT_ClientCmd(INT32 netconsole, SINT8 node)
|
||||
realstart = ExpandTics(netbuffer->u.clientpak.client_tic, nettics[node]);
|
||||
realend = ExpandTics(netbuffer->u.clientpak.resendfrom, nettics[node]);
|
||||
|
||||
if (netbuffer->packettype == PT_CLIENTMIS || netbuffer->packettype == PT_CLIENT2MIS
|
||||
|| netbuffer->packettype == PT_CLIENT3MIS || netbuffer->packettype == PT_CLIENT4MIS
|
||||
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS
|
||||
|| supposedtics[node] < realend)
|
||||
{
|
||||
supposedtics[node] = realend;
|
||||
}
|
||||
|
||||
// Discard out of order packet
|
||||
if (nettics[node] > realend)
|
||||
{
|
||||
@@ -5887,6 +5898,7 @@ static void PT_ServerTics(SINT8 node)
|
||||
|
||||
if (realend > gametic + CLIENTBACKUPTICS)
|
||||
realend = gametic + CLIENTBACKUPTICS;
|
||||
cl_packetmissed = realstart > neededtic;
|
||||
|
||||
UINT8 *pak = (UINT8 *)&packet->cmds;
|
||||
UINT8 *txtpak = (UINT8 *)&packet->cmds[packet->numslots * packet->numtics];
|
||||
@@ -6019,12 +6031,11 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
case PT_CLIENT2CMD:
|
||||
case PT_CLIENT3CMD:
|
||||
case PT_CLIENT4CMD:
|
||||
case PT_NODEKEEPALIVE:
|
||||
// "mis" tics kept for vanilla compat
|
||||
case PT_CLIENTMIS:
|
||||
case PT_CLIENT2MIS:
|
||||
case PT_CLIENT3MIS:
|
||||
case PT_CLIENT4MIS:
|
||||
case PT_NODEKEEPALIVE:
|
||||
case PT_NODEKEEPALIVEMIS:
|
||||
PT_ClientCmd(netconsole, node);
|
||||
break;
|
||||
@@ -6316,18 +6327,25 @@ static void SV_SendServerKeepAlive(void)
|
||||
static void CL_SendClientCmd(void)
|
||||
{
|
||||
size_t packetsize = 0;
|
||||
boolean mis = false;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
|
||||
netbuffer->packettype = PT_CLIENTCMD;
|
||||
|
||||
if (cl_packetmissed)
|
||||
{
|
||||
netbuffer->packettype = PT_CLIENTMIS;
|
||||
mis = true;
|
||||
}
|
||||
|
||||
netbuffer->u.clientpak.resendfrom = (UINT8)(neededtic & UINT8_MAX);
|
||||
netbuffer->u.clientpak.client_tic = (UINT8)(gametic & UINT8_MAX);
|
||||
|
||||
if (gamestate == GS_WAITINGPLAYERS)
|
||||
{
|
||||
// Send PT_NODEKEEPALIVE packet
|
||||
netbuffer->packettype = PT_NODEKEEPALIVE;
|
||||
netbuffer->packettype = (mis ? PT_NODEKEEPALIVEMIS : PT_NODEKEEPALIVE);
|
||||
packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16);
|
||||
HSendPacket(servernode, false, 0, packetsize);
|
||||
}
|
||||
@@ -6390,19 +6408,19 @@ static void CL_SendClientCmd(void)
|
||||
|
||||
if (splitscreen || botingame) // Send a special packet with 2 cmd for splitscreen
|
||||
{
|
||||
netbuffer->packettype = PT_CLIENT2CMD;
|
||||
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
|
||||
packetsize = sizeof (client2cmd_pak);
|
||||
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1][lagDelay], 1);
|
||||
|
||||
if (splitscreen > 1)
|
||||
{
|
||||
netbuffer->packettype = PT_CLIENT3CMD;
|
||||
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
|
||||
packetsize = sizeof (client3cmd_pak);
|
||||
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2][lagDelay], 1);
|
||||
|
||||
if (splitscreen > 2)
|
||||
{
|
||||
netbuffer->packettype = PT_CLIENT4CMD;
|
||||
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
|
||||
packetsize = sizeof (client4cmd_pak);
|
||||
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3][lagDelay], 1);
|
||||
}
|
||||
@@ -6457,13 +6475,14 @@ static void SV_SendTics(void)
|
||||
|
||||
// send to all client but not to me
|
||||
// for each node create a packet with x tics and send it
|
||||
// x is computed using nettics[n], max packet size and maketic
|
||||
// x is computed using supposedtics[n], max packet size and maketic
|
||||
for (n = 1; n < MAXNETNODES; n++)
|
||||
{
|
||||
if (!nodeingame[n])
|
||||
continue;
|
||||
|
||||
realfirsttic = nettics[n];
|
||||
// assert supposedtics[n]>=nettics[n]
|
||||
realfirsttic = supposedtics[n];
|
||||
lasttictosend = min(maketic, nettics[n] + CLIENTBACKUPTICS);
|
||||
|
||||
if (realfirsttic >= lasttictosend)
|
||||
@@ -6472,8 +6491,8 @@ static void SV_SendTics(void)
|
||||
// to resent packet that are supposed lost (this is necessary since lost
|
||||
// packet detection work when we have received packet with firsttic > neededtic
|
||||
// (getpacket servertics case)
|
||||
DEBFILE(va("Nothing to send node %u mak=%u net=%u \n",
|
||||
n, lasttictosend, nettics[n]));
|
||||
DEBFILE(va("Nothing to send node %u mak=%u sup=%u net=%u \n",
|
||||
n, lasttictosend, supposedtics[n], nettics[n]));
|
||||
realfirsttic = nettics[n];
|
||||
if (realfirsttic >= lasttictosend || (I_GetTime() + n)&3)
|
||||
// all tic are ok
|
||||
@@ -6553,10 +6572,17 @@ static void SV_SendTics(void)
|
||||
|
||||
packsize = bufpos - (UINT8 *)&(netbuffer->u);
|
||||
HSendPacket(n, false, 0, packsize);
|
||||
}
|
||||
|
||||
// when tic are too large, only one tic is sent so don't go backward!
|
||||
if (lasttictosend-doomcom->extratics > realfirsttic)
|
||||
supposedtics[n] = lasttictosend-doomcom->extratics;
|
||||
else
|
||||
supposedtics[n] = lasttictosend;
|
||||
|
||||
supposedtics[n] = max(supposedtics[n], nettics[n]);
|
||||
}
|
||||
// node 0 is me!
|
||||
nettics[0] = maketic;
|
||||
supposedtics[0] = maketic;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+2
-25
@@ -106,31 +106,6 @@
|
||||
#define ASSET_HASH_PATCH_KART "00000000000000000000000000000000"
|
||||
#endif
|
||||
|
||||
/* Manually defined asset hashes for non-CMake builds
|
||||
* Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb
|
||||
* Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta
|
||||
* Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets
|
||||
* Last updated 2020 / 08 / 30 - Kart v1.3 - patch.kart
|
||||
* Last updated 2022 / 08 / 16 - Kart v1.4 - Main assets
|
||||
* Last updated 2022 / 08 / 19 - Kart v1.5 - gfx.kart
|
||||
* Last updated 2022 / 11 / 01 - Kart v1.6 - gfx.kart, maps.kart
|
||||
*/
|
||||
|
||||
// Base SRB2 hashes
|
||||
#define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7"
|
||||
#ifdef USE_PATCH_DTA
|
||||
#define ASSET_HASH_PATCH_DTA "b04fd9624bfd94dc96dcf4f400f7deb4"
|
||||
#endif
|
||||
|
||||
// SRB2Kart-specific hashes
|
||||
#define ASSET_HASH_GFX_KART "06f86ee16136eb8a7043b15001797034"
|
||||
#define ASSET_HASH_TEXTURES_KART "abb53d56aba47c3a8cb0f764da1c8b80"
|
||||
#define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964"
|
||||
#define ASSET_HASH_MAPS_KART "d051e55141ba736582228c456953cd98"
|
||||
#ifdef USE_PATCH_KART
|
||||
#define ASSET_HASH_PATCH_KART "00000000000000000000000000000000"
|
||||
#endif
|
||||
|
||||
#ifdef CMAKECONFIG
|
||||
#include "config.h"
|
||||
#else
|
||||
@@ -920,6 +895,8 @@ void D_SRB2Loop(void)
|
||||
if (renderisnewtic)
|
||||
S_UpdateSounds(); // move positional sounds
|
||||
|
||||
//LUA_Step();
|
||||
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
if (!dedicated && renderisnewtic)
|
||||
{
|
||||
|
||||
+1
-2
@@ -863,12 +863,11 @@ static void DebugPrintpacket(const char *header)
|
||||
case PT_CLIENT2CMD:
|
||||
case PT_CLIENT3CMD:
|
||||
case PT_CLIENT4CMD:
|
||||
case PT_NODEKEEPALIVE:
|
||||
// "mis" tics kept for vanilla compat
|
||||
case PT_CLIENTMIS:
|
||||
case PT_CLIENT2MIS:
|
||||
case PT_CLIENT3MIS:
|
||||
case PT_CLIENT4MIS:
|
||||
case PT_NODEKEEPALIVE:
|
||||
case PT_NODEKEEPALIVEMIS:
|
||||
fprintf(debugfile, " tic %4u resendfrom %u\n",
|
||||
(UINT32)netbuffer->u.clientpak.client_tic,
|
||||
|
||||
@@ -1073,13 +1073,6 @@ static void readlevelheader(MYFILE *f, INT32 num, INT32 wadnum)
|
||||
else
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE;
|
||||
}
|
||||
else if (fastcmp(word, "SUBTRACTNUM"))
|
||||
{
|
||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||
mapheaderinfo[num-1]->levelflags |= LF_SUBTRACTNUM;
|
||||
else
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_SUBTRACTNUM;
|
||||
}
|
||||
|
||||
// Individual triggers for menu flags
|
||||
else if (fastcmp(word, "HIDDEN"))
|
||||
@@ -7856,7 +7849,6 @@ struct {
|
||||
{"LF_NORELOAD",LF_NORELOAD},
|
||||
{"LF_NOZONE",LF_NOZONE},
|
||||
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
||||
{"LF_SUBTRACTNUM",LF_SUBTRACTNUM},
|
||||
// And map flags
|
||||
{"LF2_HIDEINMENU",LF2_HIDEINMENU},
|
||||
{"LF2_HIDEINSTATS",LF2_HIDEINSTATS},
|
||||
|
||||
@@ -296,7 +296,6 @@ typedef struct
|
||||
#define LF_NORELOAD 8 ///< Don't reload level on death
|
||||
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title
|
||||
#define LF_SECTIONRACE 32 ///< Section race level
|
||||
#define LF_SUBTRACTNUM 64 ///< Use subtractive position number (for bright levels)
|
||||
|
||||
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
|
||||
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen
|
||||
|
||||
@@ -488,6 +488,15 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
||||
|
||||
G_CopyTiccmd(cmd, &oldcmd[playernum], 1);
|
||||
|
||||
// what in the actual fuck is this???
|
||||
// SRB2kart: Copy-pasted from ticcmd building, removes that crappy demo cam
|
||||
if (((players[displayplayers[0]].mo && players[displayplayers[0]].speed > 0) // Moving
|
||||
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||
|| (players[displayplayers[0]].kartstuff[k_respawn]) // Respawning
|
||||
|| (players[displayplayers[0]].spectator || objectplacing)) // Not a physical player
|
||||
&& !(players[displayplayers[0]].kartstuff[k_spinouttimer] && players[displayplayers[0]].kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout
|
||||
localangle[0] += (cmd->angleturn<<16);
|
||||
|
||||
if (!(demoflags & DF_GHOST) && *demobuf.p == DEMOMARKER)
|
||||
{
|
||||
// end of demo data stream
|
||||
|
||||
@@ -237,7 +237,7 @@ static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
||||
|
||||
// This function organizes the geometry collected by HWR_ProcessPolygon calls into batches and uses
|
||||
// the rendering backend to draw them.
|
||||
void HWR_RenderBatches(boolean sort)
|
||||
void HWR_RenderBatches(void)
|
||||
{
|
||||
int finalVertexWritePos = 0; // position in finalVertexArray
|
||||
int finalIndexWritePos = 0; // position in finalVertexIndexArray
|
||||
@@ -288,13 +288,10 @@ void HWR_RenderBatches(boolean sort)
|
||||
polygonArraySorted[i] = &polygonArray[i];
|
||||
}
|
||||
|
||||
if (sort)
|
||||
{
|
||||
// sort polygons
|
||||
PS_START_TIMING(ps_hw_batchsorttime);
|
||||
qs22j(polygonArraySorted, polygonArraySize, sizeof(PolygonArrayEntry *), (useshader ? comparePolygons : comparePolygonsNoShaders));
|
||||
PS_STOP_TIMING(ps_hw_batchsorttime);
|
||||
}
|
||||
// sort polygons
|
||||
PS_START_TIMING(ps_hw_batchsorttime);
|
||||
qs22j(polygonArraySorted, polygonArraySize, sizeof(PolygonArrayEntry *), (useshader ? comparePolygons : comparePolygonsNoShaders));
|
||||
PS_STOP_TIMING(ps_hw_batchsorttime);
|
||||
|
||||
// sort order
|
||||
// 1. shader
|
||||
@@ -303,9 +300,7 @@ void HWR_RenderBatches(boolean sort)
|
||||
// 4. colors + light level
|
||||
// not sure about what order of the last 2 should be, or if it even matters
|
||||
|
||||
// dont overwrite this on consecutive calls
|
||||
if (!sort)
|
||||
PS_START_TIMING(ps_hw_batchdrawtime);
|
||||
PS_START_TIMING(ps_hw_batchdrawtime);
|
||||
|
||||
currentShader = polygonArraySorted[0]->shader;
|
||||
currentTexture = polygonArraySorted[0]->texture;
|
||||
@@ -500,8 +495,7 @@ void HWR_RenderBatches(boolean sort)
|
||||
polygonArraySize = 0;
|
||||
unsortedVertexArraySize = 0;
|
||||
|
||||
if (!sort)
|
||||
PS_STOP_TIMING(ps_hw_batchdrawtime);
|
||||
PS_STOP_TIMING(ps_hw_batchdrawtime);
|
||||
}
|
||||
|
||||
#endif // HWRENDER
|
||||
@@ -37,7 +37,7 @@ typedef struct
|
||||
void HWR_StartBatching(void);
|
||||
void HWR_SetCurrentTexture(GLMipmap_t *texture);
|
||||
void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, int shader, boolean horizonSpecial);
|
||||
void HWR_RenderBatches(boolean sort);
|
||||
void HWR_RenderBatches(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -673,8 +673,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
#define SETUP3DVERT(vert, vx, vy) {\
|
||||
/* Hurdler: add scrolling texture on floor/ceiling */\
|
||||
vert->s = (((vx) / fflatsize) - flatxref + scrollx);\
|
||||
vert->t = (flatyref - ((vy) / fflatsize) + scrolly);\
|
||||
vert->s = (float)(((vx) / fflatsize) - flatxref + scrollx);\
|
||||
vert->t = (float)(flatyref - ((vy) / fflatsize) + scrolly);\
|
||||
\
|
||||
/* Need to rotate before translate */\
|
||||
if (angle) /* Only needs to be done if there's an altered angle */\
|
||||
@@ -1810,7 +1810,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
wallVerts[3].t = wallVerts[2].t = (static_cast<float>(texturevpeg) * glTex->scaleY);
|
||||
wallVerts[0].t = wallVerts[1].t = static_cast<float>(texturevpeg + gl_frontsector->ceilingheight - gl_frontsector->floorheight) * glTex->scaleY;
|
||||
wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX;
|
||||
wallVerts[2].s = wallVerts[1].s = cliphigh* glTex->scaleX;
|
||||
wallVerts[2].s = wallVerts[1].s = cliphigh * glTex->scaleX;
|
||||
|
||||
// Texture correction for slopes
|
||||
if (gl_linedef->flags & ML_EFFECT2)
|
||||
@@ -4470,9 +4470,6 @@ static void HWR_RenderDrawNodes(void)
|
||||
// Okay! Let's draw it all! Woo!
|
||||
GL_SetTransform(&atransform);
|
||||
|
||||
if (LIKELY(cv_glbatching.value))
|
||||
HWR_StartBatching();
|
||||
|
||||
for (i = 0; i < numdrawnodes; i++)
|
||||
{
|
||||
gl_drawnode_t *drawnode = &drawnodes[sortindex[i]];
|
||||
@@ -4526,9 +4523,6 @@ static void HWR_RenderDrawNodes(void)
|
||||
|
||||
PS_STOP_TIMING(ps_hw_nodedrawtime);
|
||||
|
||||
if (LIKELY(cv_glbatching.value))
|
||||
HWR_RenderBatches(false);
|
||||
|
||||
drawnodes.clear(); // clear so our size is 0 again!
|
||||
}
|
||||
|
||||
@@ -5678,7 +5672,7 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
||||
PS_STOP_TIMING(ps_bsptime);
|
||||
|
||||
if (LIKELY(cv_glbatching.value))
|
||||
HWR_RenderBatches(true);
|
||||
HWR_RenderBatches();
|
||||
|
||||
// Check for new console commands.
|
||||
NetUpdate();
|
||||
@@ -5705,9 +5699,6 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
||||
HWR_SortVisSprites();
|
||||
PS_STOP_TIMING(ps_hw_spritesorttime);
|
||||
|
||||
if (LIKELY(cv_glbatching.value && !cv_glmdls.value))
|
||||
HWR_StartBatching();
|
||||
|
||||
PS_START_TIMING(ps_hw_spritedrawtime);
|
||||
if (UNLIKELY(cv_glmdls.value))
|
||||
HWR_DrawSprites<DrawSpritesType::kModels>();
|
||||
@@ -5715,9 +5706,6 @@ static void HWR_RenderViewpoint(gl_portal_t *rootportal, int stencil_level, bool
|
||||
HWR_DrawSprites<DrawSpritesType::kSprites>();
|
||||
PS_STOP_TIMING(ps_hw_spritedrawtime);
|
||||
|
||||
if (LIKELY(cv_glbatching.value && !cv_glmdls.value))
|
||||
HWR_RenderBatches(false);
|
||||
|
||||
ps_numdrawnodes.value.i = 0;
|
||||
ps_hw_nodesorttime.value.p = 0;
|
||||
ps_hw_nodedrawtime.value.p = 0;
|
||||
|
||||
@@ -2968,10 +2968,10 @@ void GL_DrawModelEx(model_t *model, INT32 frameIndex, float duration, float tics
|
||||
tint.blue = byte2float(Surface->TintColor.s.blue);
|
||||
tint.alpha = byte2float(Surface->TintColor.s.alpha);
|
||||
|
||||
fade.red = byte2float(Surface->FadeColor.s.red);
|
||||
fade.green = byte2float(Surface->FadeColor.s.green);
|
||||
fade.blue = byte2float(Surface->FadeColor.s.blue);
|
||||
fade.alpha = byte2float(Surface->FadeColor.s.alpha);
|
||||
fade.red = byte2float(Surface->FadeColor.s.red);
|
||||
fade.green = byte2float(Surface->FadeColor.s.green);
|
||||
fade.blue = byte2float(Surface->FadeColor.s.blue);
|
||||
fade.alpha = byte2float(Surface->FadeColor.s.alpha);
|
||||
|
||||
if (Surface->LightTableId && Surface->LightTableId != lt_downloaded)
|
||||
{
|
||||
|
||||
@@ -2045,11 +2045,6 @@ static void K_DrawKartPositionNum(INT32 num)
|
||||
boolean flipvdraw = false; // used only for 2p splitscreen so overtaking doesn't make 1P's position fly off the screen.
|
||||
boolean overtake = false;
|
||||
|
||||
if ((mapheaderinfo[gamemap - 1]->levelflags & LF_SUBTRACTNUM) == LF_SUBTRACTNUM)
|
||||
{
|
||||
addOrSub = B_ADD;
|
||||
}
|
||||
|
||||
if ((cv_posanim.value && stplyr->kartstuff[k_positiondelay]) || stplyr->exiting)
|
||||
{
|
||||
if (cv_posanim.value == 2)
|
||||
|
||||
@@ -1312,6 +1312,19 @@ static void UnArchiveTables(UINT8 **p, boolean network)
|
||||
}
|
||||
}
|
||||
|
||||
/*void LUA_Step(void)
|
||||
{
|
||||
if (!gL)
|
||||
return;
|
||||
|
||||
if (lua_gettop(gL) != 0)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, "Eek, there is garbage on lua stack!\n");
|
||||
lua_settop(gL, 0);
|
||||
lua_gc(gL, LUA_GCSTEP, 1);
|
||||
}
|
||||
}*/
|
||||
|
||||
void LUA_Archive(savebuffer_t *save, boolean network)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ void LUA_InvalidateUserdata(void *data);
|
||||
void LUA_InvalidateLevel(void);
|
||||
void LUA_InvalidateMapthings(void);
|
||||
void LUA_InvalidatePlayer(player_t *player);
|
||||
|
||||
//void LUA_Step(void);
|
||||
void LUA_Archive(savebuffer_t *save, boolean network);
|
||||
void LUA_UnArchive(savebuffer_t *save, boolean network);
|
||||
|
||||
|
||||
@@ -10921,6 +10921,25 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
P_SetScale(karmahitbox, mobj->scale);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: handle splitscreen
|
||||
// Spectators can switch to freecam. This should be
|
||||
// disabled when they enter the race, or when the level
|
||||
// changes.
|
||||
if (!demo.playback)
|
||||
{
|
||||
if (!p->spectator)
|
||||
{
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (playernum == P_GetLocalPlayerNumForNum(i))
|
||||
{
|
||||
camera[i].freecam = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void P_AfterPlayerSpawn(INT32 playernum)
|
||||
|
||||
@@ -4242,17 +4242,6 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||
if (islocalplayer && displayplayers[0] != consoleplayer)
|
||||
displayplayers[0] = consoleplayer;
|
||||
|
||||
if (!demo.playback && islocalplayer)
|
||||
{
|
||||
if (!player->spectator)
|
||||
{
|
||||
const INT32 playernum = P_GetLocalPlayerNumForPlayer(player);
|
||||
|
||||
if (playernum != -1)
|
||||
camera[playernum].freecam = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (changeto == 1)
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[player-players], '\x85', M_GetText("Red team"), '\x80');
|
||||
else if (changeto == 2)
|
||||
@@ -4280,17 +4269,6 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||
if (islocalplayer && displayplayers[0] != consoleplayer)
|
||||
displayplayers[0] = consoleplayer;
|
||||
|
||||
if (!demo.playback && islocalplayer)
|
||||
{
|
||||
if (!player->spectator)
|
||||
{
|
||||
const INT32 playernum = P_GetLocalPlayerNumForPlayer(player);
|
||||
|
||||
if (playernum != -1)
|
||||
camera[playernum].freecam = false;
|
||||
}
|
||||
}
|
||||
|
||||
HU_AddChatText(va(M_GetText("\x82*%s entered the game."), player_names[player-players]), false);
|
||||
return true; // no more player->mo, cannot continue.
|
||||
}
|
||||
|
||||
+1
-1
@@ -1423,7 +1423,7 @@ UINT8 W_LumpExists(const char *name)
|
||||
// extract the lumpinfo out of the lumpnum
|
||||
// so we can do one more extra case ~sensitive~ name compare
|
||||
// otherwise we gotta fall through to our manual lump search below
|
||||
// lumpnum == (i << 16) | check
|
||||
// lumpnum == (wadnum << 16) | lumpinfo id
|
||||
UINT16 wadnum = (cachenum >> 16) & 0xFFFF;
|
||||
UINT16 lumpid = cachenum & 0xFFFF;
|
||||
lumpinfo_t *lump_p = &wadfiles[wadnum]->lumpinfo[lumpid];
|
||||
|
||||
Reference in new issue
Block a user