41#define CVAR_USERINFO 2
42#define CVAR_SERVERINFO 4
45#define CVAR_DEVELOPER 32
47#define CVAR_R_IMAGES 128
48#define CVAR_R_CONTEXT 256
49#define CVAR_R_PROGRAMS 512
51#define CVAR_R_MASK (CVAR_R_IMAGES | CVAR_R_CONTEXT | CVAR_R_PROGRAMS)
61typedef struct cvarChangeListener_s {
63 struct cvarChangeListener_s*
next;
71typedef struct cvar_s {
82 bool (*
check) (
struct cvar_s* cvar);
89typedef struct cvarList_s {
101 virtual void onCreate (
const struct cvar_s* cvar) = 0;
102 virtual void onDelete (
const struct cvar_s* cvar) = 0;
117cvar_t*
Cvar_Get(
const char* varName,
const char* value =
"",
int flags = 0,
const char* desc =
nullptr);
259void Cvar_PrintDebugCvars(
void);
Listener for cvar changes.
virtual void onDelete(const struct cvar_s *cvar)=0
virtual void onCreate(const struct cvar_s *cvar)=0
cvar_t * Cvar_ForceSet(const char *varName, const char *value)
Will set the variable even if NOSET or LATCH.
bool Cvar_PendingCvars(int flags)
Checks whether there are pending cvars for the given flags.
cvarChangeListener_t * Cvar_RegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Registers a listener that is executed each time a cvar changed its value.
const char * Cvar_Userinfo(char *info, size_t infoSize)
Returns an info string containing all the CVAR_USERINFO cvars.
void Com_SetRenderModified(bool modified)
void Cvar_SetValue(const char *varName, float value)
Expands value to a string and calls Cvar_Set.
const char * Cvar_VariableStringOld(const char *varName)
Returns the old value of cvar as string before we changed it.
void Cvar_UnRegisterChangeListener(const char *varName, cvarChangeListenerFunc_t listenerFunc)
Unregisters a cvar change listener.
bool Cvar_SetCheckFunction(const char *varName, bool(*check)(cvar_t *cvar))
Set a checker function for cvar values.
bool Cvar_Delete(const char *varName)
Function to remove the cvar and free the space.
int Cvar_GetInteger(const char *varName)
Returns the int value of a cvar.
bool Com_IsRenderModified(void)
void Cvar_RegisterCvarListener(CvarListenerPtr listener)
Registers a cvar listener.
bool Cvar_AssertValue(cvar_t *cvar, float minVal, float maxVal, bool shouldBeIntegral)
Checks cvar values.
void Cvar_UnRegisterCvarListener(CvarListenerPtr listener)
Unregisters a cvar listener.
void Cvar_Reset(cvar_t *cvar)
Sets the cvar value back to the old value.
cvar_t * Cvar_FullSet(const char *varName, const char *value, int flags)
Sets a cvar from console with the given flags.
float Cvar_GetValue(const char *varName)
Returns the float value of a cvar.
cvar_t * Cvar_FindVar(const char *varName)
Searches for a cvar given by parameter.
bool Cvar_Command(void)
Handles variable inspection and changing from the console.
void Cvar_ClearVars(int flags)
bool Com_IsUserinfoModified(void)
void Cvar_Init(void)
Reads in all archived cvars.
const char * Cvar_GetString(const char *varName)
Returns the value of cvar as string.
void Cvar_UpdateLatchedVars(void)
Any variables with latched values will now be updated.
void Cvar_FixCheatVars(void)
Reset cheat cvar values to default.
void Com_SetUserinfoModified(bool modified)
int Cvar_CompleteVariable(const char *partial, const char **match)
Unix like tab completion for console variables.
const char * Cvar_Serverinfo(char *info, size_t infoSize)
Returns an info string containing all the CVAR_SERVERINFO cvars.
cvar_t * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
will create the variable if it doesn't exist
SharedPtr< CvarListener > CvarListenerPtr
void(* cvarChangeListenerFunc_t)(const char *cvarName, const char *oldValue, const char *newValue, void *data)
Callback for the change listener.
cvar_t * Cvar_GetFirst(void)
Return the first cvar of the cvar list.
cvar_t * Cvar_Get(const char *varName, const char *value="", int flags=0, const char *desc=nullptr)
creates the variable if it doesn't exist, or returns the existing one if it exists,...
void format(__printf__, 1, 2)))
QGL_EXTERN void(APIENTRY *qglActiveTexture)(GLenum texture)
QGL_EXTERN GLsizei const GLvoid * data
Header for lua script functions.
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
struct cvar_s * hash_next
bool(* check)(struct cvar_s *cvar)
cvarChangeListener_t * changeListener
struct cvarChangeListener_s * next
cvarChangeListenerFunc_t exec