| 1398 | } |
| 1399 | |
| 1400 | Result GetDescriptorWithExt(HFactory factory, uint64_t hashed_name, const uint64_t* exts, uint32_t ext_count, HResourceDescriptor* descriptor) |
| 1401 | { |
| 1402 | ResourceDescriptor* tmp_descriptor = factory->m_Resources->Get(hashed_name); |
| 1403 | if (!tmp_descriptor) { |
| 1404 | return RESULT_NOT_LOADED; |
| 1405 | } |
| 1406 | |
| 1407 | ResourceType* type = (ResourceType*) tmp_descriptor->m_ResourceType; |
| 1408 | bool ext_match = ext_count == 0; |
| 1409 | if (!ext_match) { |
| 1410 | for (uint32_t i = 0; i < ext_count; ++i) { |
| 1411 | if (type->m_ExtensionHash == exts[i]) { |
| 1412 | ext_match = true; |
| 1413 | break; |
| 1414 | } |
| 1415 | } |
| 1416 | } |
| 1417 | if (ext_match) { |
| 1418 | *descriptor = tmp_descriptor; |
| 1419 | return RESULT_OK; |
| 1420 | } else { |
| 1421 | return RESULT_INVALID_FILE_EXTENSION; |
| 1422 | } |
| 1423 | } |
| 1424 | |
| 1425 | void IncRef(HFactory factory, HResourceDescriptor rd) |
| 1426 | { |