MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / get

Function get

TheForceEngine/TFE_Asset/vocAsset.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 }
45
46 SoundBuffer* get(const char* name)
47 {
48 VocMap::iterator iVoc = s_vocAssets.find(name);
49 if (iVoc != s_vocAssets.end())
50 {
51 return iVoc->second;
52 }
53
54 if (!loadSoundFile(name))
55 {
56 return nullptr;
57 }
58
59 SoundBuffer* voc = new SoundBuffer;
60 if (!parseVoc(voc))
61 {
62 delete voc;
63 return nullptr;
64 }
65
66 s_vocAssets[name] = voc;
67 voc->id = (u32)s_vocAssetList.size();
68 s_vocAssetList.push_back(voc);
69 return voc;
70 }
71
72 void freeAll()
73 {

Callers

nothing calls this directly

Calls 5

loadSoundFileFunction · 0.85
parseVocFunction · 0.85
push_backMethod · 0.80
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected