MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / load

Method load

Source/Cache/TextureCache.cpp:176–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176Texture2D* TextureCache::load(String filename) {
177 std::string fullPath = SharedContent.getFullPath(filename);
178 auto it = _textures.find(fullPath);
179 if (it != _textures.end()) {
180 return it->second;
181 }
182 auto data = SharedContent.load(filename);
183 if (data.second == 0) {
184 Error("failed to load texture \"{}\"", filename.toString());
185 return nullptr;
186 }
187 return update(filename, data.first.get(), data.second);
188}
189
190void TextureCache::loadAsync(String filename, const std::function<void(Texture2D*)>& handler) {
191 std::string fullPath = SharedContent.getFullPath(filename);

Callers

nothing calls this directly

Calls 8

getFullPathMethod · 0.80
findMethod · 0.65
loadMethod · 0.65
toStringMethod · 0.65
getMethod · 0.65
ErrorEnum · 0.50
updateFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected