Clean up some unused or local functions.
This commit is contained in:
parent
ae81b79390
commit
6e1f043719
|
@ -80,7 +80,6 @@ struct cbuf_interpreter_s *Cmd_GetProvider(const char *name);
|
||||||
|
|
||||||
extern struct cbuf_args_s *cmd_args;
|
extern struct cbuf_args_s *cmd_args;
|
||||||
extern struct cvar_s *cmd_warncmd;
|
extern struct cvar_s *cmd_warncmd;
|
||||||
extern cmd_function_t *cmd_functions; // possible commands to execute
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
|
@ -102,25 +102,15 @@ cvar_t *Cvar_RemoveAlias (const char *name);
|
||||||
void Cvar_Set (cvar_t *var, const char *value);
|
void Cvar_Set (cvar_t *var, const char *value);
|
||||||
void Cvar_SetValue (cvar_t *var, float value);
|
void Cvar_SetValue (cvar_t *var, float value);
|
||||||
|
|
||||||
// sets a CVAR_ROM variable from within the engine
|
|
||||||
void Cvar_SetROM (cvar_t *var, const char *value);
|
|
||||||
|
|
||||||
// allows you to change a Cvar's flags without a full Cvar_Get
|
// allows you to change a Cvar's flags without a full Cvar_Get
|
||||||
void Cvar_SetFlags (cvar_t *var, int cvarflags);
|
void Cvar_SetFlags (cvar_t *var, int cvarflags);
|
||||||
|
|
||||||
// reset a Cvar to its default setting
|
|
||||||
void Cvar_Reset (cvar_t *var);
|
|
||||||
|
|
||||||
// returns 0 if not defined or non numeric
|
// returns 0 if not defined or non numeric
|
||||||
float Cvar_VariableValue (const char *var_name);
|
float Cvar_VariableValue (const char *var_name);
|
||||||
|
|
||||||
// returns an empty string if not defined
|
// returns an empty string if not defined
|
||||||
const char *Cvar_VariableString (const char *var_name);
|
const char *Cvar_VariableString (const char *var_name);
|
||||||
|
|
||||||
// attempts to match a partial variable name for command line completion
|
|
||||||
// returns NULL if nothing fits
|
|
||||||
const char *Cvar_CompleteVariable (const char *partial);
|
|
||||||
|
|
||||||
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
|
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
|
||||||
// command. Returns true if the command was a variable reference that
|
// command. Returns true if the command was a variable reference that
|
||||||
// was handled. (print or change)
|
// was handled. (print or change)
|
||||||
|
@ -130,6 +120,10 @@ qboolean Cvar_Command (void);
|
||||||
// with the archive flag set to true.
|
// with the archive flag set to true.
|
||||||
void Cvar_WriteVariables (QFile *f);
|
void Cvar_WriteVariables (QFile *f);
|
||||||
|
|
||||||
|
// attempts to match a partial variable name for command line completion
|
||||||
|
// returns NULL if nothing fits
|
||||||
|
const char *Cvar_CompleteVariable (const char *partial);
|
||||||
|
|
||||||
// Added by EvilTypeGuy - functions for tab completion system
|
// Added by EvilTypeGuy - functions for tab completion system
|
||||||
// Thanks to Fett erich@heintz.com
|
// Thanks to Fett erich@heintz.com
|
||||||
// Thanks to taniwha
|
// Thanks to taniwha
|
||||||
|
@ -142,8 +136,6 @@ cvar_t *Cvar_FindVar (const char *var_name);
|
||||||
void Cvar_Init_Hash (void);
|
void Cvar_Init_Hash (void);
|
||||||
void Cvar_Init (void);
|
void Cvar_Init (void);
|
||||||
|
|
||||||
void Cvar_Shutdown (void);
|
|
||||||
|
|
||||||
extern cvar_t *cvar_vars;
|
extern cvar_t *cvar_vars;
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
|
@ -78,7 +78,7 @@ VISIBLE cmd_source_t cmd_source;
|
||||||
|
|
||||||
/* Command parsing functions */
|
/* Command parsing functions */
|
||||||
|
|
||||||
VISIBLE cmd_function_t *cmd_functions; // possible commands to execute
|
static cmd_function_t *cmd_functions; // possible commands to execute
|
||||||
|
|
||||||
VISIBLE int
|
VISIBLE int
|
||||||
Cmd_Argc (void)
|
Cmd_Argc (void)
|
||||||
|
|
|
@ -278,31 +278,6 @@ Cvar_Set (cvar_t *var, const char *value)
|
||||||
var->callback (var);
|
var->callback (var);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Cvar_SetROM
|
|
||||||
|
|
||||||
doesn't check for CVAR_ROM flag
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
Cvar_SetROM (cvar_t *var, const char *value)
|
|
||||||
{
|
|
||||||
int changed;
|
|
||||||
|
|
||||||
if (!var)
|
|
||||||
return;
|
|
||||||
|
|
||||||
changed = !strequal (var->string, value);
|
|
||||||
free ((char*)var->string); // free the old value string
|
|
||||||
|
|
||||||
var->string = strdup (value);
|
|
||||||
var->value = atof (var->string);
|
|
||||||
var->int_val = atoi (var->string);
|
|
||||||
sscanf (var->string, "%f %f %f", &var->vec[0], &var->vec[1], &var->vec[2]);
|
|
||||||
|
|
||||||
if (changed && var->callback)
|
|
||||||
var->callback (var);
|
|
||||||
}
|
|
||||||
|
|
||||||
VISIBLE void
|
VISIBLE void
|
||||||
Cvar_SetValue (cvar_t *var, float value)
|
Cvar_SetValue (cvar_t *var, float value)
|
||||||
{
|
{
|
||||||
|
@ -500,6 +475,12 @@ Cvar_Cycle_f (void)
|
||||||
Cvar_Set (var, Cmd_Argv (i + 1)); // matched earlier in list
|
Cvar_Set (var, Cmd_Argv (i + 1)); // matched earlier in list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
Cvar_Reset (cvar_t *var)
|
||||||
|
{
|
||||||
|
Cvar_Set (var, var->default_string);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Cvar_Reset_f (void)
|
Cvar_Reset_f (void)
|
||||||
{
|
{
|
||||||
|
@ -524,7 +505,8 @@ Cvar_Reset_f (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Cvar_ResetAll_f (void)
|
static void
|
||||||
|
Cvar_ResetAll_f (void)
|
||||||
{
|
{
|
||||||
cvar_t *var;
|
cvar_t *var;
|
||||||
|
|
||||||
|
@ -625,31 +607,6 @@ Cvar_Init (void)
|
||||||
Cmd_AddCommand ("resetall", Cvar_ResetAll_f, "Reset all cvars");
|
Cmd_AddCommand ("resetall", Cvar_ResetAll_f, "Reset all cvars");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Cvar_Shutdown (void)
|
|
||||||
{
|
|
||||||
cvar_t *var, *next;
|
|
||||||
cvar_alias_t *alias, *nextalias;
|
|
||||||
|
|
||||||
// Free cvars
|
|
||||||
var = cvar_vars;
|
|
||||||
while (var) {
|
|
||||||
next = var->next;
|
|
||||||
free ((char*)var->string);
|
|
||||||
free ((char*)var->name);
|
|
||||||
free (var);
|
|
||||||
var = next;
|
|
||||||
}
|
|
||||||
// Free aliases
|
|
||||||
alias = calias_vars;
|
|
||||||
while (alias) {
|
|
||||||
nextalias = alias->next;
|
|
||||||
free ((char*)alias->name);
|
|
||||||
free (alias);
|
|
||||||
alias = nextalias;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VISIBLE cvar_t *
|
VISIBLE cvar_t *
|
||||||
Cvar_Get (const char *name, const char *string, int cvarflags,
|
Cvar_Get (const char *name, const char *string, int cvarflags,
|
||||||
void (*callback)(cvar_t*), const char *description)
|
void (*callback)(cvar_t*), const char *description)
|
||||||
|
@ -716,9 +673,3 @@ Cvar_SetFlags (cvar_t *var, int cvarflags)
|
||||||
|
|
||||||
var->flags = cvarflags;
|
var->flags = cvarflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
VISIBLE void
|
|
||||||
Cvar_Reset (cvar_t *var)
|
|
||||||
{
|
|
||||||
Cvar_Set (var, var->default_string);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue