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

Method LoadFile

game/code/loading/p3dfilehandler.cpp:80–103  ·  view source on GitHub ↗

============================================================================== P3DFileHandler::LoadFile ============================================================================== Description: Load a Pure3D file asynchronously. Parameters: filename - fully qualified path and filename pCallback - client callback to invoke when load is complete pUserData - optional client supplied user data R

Source from the content-addressed store, hash-verified

78//
79//==============================================================================
80void P3DFileHandler::LoadFile
81(
82 const char* filename,
83 FileHandler::LoadFileCallback* pCallback,
84 void* pUserData,
85 GameMemoryAllocator heap
86)
87{
88 rAssert( filename );
89 rAssert( pCallback );
90
91 mpCallback = pCallback;
92 mpUserData = pUserData;
93
94 //
95 // Ensure that the specified inventory section exists before loading
96 //
97 HeapMgr()->PushHeap (heap);
98 HeapMgr()->PushHeap (GMA_TEMP);
99 p3d::inventory->AddSection( mcSectionName );
100 HeapMgr()->PopHeap (GMA_TEMP);
101 p3d::loadAsync( filename, mcSectionName, this, pUserData, heap );
102 HeapMgr()->PopHeap (heap);
103}
104
105
106//==============================================================================

Callers 1

ProcessNextRequestMethod · 0.45

Calls 3

HeapMgrFunction · 0.85
PushHeapMethod · 0.80
PopHeapMethod · 0.80

Tested by

no test coverage detected