============================================================================== 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
| 335 | // |
| 336 | //============================================================================== |
| 337 | void 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 |
no test coverage detected