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

Function ValidateResourceType

engine/resource/src/resource.cpp:450–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450Result ValidateResourceType(HResourceType type)
451{
452 // Dots not allowed in extension
453 if (strrchr(type->m_Extension, '.') != 0)
454 {
455 dmLogError("No '.' is allowed for the resource type '%s'", type->m_Extension);
456 return RESULT_INVAL;
457 }
458
459 if (type->m_CreateFunction == 0 || type->m_DestroyFunction == 0)
460 {
461 dmLogError("Missing create or destroy function for resource type '%s'", type->m_Extension);
462 return RESULT_INVAL;
463 }
464
465 return RESULT_OK;
466}
467
468HResourceType FindResourceTypeByHash(HResourceFactory factory, dmhash_t extension_hash)
469{

Callers 3

RegisterTypesFunction · 0.85
RegisterTypeFunction · 0.85
SetupTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected