| 828 | } |
| 829 | |
| 830 | static Result CheckAndGetResourceTypeFromPath(HFactory factory, const char* canonical_path, HResourceType* resource_type_out) |
| 831 | { |
| 832 | const char* ext = GetExtFromPath(canonical_path); |
| 833 | |
| 834 | if (!ext) |
| 835 | { |
| 836 | dmLogWarning("Unable to load resource: '%s'. Missing file extension.", canonical_path); |
| 837 | return RESULT_MISSING_FILE_EXTENSION; |
| 838 | } |
| 839 | |
| 840 | ResourceType* resource_type = FindResourceType(factory, ext); |
| 841 | if (resource_type == 0) |
| 842 | { |
| 843 | dmLogError("Unknown resource type: %s", ext); |
| 844 | return RESULT_UNKNOWN_RESOURCE_TYPE; |
| 845 | } |
| 846 | |
| 847 | *resource_type_out = resource_type; |
| 848 | |
| 849 | return RESULT_OK; |
| 850 | } |
| 851 | |
| 852 | // Assumes m_LoadMutex is already held |
| 853 | static Result CheckAndGetResourceAndType(HFactory factory, const char* canonical_path, dmhash_t canonical_path_hash, void** resource_out, HResourceType* resource_type_out) |
no test coverage detected