1
0
Fork 0
forked from fte/fteqw

disable vfs_flush when recording demos, there's some significant slowdown, and I don't see what else it could be (doesn't affect me).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4935 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2015-07-07 02:44:27 +00:00
parent 67786a2601
commit 198410cfe7
2 changed files with 11 additions and 4 deletions

View file

@ -34,6 +34,7 @@ static qboolean lastdemowassystempath;
extern cvar_t qtvcl_forceversion1;
extern cvar_t qtvcl_eztvextensions;
extern cvar_t record_flush;
static unsigned char demobuffer[1024*66]; //input buffer
static int demooffset; //start offset of demo buffer
@ -133,7 +134,8 @@ void CL_WriteDemoCmd (usercmd_t *pcmd)
VFS_WRITE (cls.demooutfile, &fl, 4);
}
VFS_FLUSH (cls.demooutfile);
if (record_flush.ival)
VFS_FLUSH (cls.demooutfile);
}
/*
@ -196,7 +198,8 @@ void CL_WriteDemoMessage (sizebuf_t *msg, int payloadoffset)
VFS_WRITE(cls.demooutfile, net_message.data + payloadoffset, net_message.cursize - payloadoffset);
break;
}
VFS_FLUSH (cls.demooutfile);
if (record_flush.ival)
VFS_FLUSH (cls.demooutfile);
}
int demo_preparsedemo(unsigned char *buffer, int bytes)
@ -948,7 +951,8 @@ void CL_WriteRecordDemoMessage (sizebuf_t *msg, int seq)
VFS_WRITE (cls.demooutfile, msg->data, msg->cursize);
VFS_FLUSH (cls.demooutfile);
if (record_flush.ival)
VFS_FLUSH (cls.demooutfile);
}
@ -974,7 +978,8 @@ void CL_WriteSetDemoMessage (void)
len = LittleLong(cls.netchan.incoming_sequence);
VFS_WRITE (cls.demooutfile, &len, 4);
VFS_FLUSH (cls.demooutfile);
if (record_flush.ival)
VFS_FLUSH (cls.demooutfile);
}

View file

@ -89,6 +89,7 @@ cvar_t cl_serveraddress = CVARD("cl_serveraddress", "none", "The address of the
cvar_t qtvcl_forceversion1 = CVAR("qtvcl_forceversion1", "0");
cvar_t qtvcl_eztvextensions = CVAR("qtvcl_eztvextensions", "0");
cvar_t record_flush = CVARD("record_flush", "0", "If set, explicitly flushes demo data to disk while recording. This may be inefficient, depending on how your operating system is configured.");
cvar_t cl_demospeed = CVARF("cl_demospeed", "1", 0);
cvar_t cl_demoreel = CVARFD("cl_demoreel", "0", CVAR_SAVE, "When enabled, the engine will begin playing a demo loop on startup.");
@ -3760,6 +3761,7 @@ void CL_Init (void)
Cvar_Register (&w_switch, cl_controlgroup);
Cvar_Register (&cl_demoreel, cl_controlgroup);
Cvar_Register (&record_flush, cl_controlgroup);
Cvar_Register (&cl_nofake, cl_controlgroup);
Cvar_Register (&cl_chatsound, cl_controlgroup);