| 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 | { |
nothing calls this directly
no test coverage detected