MCPcopy Create free account
hub / github.com/crownengine/crown / get

Method get

src/resource/resource_manager.cpp:208–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208const 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
227File *ResourceManager::open_stream(StringId64 type, StringId64 name)
228{

Callers 5

loadMethod · 0.45
onlineFunction · 0.45
offlineFunction · 0.45
onlineFunction · 0.45
offlineFunction · 0.45

Calls 3

resource_idFunction · 0.85
getFunction · 0.85
hasFunction · 0.50

Tested by

no test coverage detected