MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / load

Method load

engine/Poseidon/World/Model/ModelCache.cpp:35–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35std::shared_ptr<Poseidon::Model::Model> ModelCache::load(const std::string& filePath)
36{
37 _stats.totalLoads++;
38
39 std::string key = normalizePath(filePath);
40
41 auto it = _cache.find(key);
42 if (it != _cache.end())
43 {
44 _stats.cacheHits++;
45 return it->second;
46 }
47
48 _stats.cacheMisses++;
49
50 auto model = loadFromFile(filePath);
51 if (!model)
52 {
53 _stats.loadFailures++;
54 return nullptr;
55 }
56
57 _cache[key] = model;
58 _stats.cachedModels = _cache.size();
59 return model;
60}
61
62std::shared_ptr<Poseidon::Model::Model> ModelCache::loadFromFile(const std::string& filePath)
63{

Callers 15

NewMethod · 0.45
ThinkMasterServerBrowserFunction · 0.45
StopMethod · 0.45
WorkerLoopMethod · 0.45
HandleClientMethod · 0.45
IsRunningMethod · 0.45
IsExitRequestedMethod · 0.45
IsEnabledFunction · 0.45
PushCompleteFunction · 0.45
PushBeginFunction · 0.45
PushEndFunction · 0.45
PushCounterFunction · 0.45

Calls 2

normalizePathFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected