UFO: Alien Invasion
|
Manage cvars. More...
Go to the source code of this file.
Macros | |
#define | CVAR_HASH_SIZE 64 |
Typedefs | |
typedef std::vector < CvarListenerPtr > | CvarListeners |
Functions | |
void | Com_SetUserinfoModified (bool modified) |
bool | Com_IsUserinfoModified (void) |
void | Com_SetRenderModified (bool modified) |
bool | Com_IsRenderModified (void) |
cvar_t * | Cvar_GetFirst (void) |
Return the first cvar of the cvar list. More... | |
static bool | Cvar_InfoValidate (const char *s) |
Check that the Cvar identifier name doesn't contain a backslash, a double quote or a semi-colon. More... | |
cvar_t * | Cvar_FindVar (const char *varName) |
Searches for a cvar given by parameter. More... | |
float | Cvar_GetValue (const char *varName) |
Returns the float value of a cvar. More... | |
bool | Cvar_SetCheckFunction (const char *varName, bool(*check)(cvar_t *cvar)) |
Set a checker function for cvar values. More... | |
bool | Cvar_AssertValue (cvar_t *cvar, float minVal, float maxVal, bool shouldBeIntegral) |
Checks cvar values. More... | |
int | Cvar_GetInteger (const char *varName) |
Returns the int value of a cvar. More... | |
const char * | Cvar_GetString (const char *varName) |
Returns the value of cvar as string. More... | |
const char * | Cvar_VariableStringOld (const char *varName) |
Returns the old value of cvar as string before we changed it. More... | |
void | Cvar_Reset (cvar_t *cvar) |
Sets the cvar value back to the old value. More... | |
int | Cvar_CompleteVariable (const char *partial, const char **match) |
Unix like tab completion for console variables. More... | |
bool | Cvar_Delete (const char *varName) |
Function to remove the cvar and free the space. More... | |
cvar_t * | Cvar_Get (const char *var_name, const char *var_value, int flags, const char *desc) |
Init or return a cvar. More... | |
void | Cvar_RegisterCvarListener (CvarListenerPtr listener) |
Registers a cvar listener. More... | |
void | Cvar_UnRegisterCvarListener (CvarListenerPtr listener) |
Unregisters a cvar listener. More... | |
static void | Cvar_ExecuteChangeListener (const cvar_t *cvar) |
Executes the change listeners for a cvar. More... | |
static cvarChangeListener_t * | Cvar_GetChangeListener (cvarChangeListenerFunc_t listenerFunc) |
cvarChangeListener_t * | Cvar_RegisterChangeListener (const char *varName, cvarChangeListenerFunc_t listenerFunc) |
Registers a listener that is executed each time a cvar changed its value. More... | |
void | Cvar_UnRegisterChangeListener (const char *varName, cvarChangeListenerFunc_t listenerFunc) |
Unregisters a cvar change listener. More... | |
static cvar_t * | Cvar_Set2 (const char *varName, const char *value, bool force) |
Sets a cvar values Handles write protection and latched cvars as expected. More... | |
cvar_t * | Cvar_ForceSet (const char *varName, const char *value) |
Will set the variable even if NOSET or LATCH. More... | |
cvar_t * | Cvar_Set (const char *varName, const char *value,...) |
Sets a cvar value. More... | |
cvar_t * | Cvar_FullSet (const char *varName, const char *value, int flags) |
Sets a cvar from console with the given flags. More... | |
void | Cvar_SetValue (const char *varName, float value) |
Expands value to a string and calls Cvar_Set. More... | |
void | Cvar_UpdateLatchedVars (void) |
Any variables with latched values will now be updated. More... | |
bool | Cvar_Command (void) |
Handles variable inspection and changing from the console. More... | |
static void | Cvar_SetOld_f (void) |
Allows resetting cvars to old value from console. More... | |
static void | Cvar_Define_f (void) |
static void | Cvar_Set_f (void) |
Allows setting and defining of arbitrary cvars from console. More... | |
static void | Cvar_Switch_f (void) |
Allows switching boolean cvars between zero and not-zero from console. More... | |
static void | Cvar_Copy_f (void) |
Allows copying variables Available via console command copy. More... | |
void | Cvar_WriteVariables (qFILE *f) |
appends lines containing "set variable value" for all variables with the archive flag set to true. More... | |
bool | Cvar_PendingCvars (int flags) |
Checks whether there are pending cvars for the given flags. More... | |
void | Cvar_ClearVars (int flags) |
static void | Cvar_List_f (void) |
List all cvars via console command 'cvarlist'. More... | |
static char * | Cvar_BitInfo (int bit, char *info, size_t infoSize) |
Return a string with all cvars with bitflag given by parameter set. More... | |
const char * | Cvar_Userinfo (char *info, size_t infoSize) |
Returns an info string containing all the CVAR_USERINFO cvars. More... | |
const char * | Cvar_Serverinfo (char *info, size_t infoSize) |
Returns an info string containing all the CVAR_SERVERINFO cvars. More... | |
static void | Cvar_Del_f (void) |
Delete a cvar - set [cvar] "" isn't working from within the scripts. More... | |
static void | Cvar_Add_f (void) |
Add a value to a cvar. More... | |
static void | Cvar_Mod_f (void) |
Apply a modulo to a cvar. More... | |
void | Cvar_FixCheatVars (void) |
Reset cheat cvar values to default. More... | |
void | Cvar_Init (void) |
Reads in all archived cvars. More... | |
void | Cvar_Shutdown (void) |
Variables | |
static cvar_t * | cvarVarsHash [CVAR_HASH_SIZE] |
static CvarListeners | cvarListeners |
static bool | renderModified |
This is set each time a CVAR_USERINFO variable is changed so that the renderer knows to update stuff accordingly. More... | |
static bool | userinfoModified |
This is set each time a CVAR_USERINFO variable is changed so that the client knows to send it to the server. More... | |
static cvar_t * | cvarVars |
Cvar list. More... | |
Manage cvars.
cvar_t variables are used to hold scalar or string variables that can be changed or displayed at the console or prog code as well as accessed directly in C code. Cvars are restricted from having the same names as commands to keep this interface from being ambiguous.
Definition in file cvar.cpp.
#define CVAR_HASH_SIZE 64 |
Definition at line 35 of file cvar.cpp.
Referenced by Cvar_Delete(), Cvar_FindVar(), and Cvar_Get().
typedef std::vector<CvarListenerPtr> CvarListeners |
bool Com_IsRenderModified | ( | void | ) |
bool Com_IsUserinfoModified | ( | void | ) |
Definition at line 61 of file cvar.cpp.
References userinfoModified.
Referenced by CL_SendChangedUserinfos().
void Com_SetRenderModified | ( | bool | modified | ) |
Definition at line 66 of file cvar.cpp.
References renderModified.
Referenced by Cvar_Set2(), Qcommon_Init(), and R_BeginFrame().
void Com_SetUserinfoModified | ( | bool | modified | ) |
Definition at line 56 of file cvar.cpp.
References userinfoModified.
Referenced by CL_Connect(), CL_SendChangedUserinfos(), Cvar_FullSet(), Cvar_Set2(), and Qcommon_Init().
Add a value to a cvar.
Definition at line 1001 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_SetValue(), and cvar_s::value.
Referenced by Cvar_Init().
bool Cvar_AssertValue | ( | cvar_t * | cvar, |
float | minVal, | ||
float | maxVal, | ||
bool | shouldBeIntegral | ||
) |
Checks cvar values.
this function checks cvar ranges and integral values
true
if assert isn't true and the cvar was changed to a valid value, false
if the new value is ok and nothing was changed. [in] | cvar | Cvar to check |
[in] | minVal | The minimal value the cvar should have |
[in] | maxVal | The maximal value the cvar should have |
[in] | shouldBeIntegral | No floats for this cvar please |
Definition at line 161 of file cvar.cpp.
References Com_Printf(), Cvar_Set(), Cvar_SetValue(), cvar_s::integer, cvar_s::name, and cvar_s::value.
Referenced by CL_CvarCheckVidGamma(), CL_CvarCheckVidMode(), CL_CvarWorldLevel(), Com_CvarCheckMaxFPS(), R_CvarCheckDynamicLights(), R_CvarCheckMaxLightmap(), R_CvarCheckMultisample(), R_CvarCheckWeather(), R_CvarPostProcess(), R_CvarPrograms(), and SV_CheckMaxSoldiersPerPlayer().
|
static |
Return a string with all cvars with bitflag given by parameter set.
bit | The bitflag we search the global cvar array for |
info | The resulting string |
infoSize | The max length of the result (MAX_INFO_STRING is a good idea here) |
Definition at line 955 of file cvar.cpp.
References Info_SetValueForKey(), and cvar_s::next.
Referenced by Cvar_Serverinfo(), and Cvar_Userinfo().
Definition at line 891 of file cvar.cpp.
References cvar_s::next.
Referenced by R_BeginFrame(), and R_Init().
bool Cvar_Command | ( | void | ) |
Handles variable inspection and changing from the console.
called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known command. Returns true if the command was a variable reference that was handled. (print or change)
You can print the current value or set a new value with this function To set a new value for a cvar from within the console just type the cvar name followed by the value. To print the current cvar's value just type the cvar name and hit enter
Definition at line 708 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_Set(), cvar_s::name, cvar_s::string, and v.
Referenced by Cmd_vExecuteString().
int Cvar_CompleteVariable | ( | const char * | partial, |
const char ** | match | ||
) |
Unix like tab completion for console variables.
attempts to match a partial variable name for command line completion returns nullptr if nothing fits
partial | The beginning of the variable we try to complete | |
[out] | match | The found entry of the list we are searching, in case of more than one entry their common suffix is returned. |
Definition at line 258 of file cvar.cpp.
References Cmd_GenericCompleteFunction(), Com_Printf(), CVAR_DEVELOPER, cvar_s::next, and S_COLOR_GREEN.
Referenced by Com_ConsoleCompleteCommand().
Allows copying variables Available via console command copy.
Definition at line 851 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_GetString(), and Cvar_Set().
Referenced by Cvar_Init().
Definition at line 745 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_Set(), and name.
Referenced by Cvar_Init().
Delete a cvar - set [cvar] "" isn't working from within the scripts.
Definition at line 987 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), and Cvar_Delete().
Referenced by Cvar_Init().
bool Cvar_Delete | ( | const char * | varName | ) |
Function to remove the cvar and free the space.
Definition at line 279 of file cvar.cpp.
References cvar_s::changeListener, Com_HashKey(), Com_Printf(), CVAR_HASH_SIZE, cvarListeners, cvar_s::defaultString, cvar_s::description, cvar_s::flags, hash, HASH_Delete, cvar_s::hash_next, i, cvar_s::latchedString, Mem_Free, cvar_s::name, cvarChangeListener_s::next, cvar_s::next, cvar_s::oldString, cvar_s::prev, Q_strcasecmp, and cvar_s::string.
Referenced by _wrap_delvar(), Cvar_Del_f(), GAME_GetImportData(), GAMECvarListener::onGameModeChange(), and UI_ExecuteAction().
Executes the change listeners for a cvar.
cvar | The cvar which change listeners are executed |
Definition at line 424 of file cvar.cpp.
References cvar_s::changeListener, cvarChangeListener_s::data, cvarChangeListener_s::exec, cvar_s::name, cvarChangeListener_s::next, cvar_s::oldString, and cvar_s::string.
Referenced by Cvar_Set2().
cvar_t* Cvar_FindVar | ( | const char * | varName | ) |
Searches for a cvar given by parameter.
varName | The cvar name as string |
nullptr
if no cvar with the specified name was found Definition at line 106 of file cvar.cpp.
References Com_HashKey(), CVAR_HASH_SIZE, hash, cvar_s::hash_next, and Q_streq.
Referenced by _wrap_findvar(), Cvar_Add_f(), Cvar_Command(), Cvar_Define_f(), Cvar_FullSet(), Cvar_Get(), Cvar_GetInteger(), Cvar_GetString(), Cvar_GetValue(), Cvar_Mod_f(), Cvar_RegisterChangeListener(), Cvar_Set2(), Cvar_Set_f(), Cvar_SetCheckFunction(), Cvar_SetOld_f(), Cvar_Switch_f(), Cvar_UnRegisterChangeListener(), Cvar_VariableStringOld(), INV_UpdateObject_f(), uiCvarNode::onWindowClosed(), uiTabNode::onWindowOpened(), SV_GetCvarToken(), UI_GetBooleanFromExpression(), and UI_RemoveCvarListener_f().
Reset cheat cvar values to default.
Definition at line 1042 of file cvar.cpp.
References com_cvarSysPool, Com_Printf(), Com_ServerState(), CVAR_CHEAT, Cvar_GetInteger(), Mem_Free, Mem_PoolStrDup, cvar_s::next, and Q_streq.
Referenced by CL_SendCommand().
cvar_t* Cvar_ForceSet | ( | const char * | varName, |
const char * | value | ||
) |
Will set the variable even if NOSET or LATCH.
will set the variable even if NOSET or LATCH
Definition at line 604 of file cvar.cpp.
References Cvar_Set2().
Referenced by CL_ActorSelect(), CL_CharacterSkillAndScoreCvars(), GAME_GetImportData(), INV_ItemDescription(), Irc_Client_CmdNick(), Irc_Client_CmdTopic(), Irc_Client_Join(), Irc_Client_Msg_f(), Irc_Logic_Disconnect(), uiTextEntryNode::onFocusGained(), uiTabNode::onWindowOpened(), Qcommon_Init(), SV_StartGame_f(), UI_ExecuteSetAction(), UI_TextEntryNodeAbortEdition(), and UI_TextEntryNodeEdit().
Sets a cvar from console with the given flags.
varName | Which cvar |
value | Which value for the cvar |
flags | which flags |
Definition at line 640 of file cvar.cpp.
References com_cvarSysPool, Com_SetUserinfoModified(), Cvar_FindVar(), Cvar_Get(), CVAR_USERINFO, cvar_s::flags, cvar_s::integer, Mem_Free, Mem_PoolStrDup, cvar_s::modified, cvar_s::oldString, cvar_s::string, and cvar_s::value.
Referenced by Cvar_Set_f(), Cvar_Switch_f(), GAME_SetMode(), and SV_Map().
Init or return a cvar.
creates the variable if it doesn't exist, or returns the existing one if it exists, the value will not be changed, but flags will be ORed in that allows variables to be unarchived without needing bitflags
[in] | var_name | The cvar name |
[in] | var_value | The standard cvar value (will be set if the cvar doesn't exist) |
[in] | flags | CVAR_USERINFO, CVAR_LATCH, CVAR_SERVERINFO, CVAR_ARCHIVE and so on |
[in] | desc | This is a short description of the cvar (see console command cvarlist) |
Definition at line 342 of file cvar.cpp.
References com_cvarSysPool, Com_HashKey(), Com_Printf(), CVAR_CHEAT, Cvar_FindVar(), CVAR_HASH_SIZE, Cvar_InfoValidate(), CVAR_SERVERINFO, CVAR_USERINFO, cvarListeners, cvarVars, cvar_s::defaultString, cvar_s::description, cvar_s::flags, hash, HASH_Add, i, cvar_s::integer, Mem_Free, Mem_PoolAllocType, Mem_PoolStrDup, cvar_s::modified, cvar_s::name, cvar_s::next, cvar_s::oldString, cvar_s::prev, cvar_s::string, and cvar_s::value.
Referenced by _wrap_getvar__SWIG_0(), _wrap_getvar__SWIG_1(), _wrap_getvar__SWIG_2(), _wrap_getvar__SWIG_3(), ACTOR_InitStartup(), CL_CameraInit(), CL_Init(), CL_InitLocal(), CL_LanguageInit(), CL_ViewInit(), Con_Init(), Cvar_FullSet(), Cvar_Set2(), GAME_GetImportData(), HTTP_InitStartup(), HUD_InitStartup(), IN_Init(), IN_StartupJoystick(), Irc_Init(), M_Init(), NET_Init(), uiTextEntryNode::onFocusGained(), PTL_InitStartup(), Qcommon_Init(), R_InitExtensions(), R_RegisterSystemVars(), R_RestartPrograms_f(), R_SphereInit(), S_Init(), S_MumbleInit(), SCR_Init(), FootStepTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), GameTest::SetUpTestCase(), RandomMapAssemblyTest::SetUpTestCase(), CampaignTest::SetUpTestCase(), SV_Init(), SV_InitGameProgs(), Sys_Init(), TEST_F(), TEST_Init(), TOTD_InitStartup(), UI_AbstractOption_SetCvar(), UI_GenInjectedString(), UI_GetFloatFromExpression(), UI_GetFloatFromNodeProperty(), UI_GetStringFromExpression(), UI_Init(), UI_InitDraw(), UI_InitWindows(), UI_RegisterGeoscapeNode(), VID_Init(), WEB_CGameCvars(), and WEB_InitStartup().
|
static |
Definition at line 433 of file cvar.cpp.
References com_cvarSysPool, cvarChangeListener_s::exec, and Mem_PoolAllocType.
Referenced by Cvar_RegisterChangeListener().
Return the first cvar of the cvar list.
Definition at line 81 of file cvar.cpp.
References cvarVars.
Referenced by CL_Init(), and CL_Shutdown().
int Cvar_GetInteger | ( | const char * | varName | ) |
Returns the int value of a cvar.
returns 0 if not defined or non numeric
Definition at line 194 of file cvar.cpp.
References Cvar_FindVar(), and cvar_s::integer.
Referenced by CL_BattlescapeRadarGenerate_f(), CL_ChangeSkin_f(), CL_ChangeSkinForWholeTeam_f(), CL_NextAlien_f(), CL_PrevAlien_f(), Com_DeveloperSet_f(), Cvar_FixCheatVars(), Cvar_Switch_f(), GAME_GetImportData(), GAME_GetSelectedChr(), Weather::render(), and Weather::update().
const char* Cvar_GetString | ( | const char * | varName | ) |
Returns the value of cvar as string.
returns an empty string if not defined
Even if the cvar does not exist this function will not return a null pointer but an empty string
Definition at line 210 of file cvar.cpp.
References Cvar_FindVar(), and cvar_s::string.
Referenced by CL_BattlescapeRadarGenerate_f(), CL_ConnectionlessPacket(), Cmd_AddCommand(), Cmd_TokenizeString(), Com_MacroExpandString(), Cvar_Copy_f(), FS_InitFilesystem(), GAME_GetEquipment(), GAME_GetImportData(), GAME_GetTeamDef(), Irc_Client_CmdPrivmsg(), M_Play_f(), SV_InitGameProgs(), SV_Map(), SVC_TeamInfo(), TEST_F(), and UI_MaterialEditorUpdate().
float Cvar_GetValue | ( | const char * | varName | ) |
Returns the float value of a cvar.
returns 0.0 if not defined or non numeric
Definition at line 125 of file cvar.cpp.
References Cvar_FindVar(), and cvar_s::string.
Referenced by uiGeoscapeNode::draw(), GAME_GetImportData(), IN_SetMouseSpace(), R_PreprocessShaderR(), and UI_GetReferenceFloat().
|
static |
Check that the Cvar identifier name doesn't contain a backslash, a double quote or a semi-colon.
s | The string (holding the name of the Cvar to check). |
Definition at line 94 of file cvar.cpp.
Referenced by Cvar_Get(), and Cvar_Set2().
Reads in all archived cvars.
Definition at line 1087 of file cvar.cpp.
References Cmd_AddCommand(), Cvar_Add_f(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Del_f(), Cvar_List_f(), Cvar_Mod_f(), Cvar_Set_f(), Cvar_SetOld_f(), and Cvar_Switch_f().
Referenced by Qcommon_Init(), and TEST_Init().
List all cvars via console command 'cvarlist'.
Definition at line 902 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), CVAR_ARCHIVE, CVAR_DEVELOPER, CVAR_LATCH, CVAR_NOSET, CVAR_R_IMAGES, CVAR_SERVERINFO, CVAR_USERINFO, i, cvar_s::next, and S_COLOR_GREEN.
Referenced by Cvar_Init().
Apply a modulo to a cvar.
Definition at line 1021 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_SetValue(), and cvar_s::integer.
Referenced by Cvar_Init().
bool Cvar_PendingCvars | ( | int | flags | ) |
Checks whether there are pending cvars for the given flags.
flags | The CVAR_* flags |
Definition at line 881 of file cvar.cpp.
References cvar_s::next.
Referenced by R_BeginFrame().
cvarChangeListener_t* Cvar_RegisterChangeListener | ( | const char * | varName, |
cvarChangeListenerFunc_t | listenerFunc | ||
) |
Registers a listener that is executed each time a cvar changed its value.
varName | The cvar name to register the listener for |
listenerFunc | The listener callback to register |
Definition at line 446 of file cvar.cpp.
References cvar_s::changeListener, Com_Printf(), Cvar_FindVar(), Cvar_GetChangeListener(), cvarChangeListener_s::exec, and cvarChangeListener_s::next.
Referenced by CL_Init(), HUD_InitStartup(), R_RegisterSystemVars(), UI_AddCvarListener_f(), and UI_CvarListenerNodeBind().
void Cvar_RegisterCvarListener | ( | CvarListenerPtr | listener | ) |
Registers a cvar listener.
listener | The listener callback to register |
Definition at line 406 of file cvar.cpp.
References cvarListeners.
Referenced by GAME_InitStartup().
Sets the cvar value back to the old value.
cvar | The cvar to reset |
Definition at line 241 of file cvar.cpp.
References Cvar_Set(), Mem_Free, Mem_StrDup, cvar_s::name, and cvar_s::oldString.
Referenced by HUD_CvarCheckMNHud(), and R_CvarGLSLVersionCheck().
const char* Cvar_Serverinfo | ( | char * | info, |
size_t | infoSize | ||
) |
Returns an info string containing all the CVAR_SERVERINFO cvars.
returns an info string containing all the CVAR_SERVERINFO cvars
Definition at line 977 of file cvar.cpp.
References Cvar_BitInfo(), and CVAR_SERVERINFO.
Referenced by SV_Serverinfo_f(), SV_ShowServerinfo_f(), and SVC_Status().
cvar_t* Cvar_Set | ( | const char * | varName, |
const char * | value, | ||
... | |||
) |
Sets a cvar value.
varName | Which cvar should be set |
value | Which value should the cvar get |
Definition at line 615 of file cvar.cpp.
References Cvar_Set2(), and Q_vsnprintf().
Referenced by CL_ActorCvars(), CL_CharacterSkillAndScoreCvars(), CL_ConnectionlessPacket(), CL_LanguageTryToSet(), CL_SetClientState(), CL_UGVCvars(), Com_SetGameType(), Cvar_AssertValue(), Cvar_Command(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Reset(), Cvar_Set_f(), Cvar_SetOld_f(), Cvar_SetValue(), Cvar_Switch_f(), cvar_t_set_value__SWIG_1(), GAME_EndBattlescape(), GAME_GetImportData(), GAME_StartBattlescape(), GAME_UpdateTeamMenuParameters_f(), HUD_InitUI(), HUD_Update(), HUD_UpdateActor(), HUD_UpdateActorCvar(), HUD_UpdateButtons(), IN_StartupJoystick(), INV_ItemDescription(), Irc_Connect_f(), Irc_UserClick_f(), M_Play_f(), M_PlayRandomByCategory(), M_RandomTrack_f(), uiRadioButtonNode::onActivate(), R_InitPrograms(), R_SetMode(), R_VerifyDriver(), SEQ_ExecuteMusic(), GameTest::SetUpTestCase(), SV_GetCvarToken(), SV_InitGameProgs(), SV_NextMapcycle(), SV_SetMaster_f(), TEST_F(), GameTest::testCountSpawnpointsForMapInMultiplayerMode(), GameTest::testCountSpawnpointsForMapInSingleplayerMode(), GameTest::testCountSpawnpointsForMapWithAssembly(), GameTest::testCountSpawnpointsForMapWithAssemblyAndAircraft(), UI_AbstractOption_SetCurrentValue(), UI_EditorNodeSelectNode(), UI_InitStack(), UI_MapInfo(), UI_MaterialEditorUpdate(), UI_Popup(), UI_PopupButton(), UI_PopupList(), WEB_Auth(), WEB_AuthResponse(), and WEB_InitStartup().
|
static |
Sets a cvar values Handles write protection and latched cvars as expected.
[in] | varName | Which cvar |
[in] | value | Set the cvar to the value specified by 'value' |
[in] | force | Force the update of the cvar |
Definition at line 512 of file cvar.cpp.
References cvar_s::check, com_cvarSysPool, Com_Printf(), Com_ServerState(), Com_SetRenderModified(), Com_SetUserinfoModified(), CVAR_DEVELOPER, Cvar_ExecuteChangeListener(), Cvar_FindVar(), Cvar_Get(), Cvar_InfoValidate(), CVAR_LATCH, CVAR_NOSET, CVAR_R_MASK, CVAR_SERVERINFO, CVAR_USERINFO, cvar_s::flags, cvar_s::integer, cvar_s::latchedString, Mem_Free, Mem_PoolStrDup, cvar_s::modified, cvar_s::oldString, Q_streq, cvar_s::string, and cvar_s::value.
Referenced by Cvar_ForceSet(), and Cvar_Set().
Allows setting and defining of arbitrary cvars from console.
Definition at line 761 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), CVAR_ARCHIVE, Cvar_FindVar(), Cvar_FullSet(), CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, Cvar_Set(), CVAR_USERINFO, and cvar_s::flags.
Referenced by Cvar_Init().
bool Cvar_SetCheckFunction | ( | const char * | varName, |
bool(*)(cvar_t *cvar) | check | ||
) |
Set a checker function for cvar values.
Sets the check functions for a cvar (e.g. Cvar_Assert)
Definition at line 139 of file cvar.cpp.
References cvar_s::check, Com_Printf(), and Cvar_FindVar().
Referenced by HUD_InitStartup(), Qcommon_Init(), R_InitExtensions(), R_RegisterSystemVars(), SV_Init(), and VID_Init().
Allows resetting cvars to old value from console.
Definition at line 728 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_Set(), cvar_s::oldString, and v.
Referenced by Cvar_Init().
void Cvar_SetValue | ( | const char * | varName, |
float | value | ||
) |
Expands value to a string and calls Cvar_Set.
expands value to a string and calls Cvar_Set
Definition at line 671 of file cvar.cpp.
References Cvar_Set().
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorSelectList(), CL_BattlescapeMouseDragging(), CL_BattlescapeRadarGenerateAll(), CL_CameraRoute(), CL_ChangeSkin_f(), CL_CharacterSkillAndScoreCvars(), CL_CheckCameraRoute(), CL_EntPerish(), CL_LevelDown_f(), CL_LevelUp_f(), CL_NextAlien_f(), CL_PrevAlien_f(), CL_ViewCenterAtGridPosition(), Com_DeveloperSet_f(), Cvar_Add_f(), Cvar_AssertValue(), Cvar_Mod_f(), cvar_t_set_value__SWIG_0(), GAME_GetImportData(), HUD_Update(), HUD_UpdateActorCvar(), IN_Frame(), INV_UpdateObject_f(), LE_CenterView(), uiRadioButtonNode::onActivate(), R_BeginFrame(), R_CvarCheckMaxLightmap(), R_CvarPostProcess(), R_CvarPrograms(), R_InitExtensions(), R_SphereInit(), R_UpdateVidDef(), R_VerifyDriver(), SCR_ChangeCursor(), uiAbstractValueNode::setDelta(), uiAbstractValueNode::setMax(), uiAbstractValueNode::setMin(), uiAbstractValueNode::setValue(), SP_worldspawn(), SV_Map_f(), UI_InvalidateStack(), and UI_NodeSetProperty().
Definition at line 1100 of file cvar.cpp.
References OBJZERO.
Referenced by Qcommon_Shutdown(), and TEST_Shutdown().
Allows switching boolean cvars between zero and not-zero from console.
Definition at line 805 of file cvar.cpp.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), CVAR_ARCHIVE, Cvar_FindVar(), Cvar_FullSet(), Cvar_GetInteger(), CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, Cvar_Set(), CVAR_USERINFO, cvar_s::flags, and va().
Referenced by Cvar_Init().
void Cvar_UnRegisterChangeListener | ( | const char * | varName, |
cvarChangeListenerFunc_t | listenerFunc | ||
) |
Unregisters a cvar change listener.
varName | The cvar name to register the listener for |
listenerFunc | The listener callback to unregister |
Definition at line 487 of file cvar.cpp.
References cvar_s::changeListener, Com_Printf(), Cvar_FindVar(), cvarChangeListener_s::exec, Mem_Free, and cvarChangeListener_s::next.
Referenced by CL_Shutdown(), uiCvarNode::onWindowClosed(), and UI_RemoveCvarListener_f().
void Cvar_UnRegisterCvarListener | ( | CvarListenerPtr | listener | ) |
Unregisters a cvar listener.
listener | The listener callback to unregister |
Definition at line 415 of file cvar.cpp.
References cvarListeners.
Referenced by GAME_Shutdown().
Any variables with latched values will now be updated.
any CVAR_LATCHED variables that have been set will now take effect
Definition at line 683 of file cvar.cpp.
References cvar_s::next.
Referenced by SV_InitGame().
const char* Cvar_Userinfo | ( | char * | info, |
size_t | infoSize | ||
) |
Returns an info string containing all the CVAR_USERINFO cvars.
returns an info string containing all the CVAR_USERINFO cvars
Definition at line 967 of file cvar.cpp.
References Cvar_BitInfo(), and CVAR_USERINFO.
Referenced by CL_Connect(), CL_SendChangedUserinfos(), CL_UserInfo_f(), and TEST_F().
const char* Cvar_VariableStringOld | ( | const char * | varName | ) |
Returns the old value of cvar as string before we changed it.
returns an empty string if not defined
Even if the cvar does not exist this function will not return a null pointer but an empty string
Definition at line 226 of file cvar.cpp.
References Cvar_FindVar(), and cvar_s::oldString.
Referenced by GAME_GetImportData().
appends lines containing "set variable value" for all variables with the archive flag set to true.
Definition at line 868 of file cvar.cpp.
References CVAR_ARCHIVE, FS_Printf(), qFILE_s::name, and cvar_s::next.
Referenced by Com_WriteConfigToFile().
|
static |
Definition at line 42 of file cvar.cpp.
Referenced by Cvar_Delete(), Cvar_Get(), Cvar_RegisterCvarListener(), and Cvar_UnRegisterCvarListener().
|
static |
|
static |
|
static |
This is set each time a CVAR_USERINFO variable is changed so that the renderer knows to update stuff accordingly.
Definition at line 48 of file cvar.cpp.
Referenced by Com_IsRenderModified(), and Com_SetRenderModified().
|
static |
This is set each time a CVAR_USERINFO variable is changed so that the client knows to send it to the server.
Definition at line 54 of file cvar.cpp.
Referenced by Com_IsUserinfoModified(), and Com_SetUserinfoModified().