diff options
author | Andrey Nazarov <skuller@skuller.net> | 2010-02-23 17:54:26 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2010-02-23 17:54:26 +0000 |
commit | 5086b776608e5ae27714b87cce8c4fcc74ead201 (patch) | |
tree | 6a7c32bd877d603d6c1bc818f5e5f94711115f70 /source/cl_main.c | |
parent | 49d62599928630204e44d9ceb11d5a8a3fe88280 (diff) |
CVAR_FILES flag now applies only to files loaded by refresh.
Added ‘r_reload’ command to be used in place of ‘fs_restart’ to flush refresh model and texture caches.
Diffstat (limited to 'source/cl_main.c')
-rw-r--r-- | source/cl_main.c | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/source/cl_main.c b/source/cl_main.c index fd868da..3d20c05 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -2323,14 +2323,11 @@ void CL_RestartFilesystem( qboolean total ) { // switch back to original state cls.state = cls_state; + + cvar_modified &= ~CVAR_FILES; } -/* -==================== -CL_RestartRefresh -==================== -*/ -static void CL_RestartRefresh_f( void ) { +void CL_RestartRefresh( qboolean total ) { int cls_state; if( !cls.ref_initialized ) { @@ -2345,10 +2342,23 @@ static void CL_RestartRefresh_f( void ) { S_StopAllSounds(); - IN_Shutdown(); - CL_ShutdownRefresh(); - CL_InitRefresh(); - IN_Init(); + if( total ) { + IN_Shutdown(); + CL_ShutdownRefresh(); + CL_InitRefresh(); + IN_Init(); + } else { +#if USE_UI + UI_Shutdown(); +#endif + R_Shutdown( qfalse ); + R_Init( qfalse ); + SCR_RegisterMedia(); + Con_RegisterMedia(); +#if USE_UI + UI_Init(); +#endif + } #if USE_UI if( cls_state == ca_disconnected ) { @@ -2363,6 +2373,30 @@ static void CL_RestartRefresh_f( void ) { // switch back to original state cls.state = cls_state; + + cvar_modified &= ~CVAR_FILES; +} + +/* +==================== +CL_ReloadRefresh + +Flush caches and reload all models and textures. +==================== +*/ +static void CL_ReloadRefresh_f( void ) { + CL_RestartRefresh( qfalse ); +} + +/* +==================== +CL_RestartRefresh + +Perform complete restart of the renderer subsystem. +==================== +*/ +static void CL_RestartRefresh_f( void ) { + CL_RestartRefresh( qtrue ); } /* @@ -2462,6 +2496,7 @@ static const cmdreg_t c_client[] = { { "writeconfig", CL_WriteConfig_f, CL_WriteConfig_c }, // { "msgtab", CL_Msgtab_f, CL_Msgtab_g }, { "vid_restart", CL_RestartRefresh_f }, + { "r_reload", CL_ReloadRefresh_f }, // // forward to server commands |