//----------------------------------------------------------------------------- // Invokes a method on all installed game systems in proper order //----------------------------------------------------------------------------- void InvokePerFrameMethod( PerFrameGameSystemFunc_t f, char const *timed /*=0*/ ) { #if defined( _XBOX ) #if !defined( _RETAIL ) char sz[ 128 ]; #endif #else NOTE_UNUSED( timed ); #endif int i; int c = s_GameSystemsPerFrame.Count(); for ( i = 0; i < c ; ++i ) { IGameSystemPerFrame *sys = s_GameSystemsPerFrame[i]; MDLCACHE_CRITICAL_SECTION(); #if !defined( _RETAIL ) #if defined( _XBOX ) if ( timed ) { Q_snprintf( sz, sizeof( sz ), "%s->%s():Start", sys->Name(), timed ); XBX_rTimeStampLog( Plat_FloatTime(), sz ); } #endif #endif (sys->*f)(); #if !defined( _RETAIL ) #if defined( _XBOX ) if ( timed ) { Q_snprintf( sz, sizeof( sz ), "%s->%s():Finish", sys->Name(), timed ); XBX_rTimeStampLog( Plat_FloatTime(), sz ); } #endif #endif } }
//----------------------------------------------------------------------------- // Invokes a method on all installed game systems in proper order //----------------------------------------------------------------------------- void InvokePerFrameMethod( PerFrameGameSystemFunc_t f, char const *timed /*=0*/ ) { NOTE_UNUSED( timed ); int i; int c = s_GameSystemsPerFrame.Count(); for ( i = 0; i < c ; ++i ) { IGameSystemPerFrame *sys = s_GameSystemsPerFrame[i]; #if (VPROF_LEVEL > 0) && defined(VPROF_ACCOUNT_GAMESYSTEMS) // make sure each game system is individually attributed // because vprof nodes must really be constructed with a pointer to a static // string, we can't create a temporary char[] here and sprintf a distinctive // V_snprintf( buf, 63, "gamesys_preframe_%s", sys->Name() ). We'll have to // settle for just the system name, and distinguish between pre and post frame // in hierarchy. VPROF( sys->Name() ); #endif MDLCACHE_CRITICAL_SECTION(); (sys->*f)(); } }