MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / compileReferencedAssets

Method compileReferencedAssets

Engine/source/assets/assetManager.cpp:140–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138//-----------------------------------------------------------------------------
139
140bool AssetManager::compileReferencedAssets( ModuleDefinition* pModuleDefinition )
141{
142 // Debug Profiling.
143 PROFILE_SCOPE(AssetManager_CompileReferencedAsset);
144
145 // Sanity!
146 AssertFatal( pModuleDefinition != NULL, "Cannot add declared assets using a NULL module definition" );
147
148 // Clear referenced assets.
149 mReferencedAssets.clear();
150
151 // Iterate the module definition children.
152 for( SimSet::iterator itr = pModuleDefinition->begin(); itr != pModuleDefinition->end(); ++itr )
153 {
154 // Fetch the referenced assets.
155 ReferencedAssets* pReferencedAssets = dynamic_cast<ReferencedAssets*>( *itr );
156
157 // Skip if it's not a referenced assets location.
158 if ( pReferencedAssets == NULL )
159 continue;
160
161 // Expand asset manifest location.
162 char filePathBuffer[1024];
163 dSprintf( filePathBuffer, sizeof(filePathBuffer), "%s/%s", pModuleDefinition->getModulePath(), pReferencedAssets->getPath() );
164
165 // Scan referenced assets at location.
166 if ( !scanReferencedAssets( filePathBuffer, pReferencedAssets->getExtension(), pReferencedAssets->getRecurse() ) )
167 {
168 // Warn.
169 Con::warnf( "AssetManager::compileReferencedAssets() - Could not scan for referenced assets at location '%s' with extension '%s'.", filePathBuffer, pReferencedAssets->getExtension() );
170 }
171 }
172
173 return true;
174}
175
176//-----------------------------------------------------------------------------
177

Callers 1

Calls 9

dSprintfFunction · 0.85
getModulePathMethod · 0.80
warnfFunction · 0.50
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getPathMethod · 0.45
getExtensionMethod · 0.45
getRecurseMethod · 0.45

Tested by

no test coverage detected