bigfoot complained that the timedemo framecounts didn't match vanilla. So now it matches vanilla (both nq and qw), but does not match bigfoot's own engine, because bigfoot's engine cheats and does not match vanilla.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4032 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-04-24 12:22:50 +00:00
parent 25ef3f02db
commit 5d12d96f87
5 changed files with 45 additions and 37 deletions

View file

@ -247,14 +247,14 @@ int readdemobytes(int *readpos, void *data, int len)
else else
demopreparsedbytes += demo_preparsedemo(demobuffer+demopreparsedbytes, demobuffersize-demopreparsedbytes); demopreparsedbytes += demo_preparsedemo(demobuffer+demopreparsedbytes, demobuffersize-demopreparsedbytes);
} }
else if (i < 0)
{ //0 means no data available yet
endofdemo = true;
return 0;
}
if (*readpos+len > demobuffersize) if (*readpos+len > demobuffersize)
{ {
if (i < 0)
{ //0 means no data available yet
endofdemo = true;
return 0;
}
len = demobuffersize; len = demobuffersize;
return 0; return 0;
} }
@ -493,11 +493,12 @@ qboolean CL_GetDemoMessage (void)
} }
#endif #endif
//client is loading content, don't flood it with packets while its still got no map loaded
if (cl.sendprespawn)
return 0;
readnext: readnext:
if (demopos)
{
demo_flushbytes(demopos);
demopos = 0;
}
// read the time from the packet // read the time from the packet
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV) if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
{ {
@ -513,7 +514,7 @@ readnext:
if (readdemobytes(&demopos, &msecsadded, sizeof(msecsadded)) != sizeof(msecsadded)) if (readdemobytes(&demopos, &msecsadded, sizeof(msecsadded)) != sizeof(msecsadded))
{ {
Con_DPrintf("Not enoug buffered\n"); Con_DPrintf("Not enough buffered\n");
demotime = olddemotime; demotime = olddemotime;
nextdemotime = demotime; nextdemotime = demotime;
} }
@ -534,29 +535,35 @@ readnext:
demotime = LittleFloat(demotime); demotime = LittleFloat(demotime);
} }
if (cl.sendprespawn)
{
CL_RequestNextDownload();
if (!cls.timedemo)
return 0;
}
// decide if it is time to grab the next message // decide if it is time to grab the next message
if (cls.timedemo) if (cls.timedemo)
{ {
if (cls.state == ca_active || cl.validsequence) if (cls.td_lastframe < 0)
cls.td_lastframe = demotime;
else if (demotime > cls.td_lastframe)
{ {
if (cls.td_lastframe < 0) cls.td_lastframe = demotime;
cls.td_lastframe = demotime; return 0; // already read this frame's message
else if (host_framecount == cls.td_lastframe)
{
return 0; // already read this frame's message
}
if (cls.td_startframe == -1)
{ //start the timer only once we are connected.
cls.td_starttime = Sys_DoubleTime();
cls.td_startframe = host_framecount;
//force the console up, we're done loading.
key_dest = key_game;
scr_con_current = 0;
}
if (cls.td_startframe == host_framecount+1)
cls.td_starttime = Sys_DoubleTime();
} }
if (cls.td_startframe == -1 && cls.state == ca_active)
{ //start the timer only once we are connected.
cls.td_starttime = Sys_DoubleTime();
cls.td_startframe = host_framecount;
//force the console up, we're done loading.
key_dest = key_game;
scr_con_current = 0;
}
if (cls.td_startframe == host_framecount+1)
cls.td_starttime = Sys_DoubleTime();
demtime = demotime; // warp demtime = demotime; // warp
} }
else if (!cl.paused && cls.state >= ca_onserver) else if (!cl.paused && cls.state >= ca_onserver)
@ -673,6 +680,7 @@ readnext:
readdemobytes (&demopos, &f, 4); readdemobytes (&demopos, &f, 4);
cl.viewangles[0][i] = LittleFloat (f); cl.viewangles[0][i] = LittleFloat (f);
} }
goto readnext;
/* }*/ /* }*/
break; break;
@ -779,7 +787,7 @@ readit:
demo_flushbytes(demopos); demo_flushbytes(demopos);
olddemotime = demotime; olddemotime = demotime;
cls.td_lastframe = host_framecount; // cls.td_lastframe = host_framecount;
return 1; return 1;
} }
@ -2239,7 +2247,7 @@ void CL_TimeDemo_f (void)
} }
//read the initial frame so load times don't count as part of the time //read the initial frame so load times don't count as part of the time
CL_ReadPackets(); // CL_ReadPackets();
// cls.td_starttime will be grabbed at the second frame of the demo, so // cls.td_starttime will be grabbed at the second frame of the demo, so
// all the loading time doesn't get counted // all the loading time doesn't get counted

View file

