|
UFO: Alien Invasion
|
Cvar (console variable) header file. More...


Go to the source code of this file.
Data Structures | |
| struct | cvarChangeListener_t |
| struct | cvar_t |
| This is a cvar definition. Cvars can be user modified and used in our menus e.g. More... | |
| struct | cvarList_t |
| class | CvarListener |
| Listener for cvar changes. More... | |
Macros | |
| #define | CVAR_ARCHIVE 1 |
| #define | CVAR_USERINFO 2 |
| #define | CVAR_SERVERINFO 4 |
| #define | CVAR_NOSET 8 |
| #define | CVAR_LATCH 16 |
| #define | CVAR_DEVELOPER 32 |
| #define | CVAR_CHEAT 64 |
| #define | CVAR_R_IMAGES 128 |
| #define | CVAR_R_CONTEXT 256 |
| #define | CVAR_R_PROGRAMS 512 |
| #define | CVAR_R_MASK (CVAR_R_IMAGES | CVAR_R_CONTEXT | CVAR_R_PROGRAMS) |
Typedefs | |
| typedef void(* | cvarChangeListenerFunc_t) (const char *cvarName, const char *oldValue, const char *newValue, void *data) |
| Callback for the change listener. | |
| typedef SharedPtr< CvarListener > | CvarListenerPtr |
Functions | |
| 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, the value will not be changed, but flags will be ORed in that allows variables to be unarchived without needing bitflags | |
| cvar_t * | Cvar_Set (const char *varName, const char *value,...) __attribute__((format(__printf__ |
| will create the variable if it doesn't exist | |
| cvar_t cvar_t * | Cvar_ForceSet (const char *varName, const char *value) |
| will set the variable even if NOSET or LATCH | |
| cvar_t * | Cvar_FullSet (const char *varName, const char *value, int flags) |
| Sets a cvar from console with the given flags. | |
| void | Cvar_SetValue (const char *varName, float value) |
| expands value to a string and calls Cvar_Set | |
| int | Cvar_GetInteger (const char *varName) |
| returns 0 if not defined or non numeric | |
| float | Cvar_GetValue (const char *varName) |
| returns 0.0 if not defined or non numeric | |
| const char * | Cvar_GetString (const char *varName) |
| returns an empty string if not defined | |
| const char * | Cvar_VariableStringOld (const char *varName) |
| returns an empty string if not defined | |
| int | Cvar_CompleteVariable (const char *partial, const char **match) |
| attempts to match a partial variable name for command line completion returns nullptr if nothing fits | |
| void | Cvar_UpdateLatchedVars (void) |
| any CVAR_LATCHED variables that have been set will now take effect | |
| bool | Cvar_Command (void) |
| 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) | |
| void | Cvar_Init (void) |
| Reads in all archived cvars. | |
| void | Cvar_Shutdown (void) |
| const char * | Cvar_Userinfo (char *info, size_t infoSize) |
| returns an info string containing all the CVAR_USERINFO cvars | |
| const char * | Cvar_Serverinfo (char *info, size_t infoSize) |
| returns an info string containing all the CVAR_SERVERINFO cvars | |
| bool | Cvar_AssertValue (cvar_t *cvar, float minVal, float maxVal, bool shouldBeIntegral) |
| this function checks cvar ranges and integral values | |
| bool | Cvar_SetCheckFunction (const char *varName, bool(*check)(cvar_t *cvar)) |
| Sets the check functions for a cvar (e.g. Cvar_Assert). | |
| cvarChangeListener_t * | Cvar_RegisterChangeListener (const char *varName, cvarChangeListenerFunc_t listenerFunc) |
| Registers a listener that is executed each time a cvar changed its value. | |
| void | Cvar_UnRegisterChangeListener (const char *varName, cvarChangeListenerFunc_t listenerFunc) |
| Unregisters a cvar change listener. | |
| void | Cvar_RegisterCvarListener (CvarListenerPtr listener) |
| Registers a cvar listener. | |
| void | Cvar_UnRegisterCvarListener (CvarListenerPtr listener) |
| Unregisters a cvar listener. | |
| void | Cvar_FixCheatVars (void) |
| Reset cheat cvar values to default. | |
| bool | Cvar_Delete (const char *varName) |
| Function to remove the cvar and free the space. | |
| cvar_t * | Cvar_FindVar (const char *varName) |
| Searches for a cvar given by parameter. | |
| bool | Cvar_PendingCvars (int flags) |
| Checks whether there are pending cvars for the given flags. | |
| void | Com_SetUserinfoModified (bool modified) |
| bool | Com_IsUserinfoModified (void) |
| void | Com_SetRenderModified (bool modified) |
| bool | Com_IsRenderModified (void) |
| void | Cvar_ClearVars (int flags) |
| void | Cvar_Reset (cvar_t *cvar) |
| Sets the cvar value back to the old value. | |
Cvar (console variable) header file.
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. The user can access cvars from the console in three ways: r_draworder prints the current value r_draworder 0 sets the current value to 0 set r_draworder 0 as above, but creates the cvar if not present Cvars are restricted from having the same names as commands to keep this interface from being ambiguous.
Definition in file cvar.h.
| #define CVAR_ARCHIVE 1 |
set to cause it to be saved to vars.rc
Definition at line 40 of file cvar.h.
Referenced by ACTOR_InitStartup(), CL_CameraInit(), CL_InitLocal(), CL_ViewInit(), Con_Init(), Cvar_List_f(), Cvar_Set_f(), Cvar_Switch_f(), Cvar_WriteVariables(), G_Init(), GAME_MP_CallbacksInit(), GAME_MP_ServerListInit(), HUD_InitStartup(), IN_Init(), IN_StartupJoystick(), Irc_Init(), M_Init(), NET_Init(), PTL_InitStartup(), Qcommon_Init(), R_InitExtensions(), R_RegisterSystemVars(), R_SphereInit(), S_Init(), S_MumbleInit(), SAV_Init(), SAV_InitCallbacks(), SCR_Init(), GameTest::SetUpTestCase(), SV_Init(), Sys_Init(), TOTD_InitStartup(), UI_Init(), UI_InitDraw(), UI_RegisterGeoscapeNode(), VID_Init(), and WEB_InitStartup().
| #define CVAR_CHEAT 64 |
clamp to the default value when cheats are off
Definition at line 46 of file cvar.h.
Referenced by Cvar_FixCheatVars(), Cvar_Get(), and G_Init().
| #define CVAR_DEVELOPER 32 |
set from commandline (not from within the game) and hide from console
Definition at line 45 of file cvar.h.
Referenced by CP_InitStartup(), Cvar_CompleteVariable(), Cvar_List_f(), Cvar_Set2(), G_Init(), GEO_InitStartup(), UFO_InitStartup(), and UI_Init().
| #define CVAR_LATCH 16 |
save changes until server restart
Definition at line 44 of file cvar.h.
Referenced by Cvar_List_f(), Cvar_Set2(), Cvar_Set_f(), Cvar_Switch_f(), G_Init(), HUD_InitStartup(), R_RegisterSystemVars(), S_MumbleInit(), SV_Init(), SV_InitGame(), and SV_Shutdown().
| #define CVAR_NOSET 8 |
don't allow change from console at all, but can be set from the command line
Definition at line 43 of file cvar.h.
Referenced by CL_InitLocal(), Cvar_List_f(), Cvar_Set2(), Cvar_Set_f(), Cvar_Switch_f(), G_Init(), GAME_SetMode(), Irc_Init(), Qcommon_Init(), GameTest::SetUpTestCase(), SV_Init(), SV_Map(), SV_Shutdown(), and TEST_F().
| #define CVAR_R_CONTEXT 256 |
vid shutdown if such a cvar was modified
Definition at line 48 of file cvar.h.
Referenced by CL_Init(), CL_Shutdown(), R_RegisterSystemVars(), and VID_Init().
| #define CVAR_R_IMAGES 128 |
effects image filtering
Definition at line 47 of file cvar.h.
Referenced by CL_Init(), CL_Shutdown(), Cvar_List_f(), and R_RegisterSystemVars().
| #define CVAR_R_MASK (CVAR_R_IMAGES | CVAR_R_CONTEXT | CVAR_R_PROGRAMS) |
Definition at line 51 of file cvar.h.
Referenced by Cvar_Set2(), R_BeginFrame(), and R_Init().
| #define CVAR_R_PROGRAMS 512 |
if changed, shaders are restarted
Definition at line 49 of file cvar.h.
Referenced by R_BeginFrame(), R_InitExtensions(), and R_RegisterSystemVars().
| #define CVAR_SERVERINFO 4 |
added to serverinfo when changed
Definition at line 42 of file cvar.h.
Referenced by CL_InitLocal(), Cvar_Get(), Cvar_List_f(), Cvar_Serverinfo(), Cvar_Set2(), Cvar_Set_f(), Cvar_Switch_f(), G_Init(), GAME_MP_CallbacksInit(), Qcommon_Init(), GameTest::SetUpTestCase(), SV_Init(), SV_Map(), and Sys_Init().
| #define CVAR_USERINFO 2 |
added to userinfo when changed
Definition at line 41 of file cvar.h.
Referenced by ACTOR_InitStartup(), CL_InitLocal(), Cvar_FullSet(), Cvar_Get(), Cvar_List_f(), Cvar_Set2(), Cvar_Set_f(), Cvar_Switch_f(), Cvar_Userinfo(), G_Init(), GAME_MP_CallbacksInit(), and TEST_F().
| typedef SharedPtr<CvarListener> CvarListenerPtr |
| bool Com_IsRenderModified | ( | void | ) |
Definition at line 71 of file cvar.cpp.
References renderModified.
Referenced by Cvar_Set(), and R_BeginFrame().
| bool Com_IsUserinfoModified | ( | void | ) |
Definition at line 61 of file cvar.cpp.
References userinfoModified.
Referenced by CL_SendChangedUserinfos(), and Cvar_Set().
| void Com_SetRenderModified | ( | bool | modified | ) |
Definition at line 66 of file cvar.cpp.
References renderModified.
Referenced by Cvar_Set(), 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_Set(), Cvar_Set2(), and Qcommon_Init().
| bool Cvar_AssertValue | ( | cvar_t * | cvar, |
| float | minVal, | ||
| float | maxVal, | ||
| bool | shouldBeIntegral ) |
this function checks cvar ranges and integral 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_t::integer, cvar_t::name, and cvar_t::value.
Referenced by CL_CvarCheckVidGamma(), CL_CvarCheckVidMode(), CL_CvarWorldLevel(), Com_CvarCheckMaxFPS(), Cvar_Set(), R_CvarCheckDynamicLights(), R_CvarCheckMaxLightmap(), R_CvarCheckMultisample(), R_CvarCheckWeather(), R_CvarPostProcess(), R_CvarPrograms(), and SV_CheckMaxSoldiersPerPlayer().
Definition at line 891 of file cvar.cpp.
References cvarVars.
Referenced by Cvar_Set(), R_BeginFrame(), and R_Init().
| bool Cvar_Command | ( | void | ) |
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)
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(), and v.
Referenced by Cmd_vExecuteString(), and Cvar_Set().
| int Cvar_CompleteVariable | ( | const char * | partial, |
| const char ** | match ) |
attempts to match a partial variable name for command line completion returns nullptr if nothing fits
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, cvarVars, and S_COLOR_GREEN.
Referenced by Com_ConsoleCompleteCommand(), and Cvar_Set().
| 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_t::changeListener, Com_HashKey(), Com_Printf(), CVAR_HASH_SIZE, cvarListeners, cvarVars, cvarVarsHash, cvar_t::defaultString, cvar_t::description, cvar_t::flags, hash, HASH_Delete, i, cvar_t::latchedString, Mem_Free, cvar_t::name, cvar_t::next, cvarChangeListener_t::next, cvar_t::oldString, cvar_t::prev, Q_strcasecmp, and cvar_t::string.
Referenced by _wrap_delvar(), cgame_import_t::bool(), Cvar_Del_f(), Cvar_Set(), GAME_GetImportData(), GAMECvarListener::onGameModeChange(), and UI_ExecuteAction().
| 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, cvarVarsHash, hash, 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_Set(), 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(), cvarVars, Mem_Free, Mem_PoolStrDup, and Q_streq.
Referenced by CL_SendCommand(), and Cvar_Set().
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(), Cvar_Set(), GAME_GetImportData(), INV_ItemDescription(), Irc_Client_CmdNick(), Irc_Client_CmdTopic(), Irc_Client_Join(), Irc_Client_Msg_f(), Irc_Logic_Disconnect(), 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_t::flags, cvar_t::integer, Mem_Free, Mem_PoolStrDup, cvar_t::modified, cvar_t::oldString, cvar_t::string, and cvar_t::value.
Referenced by Cvar_Set(), Cvar_Set_f(), Cvar_Switch_f(), GAME_SetMode(), and SV_Map().
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
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, cvarVarsHash, cvar_t::defaultString, cvar_t::description, cvar_t::flags, hash, HASH_Add, i, cvar_t::integer, Mem_Free, Mem_PoolAllocType, Mem_PoolStrDup, cvar_t::modified, cvar_t::name, cvar_t::next, cvar_t::oldString, cvar_t::string, and cvar_t::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(), CampaignTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), GameTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), RandomMapAssemblyTest::SetUpTestCase(), SV_Init(), SV_InitGameProgs(), Sys_Init(), TEST_F(), TEST_F(), TEST_Init(), TOTD_InitStartup(), UI_AbstractOption_SetCvar(), UI_GenInjectedString(), UI_GetFloatFromExpression(), UI_GetFloatFromNodeProperty(), UI_GetStringFromExpression(), UI_Init(), UI_InitDraw(), UI_InitWindows(), UI_RadioButton_SetCvar(), UI_RegisterGeoscapeNode(), VID_Init(), WEB_CGameCvars(), and WEB_InitStartup().
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 0 if not defined or non numeric
returns 0 if not defined or non numeric
Definition at line 194 of file cvar.cpp.
References Cvar_FindVar(), and cvar_t::integer.
Referenced by CL_BattlescapeRadarGenerate_f(), CL_ChangeSkin_f(), CL_ChangeSkinForWholeTeam_f(), CL_NextAlien_f(), CL_PrevAlien_f(), Com_DeveloperSet_f(), Cvar_FixCheatVars(), Cvar_Set(), Cvar_Switch_f(), GAME_GetImportData(), GAME_GetSelectedChr(), cgame_import_t::int(), R_SetMode(), Weather::render(), and Weather::update().
| const char * Cvar_GetString | ( | const char * | varName | ) |
returns an empty string if not defined
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_t::string.
Referenced by CL_BattlescapeRadarGenerate_f(), CL_ConnectionlessPacket(), Cmd_AddCommand(), Cmd_TokenizeString(), Com_MacroExpandString(), Cvar_Copy_f(), Cvar_Set(), 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 0.0 if not defined or non numeric
returns 0.0 if not defined or non numeric
Definition at line 125 of file cvar.cpp.
References Cvar_FindVar(), and cvar_t::string.
Referenced by Cvar_Set(), uiGeoscapeNode::draw(), cgame_import_t::float(), GAME_GetImportData(), IN_SetMouseSpace(), R_PreprocessShaderR(), Rimp_Init(), and UI_GetReferenceFloat().
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 Cvar_Set(), Qcommon_Init(), and TEST_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 cvarVars.
Referenced by Cvar_Set(), and 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_t::changeListener, Com_Printf(), Cvar_FindVar(), Cvar_GetChangeListener(), cvarChangeListener_t::exec, and cvarChangeListener_t::next.
Referenced by CL_Init(), Cvar_Set(), 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 Cvar_Set(), and 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_t::name, and cvar_t::oldString.
Referenced by Cvar_Set(), 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 Cvar_Set(), SV_Serverinfo_f(), SV_ShowServerinfo_f(), and SVC_Status().
| cvar_t * Cvar_Set | ( | const char * | varName, |
| const char * | value, | ||
| ... ) |
will create the variable if it doesn't exist
References __attribute__, Com_IsRenderModified(), Com_IsUserinfoModified(), Com_SetRenderModified(), Com_SetUserinfoModified(), Cvar_AssertValue(), Cvar_ClearVars(), Cvar_Command(), Cvar_CompleteVariable(), Cvar_Delete(), Cvar_FindVar(), Cvar_FixCheatVars(), Cvar_ForceSet(), Cvar_FullSet(), Cvar_GetInteger(), Cvar_GetString(), Cvar_GetValue(), Cvar_Init(), Cvar_PendingCvars(), Cvar_RegisterChangeListener(), Cvar_RegisterCvarListener(), Cvar_Reset(), Cvar_Serverinfo(), Cvar_SetCheckFunction(), Cvar_SetValue(), Cvar_Shutdown(), Cvar_UnRegisterChangeListener(), Cvar_UnRegisterCvarListener(), Cvar_UpdateLatchedVars(), Cvar_Userinfo(), Cvar_VariableStringOld(), and format().
| bool Cvar_SetCheckFunction | ( | const char * | varName, |
| bool(* | check )(cvar_t *cvar) ) |
Sets the check functions for a cvar (e.g. Cvar_Assert).
Sets the check functions for a cvar (e.g. Cvar_Assert).
Definition at line 139 of file cvar.cpp.
References cvar_t::check, Com_Printf(), and Cvar_FindVar().
Referenced by Cvar_Set(), HUD_InitStartup(), Qcommon_Init(), R_InitExtensions(), R_RegisterSystemVars(), SV_Init(), and VID_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_Set(), 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 cvarVars, cvarVarsHash, and OBJZERO.
Referenced by Cvar_Set(), Qcommon_Shutdown(), and TEST_Shutdown().
| 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_t::changeListener, Com_Printf(), Cvar_FindVar(), cvarChangeListener_t::exec, Mem_Free, and cvarChangeListener_t::next.
Referenced by CL_Shutdown(), Cvar_Set(), 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 Cvar_Set(), and GAME_Shutdown().
any CVAR_LATCHED variables that have been set will now take effect
any CVAR_LATCHED variables that have been set will now take effect
Definition at line 683 of file cvar.cpp.
References cvarVars.
Referenced by Cvar_Set(), and 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(), Cvar_Set(), and TEST_F().
| const char * Cvar_VariableStringOld | ( | const char * | varName | ) |
returns an empty string if not defined
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_t::oldString.
Referenced by Cvar_Set(), and GAME_GetImportData().