moved cfg_unbindall and its registration to cl_main.c. moved the

config.cfg write of unbindall to Key_WriteBindings().

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@768 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2012-10-12 07:33:11 +00:00
parent a3d9fb95d2
commit baf09f0807
4 changed files with 11 additions and 8 deletions

View file

@ -33,6 +33,8 @@ cvar_t cl_color = {"_cl_color", "0", CVAR_ARCHIVE};
cvar_t cl_shownet = {"cl_shownet","0",CVAR_NONE}; // can be 0, 1, or 2
cvar_t cl_nolerp = {"cl_nolerp","0",CVAR_NONE};
cvar_t cfg_unbindall = {"cfg_unbindall", "1", CVAR_ARCHIVE};
cvar_t lookspring = {"lookspring","0", CVAR_ARCHIVE};
cvar_t lookstrafe = {"lookstrafe","0", CVAR_ARCHIVE};
cvar_t sensitivity = {"sensitivity","3", CVAR_ARCHIVE};
@ -797,6 +799,8 @@ void CL_Init (void)
Cvar_RegisterVariable (&m_forward);
Cvar_RegisterVariable (&m_side);
Cvar_RegisterVariable (&cfg_unbindall);
Cvar_RegisterVariable (&cl_maxpitch); //johnfitz -- variable pitch clamping
Cvar_RegisterVariable (&cl_minpitch); //johnfitz -- variable pitch clamping

View file

@ -245,6 +245,8 @@ extern cvar_t cl_autofire;
extern cvar_t cl_shownet;
extern cvar_t cl_nolerp;
extern cvar_t cfg_unbindall;
extern cvar_t cl_pitchdriftspeed;
extern cvar_t lookspring;
extern cvar_t lookstrafe;

View file

@ -81,8 +81,6 @@ cvar_t developer = {"developer","0",CVAR_NONE};
cvar_t temp1 = {"temp1","0",CVAR_NONE};
cvar_t cfg_unbindall = {"cfg_unbindall", "1", CVAR_ARCHIVE}; //QuakeSpasm
cvar_t devstats = {"devstats","0",CVAR_NONE}; //johnfitz -- track developer statistics that vary every frame
devstats_t dev_stats, dev_peakstats;
@ -276,8 +274,6 @@ void Host_InitLocal (void)
Cvar_RegisterVariable (&temp1);
Cvar_RegisterVariable (&cfg_unbindall); //QuakeSpasm
Host_FindMaxClients ();
host_time = 1.0; // so a think at time 0 won't get called
@ -308,8 +304,6 @@ void Host_WriteConfiguration (void)
VID_SyncCvars (); //johnfitz -- write actual current mode to config file, in case cvars were messed with
if (cfg_unbindall.value) fprintf (f, "unbindall\n"); //QuakeSpasm -- unbindall before loading stored bindings
Key_WriteBindings (f);
Cvar_WriteVariables (f);

View file

@ -712,6 +712,9 @@ void Key_WriteBindings (FILE *f)
{
int i;
// unbindall before loading stored bindings:
if (cfg_unbindall.value)
fprintf (f, "unbindall\n");
for (i = 0; i < 256; i++)
{
if (keybindings[i] && *keybindings[i])
@ -796,8 +799,7 @@ void Key_Init (void)
{
int i;
History_Init ();
#if 0 /* This section of code is now done in History_Init */
#if 0 /* moved to History_Init() */
for (i = 0; i < 32; i++)
{
key_lines[i][0] = ']';
@ -805,6 +807,7 @@ void Key_Init (void)
}
key_linepos = 1;
#endif
History_Init ();
key_blinktime = realtime; //johnfitz