/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. Copyright (C) 2013 - 2015, OpenJK contributors This file is part of the OpenJK source code. OpenJK is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . =========================================================================== */ #include "cg_local.h" // // Cvar callbacks // static void CG_SVRunningChange( void ) { cgs.localServer = sv_running.integer; } static void CG_ForceModelChange( void ) { int i; for ( i=0; i 0 && cgs.gametype >= GT_SINGLE_PLAYER) trap->Cvar_Set( "teamoverlay", "1" ); else trap->Cvar_Set( "teamoverlay", "0" ); } // // Cvar table // typedef struct cvarTable_s { vmCvar_t *vmCvar; char *cvarName; char *defaultString; void (*update)( void ); uint32_t cvarFlags; } cvarTable_t; #define XCVAR_DECL #include "cg_xcvar.h" #undef XCVAR_DECL static const cvarTable_t cvarTable[] = { #define XCVAR_LIST #include "cg_xcvar.h" #undef XCVAR_LIST }; static const size_t cvarTableSize = ARRAY_LEN( cvarTable ); void CG_RegisterCvars( void ) { size_t i = 0; const cvarTable_t *cv = NULL; for ( i=0, cv=cvarTable; iCvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags ); if ( cv->update ) cv->update(); } } void CG_UpdateCvars( void ) { size_t i = 0; const cvarTable_t *cv = NULL; for ( i=0, cv=cvarTable; ivmCvar ) { int modCount = cv->vmCvar->modificationCount; trap->Cvar_Update( cv->vmCvar ); if ( cv->vmCvar->modificationCount != modCount ) { if ( cv->update ) cv->update(); } } } }