From: divverent Date: Tue, 4 May 2010 11:08:40 +0000 (+0000) Subject: demo deleting: switch the meaning of the values 2 and 3 in cl_autodemo_delete, so... X-Git-Tag: xonotic-v0.1.0preview~230^2~306 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=16719bad0f7f92ae5a6def481c99f9be969820ca;p=xonotic%2Fdarkplaces.git demo deleting: switch the meaning of the values 2 and 3 in cl_autodemo_delete, so & 1 would check if the CURRENT demo is to be deleted, and & 2 would check if any future demos are to be deleted git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10171 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_demo.c b/cl_demo.c index 7b678b7f..4da12fb5 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -306,7 +306,7 @@ void CL_Stop_f (void) CL_WriteDemoMessage(&buf); // finish up - if (cl_autodemo.integer && ((cl_autodemo_delete.integer & 1) ^ ((cl_autodemo_delete.integer >> 1) & 1))) // bit 0 XOR bit 1 + if(cl_autodemo.integer && (cl_autodemo_delete.integer & 1)) { FS_RemoveOnClose(cls.demofile); Con_Print("Completed and deleted demo\n"); diff --git a/cl_main.c b/cl_main.c index a254ca58..357250ec 100644 --- a/cl_main.c +++ b/cl_main.c @@ -57,7 +57,7 @@ cvar_t freelook = {CVAR_SAVE, "freelook", "1","mouse controls pitch instead of f cvar_t cl_autodemo = {CVAR_SAVE, "cl_autodemo", "0", "records every game played, using the date/time and map name to name the demo file" }; cvar_t cl_autodemo_nameformat = {CVAR_SAVE, "cl_autodemo_nameformat", "autodemos/%Y-%m-%d_%H-%M", "The format of the cl_autodemo filename, followed by the map name (the date is encoded using strftime escapes)" }; -cvar_t cl_autodemo_delete = {0, "cl_autodemo_delete", "0", "Delete demos after recording. This is a bitmask, bit 1 gives the default, bit 0 inverts the meaning of bit 1 for the current demo. Thus, the values are: 0 = disabled; 1 = delete current demo only; 2 = delete all demos from this point on; 3 = delete all demos except the current demo" }; +cvar_t cl_autodemo_delete = {0, "cl_autodemo_delete", "0", "Delete demos after recording. This is a bitmask, bit 1 gives the default, bit 0 the value for the current demo. Thus, the values are: 0 = disabled; 1 = delete current demo only; 2 = delete all demos except the current demo; 3 = delete all demos from now on" }; cvar_t r_draweffects = {0, "r_draweffects", "1","renders temporary sprite effects"}; diff --git a/cl_parse.c b/cl_parse.c index 2adedb05..63d49ab3 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1828,8 +1828,12 @@ void CL_ParseServerInfo (void) Con_Printf ("Auto-recording to %s.\n", demofile); - // Clear the invert flag for every new demo - Cvar_SetValueQuick(&cl_autodemo_delete, cl_autodemo_delete.integer & ~0x1); + // Reset bit 0 for every new demo + Cvar_SetValueQuick(&cl_autodemo_delete, + (cl_autodemo_delete.integer & ~0x1) + | + ((cl_autodemo_delete.integer & 0x2) ? 0x1 : 0) + ); cls.demofile = FS_OpenRealFile(demofile, "wb", false); if (cls.demofile)