diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-04-04 20:45:13 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-04-04 20:45:13 +0000 |
commit | 22fd6efeeb7ee918e0d1ffb75f6292077ce27816 (patch) | |
tree | 7b355fc4aa8a7c63aac93af54fb229f678ef552c /source/sv_game.c | |
parent | 7ec50f12252b4dfb97f3249ccf05a771b98785c1 (diff) |
Added support for drawing colored text via `draw' client command.
Cvar_Get now resets user defined cvar values for read-only cvars.
Sever and game DLL features are now advertised via cvars instead of exports.
Diffstat (limited to 'source/sv_game.c')
-rw-r--r-- | source/sv_game.c | 65 |
1 files changed, 12 insertions, 53 deletions
diff --git a/source/sv_game.c b/source/sv_game.c index 21aeceb..a0e854a 100644 --- a/source/sv_game.c +++ b/source/sv_game.c @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sv_local.h" game_export_t *ge; -int gameFeatures; /* ================ @@ -733,14 +732,14 @@ static void PF_AddCommandString( const char *string ) { static void PF_SetAreaPortalState( int portalnum, qboolean open ) { if( !sv.cm.cache ) { - Com_Error( ERR_DROP, "PF_SetAreaPortalState: no map loaded" ); + Com_Error( ERR_DROP, "%s: no map loaded", __func__ ); } CM_SetAreaPortalState( &sv.cm, portalnum, open ); } static qboolean PF_AreasConnected( int area1, int area2 ) { if( !sv.cm.cache ) { - Com_Error( ERR_DROP, "PF_AreasConnected: no map loaded" ); + Com_Error( ERR_DROP, "%s: no map loaded", __func__ ); } return CM_AreasConnected( &sv.cm, area1, area2 ); } @@ -757,45 +756,21 @@ Called when either the entire server is being killed, or it is changing to a different game directory. =============== */ -void SV_ShutdownGameProgs (void) -{ - if (!ge) - return; - ge->Shutdown (); - ge = NULL; - gameFeatures = 0; +void SV_ShutdownGameProgs (void) { + if( ge ) { + ge->Shutdown(); + ge = NULL; + } if( game_library ) { Sys_FreeLibrary( game_library ); game_library = NULL; } + if( g_features ) { + Cvar_SetByVar( g_features, NULL, CVAR_SET_DIRECT ); + g_features->flags = CVAR_USER_CREATED; + } } -#if 0 -static qboolean SV_GameSetupCallback( api_type_t type, void *api ) { - switch( type ) { - case API_CMD: - Cmd_FillAPI( ( cmdAPI_t * )api ); - break; - case API_CVAR: - Cvar_FillAPI( ( cvarAPI_t * )api ); - break; - case API_FS: - FS_FillAPI( ( fsAPI_t * )api ); - break; - case API_COMMON: - Com_FillAPI( ( commonAPI_t * )api ); - break; - case API_SYSTEM: - Sys_FillAPI( ( sysAPI_t * )api ); - break; - default: - Com_Error( ERR_FATAL, "SV_GameSetupCallback: bad api type" ); - } - - return qtrue; -} -#endif - /* =============== SV_InitGameProgs @@ -803,18 +778,10 @@ SV_InitGameProgs Init the game subsystem for a new map =============== */ -void SCR_DebugGraph (float value, int color); - -void SV_InitGameProgs ( void ) -{ +void SV_InitGameProgs ( void ) { game_import_t import; char path[MAX_OSPATH]; game_export_t *(*entry)( game_import_t * ) = NULL; - int (*ggf)( int ); - /*moduleEntry_t moduleEntry; - moduleInfo_t info; - moduleCapability_t caps; - APISetupCallback_t callback;*/ // unload anything we have now SV_ShutdownGameProgs (); @@ -927,14 +894,6 @@ void SV_InitGameProgs ( void ) ge->apiversion, GAME_API_VERSION); } - // get features - ggf = Sys_GetProcAddress( game_library, "GetGameFeatures" ); - if( ggf ) { - gameFeatures = ggf( GAME_FEATURE_CLIENTNUM|GAME_FEATURE_MVDSPEC ); - } else { - gameFeatures = 0; - } - // initialize ge->Init (); |