MCPcopy Create free account
hub / github.com/Svxy/The-Simpsons-Hit-and-Run / LoadSync

Method LoadSync

game/code/loading/loadingmanager.cpp:337–376  ·  view source on GitHub ↗

============================================================================== LoadingManager::LoadSync ============================================================================== Description: Load a file synchronously. Parameters: handlerType - an enumeration is used to specify which file handler to use for loading and processing the data (the use of an enumeration keeps the clients of Load

Source from the content-addressed store, hash-verified

335//
336//==============================================================================
337void LoadingManager::LoadSync
338(
339 FileHandlerEnum handlerType,
340 const char* filename,
341 GameMemoryAllocator heap,
342 const char* sectionName
343)
344{
345 rReleasePrintf("\n\n!!!!!! TRC VIOLATION, USE ASYNC!!!!!!!\n\n");
346// rAssert( false );
347
348 unsigned int startTime = radTimeGetMilliseconds();
349
350 if ( !(CommandLineOptions::Get( CLO_NO_LOADING_SPEW )) )
351 {
352 rDebugPrintf( "<<START>> Sync Loading: %s\n", filename );
353 }
354
355
356 HeapMgr()->PushHeap( GMA_TEMP );
357 FileHandler* pHandler = FileHandlerFactory::CreateFileHandler( handlerType, sectionName );
358
359 HeapMgr()->PopHeap( GMA_TEMP );
360 pHandler->AddRef( );
361 rAssert( pHandler );
362
363 HeapMgr()->PushHeap( heap );
364 pHandler->LoadFileSync( filename );
365 HeapMgr()->PopHeap( heap );
366
367 pHandler->Release( );
368 pHandler = 0;
369
370 if ( !(CommandLineOptions::Get( CLO_NO_LOADING_SPEW )) )
371 {
372 rReleasePrintf( "<< END >> Sync Loading: %s (%u msecs)\n",
373 filename,
374 radTimeGetMilliseconds() - startTime );
375 }
376}
377
378//=============================================================================
379// LoadingManager::CancelPendingRequests

Callers 5

ExecuteScriptSyncMethod · 0.80
UpdateMethod · 0.80
LoadAllNeededDataMethod · 0.80
HandleEventMethod · 0.80

Calls 7

HeapMgrFunction · 0.85
PushHeapMethod · 0.80
PopHeapMethod · 0.80
GetFunction · 0.50
AddRefMethod · 0.45
LoadFileSyncMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected