| 206 | } |
| 207 | |
| 208 | const void *ResourceManager::get(StringId64 type, StringId64 name) |
| 209 | { |
| 210 | CE_ASSERT(can_get(type, name), "Resource not loaded: " RESOURCE_ID_FMT, resource_id(type, name)._id); |
| 211 | |
| 212 | const ResourcePair id = { type, name }; |
| 213 | |
| 214 | if (_autoload && !hash_map::has(_resources, id)) { |
| 215 | while (!try_load(PACKAGE_RESOURCE_NONE, type, name, 0)) { |
| 216 | complete_requests(); |
| 217 | } |
| 218 | |
| 219 | while (!hash_map::has(_resources, id)) { |
| 220 | complete_requests(); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | return hash_map::get(_resources, id, ResourceData::NOT_FOUND).data; |
| 225 | } |
| 226 | |
| 227 | File *ResourceManager::open_stream(StringId64 type, StringId64 name) |
| 228 | { |