@ -3701,8 +3701,6 @@ double Host_Frame (double time)
pass1+pass2+pass3, pass1, pass2, pass3); pass1+pass2+pass3, pass1, pass2, pass3);
} }
host_framecount++;
fps_count++;
IN_Commands (); IN_Commands ();
@ -3716,6 +3714,8 @@ double Host_Frame (double time)
TP_UpdateAutoStatus(); TP_UpdateAutoStatus();
fps_count++;
host_framecount++;
return 0; return 0;
} }

View file

@ -123,8 +123,8 @@ void R_ParticleSystem_Callback(struct cvar_s *var, char *oldvalue)
cvar_t r_rockettrail = CVARFC("r_rockettrail", "1", CVAR_SEMICHEAT, R_Rockettrail_Callback); cvar_t r_rockettrail = CVARFC("r_rockettrail", "1", CVAR_SEMICHEAT, R_Rockettrail_Callback);
cvar_t r_grenadetrail = CVARFC("r_grenadetrail", "1", CVAR_SEMICHEAT, R_Grenadetrail_Callback); cvar_t r_grenadetrail = CVARFC("r_grenadetrail", "1", CVAR_SEMICHEAT, R_Grenadetrail_Callback);
cvar_t r_particlesystem = CVARFC("r_particlesystem", IFMINIMAL("classic", "script"), CVAR_SEMICHEAT, R_ParticleSystem_Callback); cvar_t r_particlesystem = CVARFC("r_particlesystem", IFMINIMAL("classic", "script"), CVAR_SEMICHEAT|CVAR_ARCHIVE, R_ParticleSystem_Callback);
cvar_t r_particledesc = CVARAF("r_particledesc", "classic", "r_particlesdesc", CVAR_SEMICHEAT); cvar_t r_particledesc = CVARAF("r_particledesc", "classic", "r_particlesdesc", CVAR_SEMICHEAT|CVAR_ARCHIVE);
extern cvar_t r_bouncysparks; extern cvar_t r_bouncysparks;
extern cvar_t r_part_rain; extern cvar_t r_part_rain;
extern cvar_t r_bloodstains; extern cvar_t r_bloodstains;
@ -137,7 +137,7 @@ cvar_t r_part_sparks_trifan = CVAR("r_part_sparks_trifan", "1");
cvar_t r_part_sparks_textured = CVAR("r_part_sparks_textured", "1"); cvar_t r_part_sparks_textured = CVAR("r_part_sparks_textured", "1");
cvar_t r_part_beams = CVAR("r_part_beams", "1"); cvar_t r_part_beams = CVAR("r_part_beams", "1");
cvar_t r_part_contentswitch = CVARFD("r_part_contentswitch", "1", CVAR_ARCHIVE, "Enable particle effects to change based on content (ex. water)."); cvar_t r_part_contentswitch = CVARFD("r_part_contentswitch", "1", CVAR_ARCHIVE, "Enable particle effects to change based on content (ex. water).");
cvar_t r_part_density = CVAR("r_part_density", "1"); cvar_t r_part_density = CVARF("r_part_density", "1", CVAR_ARCHIVE);
particleengine_t *pe; particleengine_t *pe;

View file

@ -108,7 +108,7 @@ cvar_t r_lightmap_saturation = SCVAR ("r_lightmap_saturation", "1");
cvar_t r_lightstylesmooth = CVARF ("r_lightstylesmooth", "0", CVAR_ARCHIVE); cvar_t r_lightstylesmooth = CVARF ("r_lightstylesmooth", "0", CVAR_ARCHIVE);
cvar_t r_lightstylesmooth_limit = SCVAR ("r_lightstylesmooth_limit", "2"); cvar_t r_lightstylesmooth_limit = SCVAR ("r_lightstylesmooth_limit", "2");
cvar_t r_lightstylespeed = SCVAR ("r_lightstylespeed", "10"); cvar_t r_lightstylespeed = SCVAR ("r_lightstylespeed", "10");
cvar_t r_loadlits = SCVAR ("r_loadlit", "1"); cvar_t r_loadlits = CVARF ("r_loadlit", "1", CVAR_ARCHIVE);
cvar_t r_menutint = SCVARF ("r_menutint", "0.68 0.4 0.13", cvar_t r_menutint = SCVARF ("r_menutint", "0.68 0.4 0.13",
CVAR_RENDERERCALLBACK); CVAR_RENDERERCALLBACK);
cvar_t r_netgraph = SCVAR ("r_netgraph", "0"); cvar_t r_netgraph = SCVAR ("r_netgraph", "0");

View file

@ -228,7 +228,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
#ifdef LIBQTV #ifdef LIBQTV
//#define Sys_Printf QTVSys_Printf #define Sys_Printf QTVSys_Printf
#endif #endif
#define VERSION "0.01" //this will be added to the serverinfo #define VERSION "0.01" //this will be added to the serverinfo