Cvar (console variable) header file. More...
Go to the source code of this file.
Data Structures | |
struct | cvarListener_s |
struct | cvar_s |
This is a cvar defintion. Cvars can be user modified and used in our menus e.g. More... | |
struct | cvarList_s |
Defines | |
#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) |
Callback for the listener. | |
typedef struct cvarListener_s | cvarChangeListener_t |
typedef struct cvar_s | cvar_t |
This is a cvar defintion. Cvars can be user modified and used in our menus e.g. | |
typedef struct cvarList_s | cvarList_t |
Functions | |
cvar_t * | Cvar_Get (const char *varName, const char *value, int flags, const char *desc) |
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) |
will create the variable if it doesn't exist | |
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 NULL if nothing fits | |
void | Cvar_UpdateLatchedVars (void) |
any CVAR_LATCHED variables that have been set will now take effect | |
qboolean | 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 (void) |
returns an info string containing all the CVAR_USERINFO cvars | |
const char * | Cvar_Serverinfo (void) |
returns an info string containing all the CVAR_SERVERINFO cvars | |
qboolean | Cvar_AssertValue (cvar_t *cvar, float minVal, float maxVal, qboolean shouldBeIntegral) |
this function checks cvar ranges and integral values | |
qboolean | Cvar_AssertString (cvar_t *cvar, char **array, int arraySize) |
this function checks whether the cvar string is a valid string in char ** array | |
qboolean | Cvar_SetCheckFunction (const char *varName, qboolean(*check)(cvar_t *cvar)) |
Sets the check functions for a cvar (e.g. Cvar_Assert). | |
void | 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_FixCheatVars (void) |
Reset cheat cvar values to default. | |
qboolean | 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. | |
qboolean | Cvar_PendingCvars (int flags) |
Checks whether there are pending cvars for the given flags. | |
void | Com_SetUserinfoModified (qboolean modified) |
qboolean | Com_IsUserinfoModified (void) |
void | Com_SetRenderModified (qboolean modified) |
qboolean | Com_IsRenderModified (void) |
void | Cvar_ClearVars (int flags) |
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 38 of file cvar.h.
Referenced by ACTOR_InitStartup(), B_InitCallbacks(), CL_CameraInit(), CL_InitLocal(), CL_InitParticles(), CL_ViewInit(), Con_Init(), Cvar_List_f(), Cvar_Set_f(), Cvar_WriteVariables(), G_Init(), GAME_CP_InitStartup(), HUD_InitStartup(), IN_Init(), IN_StartupJoystick(), Irc_Init(), M_Init(), MAP_InitStartup(), MP_ServerListInit(), NET_Init(), Qcommon_Init(), R_InitExtensions(), R_RegisterImageVars(), R_RegisterSystemVars(), R_SphereInit(), S_Init(), SAV_Init(), SCR_Init(), SV_Init(), Sys_Init(), TOTD_InitStartup(), UI_Init(), UI_InitDraw(), and VID_Init().
#define CVAR_CHEAT 64 |
clamp to the default value when cheats are off
Definition at line 44 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 43 of file cvar.h.
Referenced by Cvar_CompleteVariable(), Cvar_List_f(), Cvar_Set2(), G_Init(), MAP_InitStartup(), UFO_InitStartup(), and UI_Init().
#define CVAR_LATCH 16 |
save changes until server restart
Definition at line 42 of file cvar.h.
Referenced by CL_InitParticles(), Cvar_Delete(), Cvar_List_f(), Cvar_Set2(), G_Init(), R_RegisterSystemVars(), SV_Init(), SV_InitGame(), SV_Shutdown(), and UI_Init().
#define CVAR_NOSET 8 |
don't allow change from console at all, but can be set from the command line
Definition at line 41 of file cvar.h.
Referenced by CL_InitLocal(), Cvar_Delete(), Cvar_List_f(), Cvar_Set2(), G_Init(), Irc_Init(), Qcommon_Init(), SV_Init(), SV_InitGame(), SV_Map(), and SV_Shutdown().
#define CVAR_R_CONTEXT 256 |
vid shutdown if such a cvar was modified
Definition at line 46 of file cvar.h.
Referenced by R_BeginFrame(), R_RegisterSystemVars(), and UI_CheckCvar().
#define CVAR_R_IMAGES 128 |
effects image filtering
Definition at line 45 of file cvar.h.
Referenced by Cvar_List_f(), R_RegisterImageVars(), R_RegisterSystemVars(), and UI_CheckCvar().
#define CVAR_R_MASK (CVAR_R_IMAGES | CVAR_R_CONTEXT | CVAR_R_PROGRAMS) |
Definition at line 49 of file cvar.h.
Referenced by Cvar_Set2(), and R_Init().
#define CVAR_R_PROGRAMS 512 |
if changed, shaders are restarted
Definition at line 47 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 40 of file cvar.h.
Referenced by CL_InitLocal(), Cvar_Delete(), Cvar_Get(), Cvar_List_f(), Cvar_Serverinfo(), Cvar_Set2(), Cvar_Set_f(), G_Init(), Qcommon_Init(), SV_Init(), SV_Map(), and Sys_Init().
#define CVAR_USERINFO 2 |
added to userinfo when changed
Definition at line 39 of file cvar.h.
Referenced by ACTOR_InitStartup(), CL_InitLocal(), Cvar_Delete(), Cvar_FullSet(), Cvar_Get(), Cvar_List_f(), Cvar_Set2(), Cvar_Set_f(), Cvar_Userinfo(), G_Init(), and MP_CallbacksInit().
This is a cvar defintion. Cvars can be user modified and used in our menus e.g.
typedef struct cvarListener_s cvarChangeListener_t |
typedef void(* cvarChangeListenerFunc_t)(const char *cvarName, const char *oldValue, const char *newValue) |
typedef struct cvarList_s cvarList_t |
qboolean Com_IsRenderModified | ( | void | ) |
qboolean Com_IsUserinfoModified | ( | void | ) |
Definition at line 55 of file cvar.c.
References userinfoModified.
Referenced by CL_SendChangedUserinfos().
void Com_SetRenderModified | ( | qboolean | modified | ) |
Definition at line 60 of file cvar.c.
References renderModified.
Referenced by Cvar_Set2(), Qcommon_Init(), and R_BeginFrame().
void Com_SetUserinfoModified | ( | qboolean | modified | ) |
Definition at line 50 of file cvar.c.
References userinfoModified.
Referenced by CL_Connect(), CL_SendChangedUserinfos(), Cvar_FullSet(), Cvar_Set2(), and Qcommon_Init().
this function checks whether the cvar string is a valid string in char ** array
this function checks whether the cvar string is a valid string in char ** array
[in] | cvar | Cvar to check |
[in] | array | Array of valid cvar value strings |
[in] | arraySize | Number of entries in the string array |
Definition at line 186 of file cvar.c.
References Com_Printf(), Cvar_Set(), i, cvar_s::name, cvar_s::oldString, qfalse, qtrue, cvar_s::string, and string.
this function checks cvar ranges and integral values
this function checks cvar ranges and integral values
[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 152 of file cvar.c.
References Com_Printf(), Cvar_Set(), Cvar_SetValue(), cvar_s::integer, cvar_s::name, qfalse, qtrue, va(), and cvar_s::value.
Referenced by CL_CvarCheckVidGamma(), CL_CvarCheckVidMode(), CL_CvarWorldLevel(), Com_CvarCheckMaxFPS(), R_CvarCheckDynamicLights(), R_CvarCheckLights(), R_CvarCheckMaxLightmap(), R_CvarPostProcess(), R_CvarPrograms(), and SV_CheckMaxSoldiersPerPlayer().
void Cvar_ClearVars | ( | int | flags | ) |
Definition at line 880 of file cvar.c.
References cvar_s::flags, cvar_s::modified, cvar_s::next, and qfalse.
Referenced by R_Init().
qboolean 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 739 of file cvar.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_FindVar(), Cvar_Set(), cvar_s::name, qfalse, qtrue, and cvar_s::string.
Referenced by Cmd_ExecuteString().
int Cvar_CompleteVariable | ( | const char * | partial, | |
const char ** | match | |||
) |
attempts to match a partial variable name for command line completion returns NULL if nothing fits
attempts to match a partial variable name for command line completion returns NULL 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 273 of file cvar.c.
References Cmd_GenericCompleteFunction(), COLORED_GREEN, Com_Printf(), CVAR_DEVELOPER, cvar_s::description, cvar_s::flags, len, MAX_COMPLETE, cvar_s::name, cvar_s::next, and cvar_s::string.
Referenced by Com_ConsoleCompleteCommand().
qboolean Cvar_Delete | ( | const char * | varName | ) |
Function to remove the cvar and free the space.
Definition at line 307 of file cvar.c.
References cvar_s::changeListener, Com_HashKey(), Com_Printf(), CVAR_HASH_SIZE, CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, CVAR_USERINFO, cvar_s::defaultString, cvar_s::description, cvar_s::flags, hash(), cvar_s::hash_next, cvar_s::latchedString, Mem_Free, cvar_s::name, cvarListener_s::next, cvar_s::next, cvar_s::oldString, cvar_s::prev, Q_strcasecmp, qfalse, qtrue, and cvar_s::string.
Referenced by B_ShutdownCallbacks(), Cvar_Del_f(), GAME_SK_Shutdown(), INS_ShutdownCallbacks(), UI_ExecuteAction(), and UP_Shutdown().
cvar_t* Cvar_FindVar | ( | const char * | varName | ) |
Searches for a cvar given by parameter.
varName | The cvar name as string |
NULL
if no cvar with the specified name was found Definition at line 93 of file cvar.c.
References Com_HashKey(), CVAR_HASH_SIZE, hash(), cvar_s::hash_next, and cvar_s::name.
Referenced by 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_SetCheckFunction(), Cvar_SetOld_f(), Cvar_UnRegisterChangeListener(), Cvar_VariableStringOld(), INV_UpdateObject_f(), SAV_GameLoad_f(), SV_GetCvarToken(), UI_GetBooleanFromExpression(), UI_SetCvar(), and UI_TabNodeInit().
void Cvar_FixCheatVars | ( | void | ) |
Reset cheat cvar values to default.
Definition at line 1062 of file cvar.c.
References com_cvarSysPool, Com_Printf(), Com_ServerState(), CVAR_CHEAT, Cvar_GetInteger(), cvar_s::defaultString, cvar_s::flags, cvar_s::integer, Mem_Free, Mem_PoolStrDup, cvar_s::name, cvar_s::next, cvar_s::oldString, cvar_s::string, and cvar_s::value.
Referenced by CL_SendCommand().
cvar_t* Cvar_ForceSet | ( | const char * | varName, | |
const char * | value | |||
) |
will set the variable even if NOSET or LATCH
Definition at line 632 of file cvar.c.
References Cvar_Set2(), and qtrue.
Referenced by CL_ActorEquipmentSelect_f(), CL_ActorPilotSelect_f(), CL_ActorSelect(), CL_ActorTeamSelect_f(), CL_CharacterSkillAndScoreCvars(), CL_UpdateEquipmentMenuParameters_f(), GAME_CP_InitStartup(), GAME_MP_InitStartup(), GAME_SK_InitStartup(), INV_ItemDescription(), Irc_Client_CmdNick(), Irc_Client_CmdTopic(), Irc_Client_Join(), Irc_Client_Msg_f(), Irc_Logic_Disconnect(), Qcommon_Init(), UI_ExecuteSetAction(), UI_TabNodeInit(), UI_TextEntryNodeAbortEdition(), and UI_TextEntryNodeEdit().
cvar_t* Cvar_FullSet | ( | const char * | varName, | |
const char * | value, | |||
int | flags | |||
) |
Sets a cvar from console with the given flags.
varName | Which cvar | |
value | Which value for the cvar | |
flags | which flags |
Definition at line 662 of file cvar.c.
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, qtrue, cvar_s::string, and cvar_s::value.
Referenced by Cvar_Set_f(), and SV_Map().
cvar_t* Cvar_Get | ( | const char * | var_name, | |
const char * | var_value, | |||
int | flags, | |||
const char * | desc | |||
) |
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 377 of file cvar.c.
References com_cvarSysPool, Com_HashKey(), Com_Printf(), CVAR_CHEAT, Cvar_FindVar(), CVAR_HASH_SIZE, Cvar_InfoValidate(), CVAR_SERVERINFO, CVAR_USERINFO, cvar_s::defaultString, cvar_s::description, cvar_s::flags, hash(), HASH_Add, cvar_s::integer, Mem_Free, Mem_PoolAlloc, Mem_PoolStrDup, cvar_s::modified, cvar_s::name, cvar_s::next, cvar_s::oldString, cvar_s::prev, qtrue, cvar_s::string, and cvar_s::value.
Referenced by ACTOR_InitStartup(), B_InitCallbacks(), B_InitStartup(), CL_CameraInit(), CL_CheckCvars_f(), CL_Init(), CL_InitLocal(), CL_InitParticles(), CL_LanguageTest(), CL_ViewInit(), Con_Init(), CP_InitStartup(), Cvar_FullSet(), Cvar_Set2(), GAME_CP_InitStartup(), GAME_SK_InitStartup(), HTTP_InitStartup(), HUD_InitStartup(), IN_Init(), IN_StartupJoystick(), Irc_Init(), M_Init(), MAP_InitStartup(), MP_CallbacksInit(), MP_ServerListInit(), NET_Init(), PR_ProductionInit(), Qcommon_Init(), R_InitExtensions(), R_RegisterImageVars(), R_RegisterSystemVars(), R_SphereInit(), S_Init(), SAV_Init(), SCR_Init(), SEQ_InitSequence(), SV_Init(), SV_InitGame(), SV_InitGameProgs(), Sys_Init(), TOTD_InitStartup(), UFO_InitStartup(), UFO_InitSuiteRandomMapAssembly(), UI_GenInjectedString(), UI_GetFloatFromExpression(), UI_GetFloatFromNodeProperty(), UI_GetStringFromExpression(), UI_Init(), UI_InitDraw(), UI_InitWindows(), UI_TextEntryFocusGained(), UP_InitStartup(), and VID_Init().
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 217 of file cvar.c.
References Cvar_FindVar(), and cvar_s::integer.
Referenced by CL_ChangeSkin_f(), CL_ChangeSkinForWholeTeam_f(), CL_Connect_f(), CL_UpdateEmployeeList(), Com_DeveloperSet_f(), Cvar_FixCheatVars(), E_ChangeName_f(), GAME_CP_Results_f(), GAME_MP_StartServer_f(), GAME_SK_Start_f(), MAP_DrawMapMarkers(), MAP_DrawMapOnePhalanxAircraft(), MAP_MapClick(), and UI_GenRadarMap_f().
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 235 of file cvar.c.
References Cvar_FindVar(), and cvar_s::string.
Referenced by AIM_UpdateItemDescription(), AIR_ChangeAircraftName_f(), B_ChangeBaseName_f(), BS_MarketInfoClick_f(), CL_BookmarkAdd_f(), CL_CompleteNetworkAddress(), CL_ServerInfo_f(), CL_StartHTTPDownload(), Cmd_AddCommand(), Cmd_TokenizeString(), Com_MacroExpandString(), Cvar_Copy_f(), E_ChangeName_f(), GAME_GetTeamDef(), GAME_SK_ChangeEquip_f(), GAME_SK_Start_f(), HTTP_GetURL(), INS_BuildInstallation_f(), INS_ChangeInstallationName_f(), INS_SetInstallationTitle(), Irc_Client_CmdPrivmsg(), M_Play_f(), MP_SaveTeamMultiplayer_f(), SCR_SetLoadingBackground(), SV_InitGameProgs(), SVC_TeamInfo(), UI_GenRadarMap_f(), UI_MaterialEditorUpdate(), and UI_Translate_f().
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 112 of file cvar.c.
References Cvar_FindVar(), and cvar_s::string.
Referenced by GAME_MP_StartServer_f(), R_PreprocessShader(), UI_EKGNodeDraw(), UI_GetReferenceFloat(), UI_Modify_f(), and UI_ModifyWrap_f().
void Cvar_Init | ( | void | ) |
Reads in all archived cvars.
Definition at line 1113 of file cvar.c.
References Cmd_AddCommand(), Cvar_Add_f(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Del_f(), Cvar_List_f(), Cvar_Mod_f(), Cvar_Set_f(), and Cvar_SetOld_f().
Referenced by Qcommon_Init(), and TEST_Init().
qboolean Cvar_PendingCvars | ( | int | flags | ) |
Checks whether there are pending cvars for the given flags.
flags | The CVAR_* flags |
Definition at line 869 of file cvar.c.
References cvar_s::flags, cvar_s::modified, cvar_s::next, qfalse, and qtrue.
Referenced by R_BeginFrame().
void 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 460 of file cvar.c.
References cvar_s::changeListener, Com_Printf(), Cvar_FindVar(), Cvar_GetChangeListener(), cvarListener_s::exec, and cvarListener_s::next.
Referenced by HUD_InitStartup().
const char* Cvar_Serverinfo | ( | void | ) |
returns an info string containing all the CVAR_SERVERINFO cvars
returns an info string containing all the CVAR_SERVERINFO cvars
Definition at line 992 of file cvar.c.
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 | |||
) |
will create the variable if it doesn't exist
will create the variable if it doesn't exist
varName | Which cvar should be set | |
value | Which value should the cvar get |
Definition at line 643 of file cvar.c.
References Cvar_Set2(), and qfalse.
Referenced by AC_AlienClick(), AC_UpdateMenu(), AIM_AircraftEquipMenuUpdate(), AIM_DrawAircraftSlots(), AIM_UpdateItemDescription(), AIR_AircraftSelect(), AIR_DeleteAircraft(), B_BuildingStatus(), B_DrawBuilding(), B_InitCallbacks(), B_SetBaseTitle_f(), B_SetCurrentSelectedBase(), BDEF_BaseDefenceMenuUpdate_f(), BS_BuyType(), BS_BuyType_f(), BS_MarketAircraftDescription(), BS_MarketClick_f(), CL_ActorCvars(), CL_BookmarkAdd_f(), CL_ChangeSkin_f(), CL_CharacterSkillAndScoreCvars(), CL_GameAutoGo(), CL_LanguageTryToSet(), CL_NationDrawStats(), CL_NationStatsUpdate_f(), CL_ParseServerInfoMessage(), CL_SelectTeam_Init_f(), CL_UGVCvars(), CL_UpdateActorAircraftVar(), CL_UpdateCredits(), CL_UpdateEmployeeList(), CL_UpdateTime(), Com_Error(), Com_SetGameType(), CP_CreateBattleParameters(), CP_SetMissionVars(), CP_StartMissionMap(), Cvar_AssertString(), Cvar_AssertValue(), Cvar_Command(), Cvar_Copy_f(), Cvar_Define_f(), Cvar_Set_f(), Cvar_SetOld_f(), Cvar_SetValue(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_UpdateGUICount_f(), GAME_CP_CampaignListClick_f(), GAME_CP_CharacterCvars(), GAME_CP_MissionAutoCheck_f(), GAME_MP_ChangeGametype_f(), GAME_MP_InitStartup(), GAME_MP_MapInfo(), GAME_MP_StartServer_f(), GAME_SK_ChangeEquip_f(), GAME_SK_HideDropships(), GAME_SK_HideUFOs(), GAME_SK_SetMissionParameters(), HOS_UpdateMenu(), HUD_RefreshButtons(), HUD_Update(), HUD_UpdateActor(), HUD_UpdateActorCvar(), IN_StartupJoystick(), INS_DestroyInstallation(), INS_InitCallbacks(), INS_LoadXML(), INS_ParseInstallations(), INS_SelectInstallation(), INS_SetCurrentSelectedInstallation(), INS_SetInstallationTitle(), INV_ItemDescription(), Irc_Connect_f(), Irc_UserClick_f(), M_Change_f(), M_Play_f(), M_RandomTrack_f(), MAP_DrawMapMarkers(), MAP_DrawMapOneMission(), MP_LoadTeamMultiplayer(), MP_MultiplayerTeamSlotComments_f(), MP_UpdateMenuParameters_f(), PR_AircraftInfo(), PR_DisassemblyInfo(), PR_ItemProductionInfo(), PR_ProductionInfo(), PR_ProductionList_f(), PR_ProductionType_f(), R_InitPrograms(), R_VerifyDriver(), RS_InitGUI(), RS_UpdateInfo(), SAV_GameSaveNameCleanup_f(), SCR_SetLoadingBackground(), SEQ_ExecuteMusic(), SV_GetCvarToken(), SV_Init(), SV_InitGameProgs(), SV_NextMapcycle(), SV_SetMaster_f(), TR_Init_f(), TR_TransferBaseSelect(), UI_EditorNodeSelectNode(), UI_InitStack(), UI_MapInfo(), UI_MaterialEditorUpdate(), UI_Popup(), UI_PopupButton(), UI_PopupList(), UI_SetCvar(), UI_Translate_f(), UP_AircraftDescription(), UP_AircraftItemDescription(), UP_Article(), UP_BuildingDescription(), UP_ChangeDisplay(), UP_DisplayTechTree(), UP_DrawAssociatedAmmo(), UP_GenerateSummary(), UP_GetUnreadMails(), UP_InitStartup(), UP_SetAllMailsRead_f(), UP_SetMailButtons_f(), UP_SetMailHeader(), UP_UGVDescription(), UR_DialogInit_f(), UR_DialogInitStore_f(), and UR_DialogSelectSellNation_f().
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 128 of file cvar.c.
References check, cvar_s::check, Com_Printf(), Cvar_FindVar(), qfalse, and qtrue.
Referenced by 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 696 of file cvar.c.
References Com_sprintf(), and Cvar_Set().
Referenced by AC_UpdateMenu(), AIR_AircraftSelect(), AIR_DeleteAircraft(), B_BaseInit_f(), B_InitCallbacks(), B_MakeBaseMapShot_f(), B_SetCurrentSelectedBase(), B_UpdateBaseCount(), CL_ActorEquipmentSelect_f(), CL_ActorSelectList(), CL_CameraRoute(), CL_ChangeSkin_f(), CL_GameAutoGo(), CL_LevelDown_f(), CL_LevelUp_f(), CL_ParseTeamInfoMessage(), CL_TeamNum_f(), CL_UpdateTime(), CL_ViewCenterAtGridPosition(), Com_DeveloperSet_f(), CP_CampaignInit(), CP_CheckLostCondition(), CP_SetMissionVars(), CP_StartSelectedMission(), CP_UpdateXVIMapButton(), Cvar_Add_f(), Cvar_AssertValue(), Cvar_Mod_f(), E_EmployeeSelect(), E_UpdateGUICount_f(), GAME_MP_StartServer_f(), GAME_SK_SetMissionParameters(), HOS_EmployeeInit_f(), HUD_Update(), HUD_UpdateActorCvar(), HUD_UpdateAllActors(), IN_Frame(), INS_BuildInstallation_f(), INS_InitCallbacks(), INS_UpdateInsatallationLimit_f(), INV_UpdateObject_f(), LE_CenterView(), PR_ProductionIncrease_f(), PR_ProductionInfo(), PR_ProductionList_f(), R_BeginFrame(), R_CvarCheckDynamicLights(), R_CvarCheckLights(), R_CvarCheckMaxLightmap(), R_CvarPostProcess(), R_CvarPrograms(), R_InitExtensions(), R_SetMode(), R_SphereInit(), R_VerifyDriver(), RS_InitGUI(), RS_UpdateInfo(), SCR_TouchPics(), SP_worldspawn(), SV_Map_f(), Sys_SetAffinityAndPriority(), TR_Init_f(), TR_TransferBaseSelect(), UI_GenAllRadarMap(), UI_InvalidateStack(), UI_Modify_f(), UI_ModifyWrap_f(), UI_SetCvar(), UP_Article(), UP_ChangeDisplay(), UP_MailClientClick_f(), and UR_DialogInit_f().
void Cvar_Shutdown | ( | void | ) |
Definition at line 1125 of file cvar.c.
Referenced by 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 499 of file cvar.c.
References cvar_s::changeListener, Com_Printf(), Cvar_FindVar(), cvarListener_s::exec, Mem_Free, and cvarListener_s::next.
void Cvar_UpdateLatchedVars | ( | void | ) |
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 712 of file cvar.c.
References cvar_s::integer, cvar_s::latchedString, cvar_s::next, cvar_s::oldString, cvar_s::string, and cvar_s::value.
Referenced by SV_InitGame().
const char* Cvar_Userinfo | ( | void | ) |
returns an info string containing all the CVAR_USERINFO cvars
Definition at line 983 of file cvar.c.
References Cvar_BitInfo(), and CVAR_USERINFO.
Referenced by CL_Connect(), CL_SendChangedUserinfos(), and CL_UserInfo_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 253 of file cvar.c.
References Cvar_FindVar(), and cvar_s::oldString.
Referenced by GAME_MP_InitStartup().