mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
actually, make all player stats precise
This commit is contained in:
parent
8cc0feb21d
commit
fa02931f97
1 changed files with 20 additions and 21 deletions
41
src/g_demo.c
41
src/g_demo.c
|
@ -95,7 +95,7 @@ demoghost *ghosts = NULL;
|
|||
// DEMO RECORDING
|
||||
//
|
||||
|
||||
#define DEMOVERSION 0x000f
|
||||
#define DEMOVERSION 0x0010
|
||||
#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F"
|
||||
|
||||
#define DF_GHOST 0x01 // This demo contains ghost data too!
|
||||
|
@ -1483,11 +1483,11 @@ void G_BeginRecording(void)
|
|||
// Stats
|
||||
WRITEUINT8(demo_p,player->charability);
|
||||
WRITEUINT8(demo_p,player->charability2);
|
||||
WRITEUINT8(demo_p,player->actionspd>>FRACBITS);
|
||||
WRITEUINT8(demo_p,player->mindash>>FRACBITS);
|
||||
WRITEUINT8(demo_p,player->maxdash>>FRACBITS);
|
||||
WRITEUINT8(demo_p,player->normalspeed>>FRACBITS);
|
||||
WRITEUINT8(demo_p,player->runspeed>>FRACBITS);
|
||||
WRITEFIXED(demo_p,player->actionspd);
|
||||
WRITEFIXED(demo_p,player->mindash);
|
||||
WRITEFIXED(demo_p,player->maxdash);
|
||||
WRITEFIXED(demo_p,player->normalspeed);
|
||||
WRITEFIXED(demo_p,player->runspeed);
|
||||
WRITEUINT8(demo_p,player->thrustfactor);
|
||||
WRITEUINT8(demo_p,player->accelstart);
|
||||
WRITEUINT8(demo_p,player->acceleration);
|
||||
|
@ -1687,7 +1687,8 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
|
|||
switch(oldversion) // demoversion
|
||||
{
|
||||
case DEMOVERSION: // latest always supported
|
||||
case 0x000e: // The previous demoversions also supported
|
||||
case 0x000f: // The previous demoversions also supported
|
||||
case 0x000e:
|
||||
case 0x000d: // all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
break;
|
||||
|
@ -1831,6 +1832,7 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
demoversion = READUINT16(demo_p);
|
||||
switch(demoversion)
|
||||
{
|
||||
case 0x000f:
|
||||
case 0x000d:
|
||||
case 0x000e:
|
||||
case DEMOVERSION: // latest always supported
|
||||
|
@ -1913,18 +1915,18 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
|
||||
charability = READUINT8(demo_p);
|
||||
charability2 = READUINT8(demo_p);
|
||||
actionspd = (fixed_t)READUINT8(demo_p)<<FRACBITS;
|
||||
mindash = (fixed_t)READUINT8(demo_p)<<FRACBITS;
|
||||
maxdash = (fixed_t)READUINT8(demo_p)<<FRACBITS;
|
||||
normalspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
|
||||
runspeed = (fixed_t)READUINT8(demo_p)<<FRACBITS;
|
||||
actionspd = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
mindash = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
maxdash = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
normalspeed = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
runspeed = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
thrustfactor = READUINT8(demo_p);
|
||||
accelstart = READUINT8(demo_p);
|
||||
acceleration = READUINT8(demo_p);
|
||||
height = (demoversion < 0x000e) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
spinheight = (demoversion < 0x000e) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
camerascale = READFIXED(demo_p);
|
||||
shieldscale = READFIXED(demo_p);
|
||||
camerascale = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
shieldscale = (demoversion < 0x0010) ? (fixed_t)READUINT8(demo_p)<<FRACBITS : READFIXED(demo_p);
|
||||
jumpfactor = READFIXED(demo_p);
|
||||
followitem = READUINT32(demo_p);
|
||||
|
||||
|
@ -2085,6 +2087,7 @@ void G_AddGhost(char *defdemoname)
|
|||
ghostversion = READUINT16(p);
|
||||
switch(ghostversion)
|
||||
{
|
||||
case 0x000f:
|
||||
case 0x000d:
|
||||
case 0x000e:
|
||||
case DEMOVERSION: // latest always supported
|
||||
|
@ -2161,17 +2164,12 @@ void G_AddGhost(char *defdemoname)
|
|||
// Ghosts do not have a player structure to put this in.
|
||||
p++; // charability
|
||||
p++; // charability2
|
||||
p++; // actionspd
|
||||
p++; // mindash
|
||||
p++; // maxdash
|
||||
p++; // normalspeed
|
||||
p++; // runspeed
|
||||
p += (ghostversion < 0x0010) ? 5 : 5 * sizeof(fixed_t); // actionspd, mindash, maxdash, normalspeed, and runspeed
|
||||
p++; // thrustfactor
|
||||
p++; // accelstart
|
||||
p++; // acceleration
|
||||
p += (ghostversion < 0x000e) ? 2 : 2 * sizeof(fixed_t); // height and spinheight
|
||||
p++; // camerascale
|
||||
p++; // shieldscale
|
||||
p += (ghostversion < 0x0010) ? 2 : 2 * sizeof(fixed_t); // camerascale and shieldscale
|
||||
p += 4; // jumpfactor
|
||||
p += 4; // followitem
|
||||
|
||||
|
@ -2347,6 +2345,7 @@ void G_DoPlayMetal(void)
|
|||
switch(metalversion)
|
||||
{
|
||||
case DEMOVERSION: // latest always supported
|
||||
case 0x000f:
|
||||
case 0x000e: // There are checks wheter the momentum is from older demo versions or not
|
||||
case 0x000d: // all that changed between then and now was longer color name
|
||||
case 0x000c:
|
||||
|
|
Loading…
Reference in a new issue