MCPcopy Create free account
hub / github.com/defold/defold / GetResourceType

Function GetResourceType

engine/resource/src/resource_preloader.cpp:218–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 }
217
218 static HResourceType GetResourceType(HPreloader preloader, const char* path)
219 {
220 const char* ext = strrchr(path, '.');
221 if (!ext)
222 {
223 dmLogWarning("Unknown resource type: '%s'. Missing file extension.", path);
224 return 0;
225 }
226 else
227 {
228 HResourceType resource_type = FindResourceType(preloader->m_Factory, ext + 1);
229 if (resource_type)
230 {
231 assert(resource_type->m_CreateFunction);
232 return resource_type;
233 }
234 dmLogError("Unknown resource type: '%s'. Unknown resource type: %s", path, ext);
235 }
236 return 0;
237 }
238
239 Result MakePathDescriptor(ResourcePreloader* preloader, const char* name, PathDescriptor& out_path_descriptor)
240 {

Callers 1

MakePathDescriptorFunction · 0.85

Calls 2

FindResourceTypeFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected