| 83 | } |
| 84 | |
| 85 | s32 getIndex(const char* name) |
| 86 | { |
| 87 | VocMap::iterator iVoc = s_vocAssets.find(name); |
| 88 | if (iVoc != s_vocAssets.end()) |
| 89 | { |
| 90 | return (s32)iVoc->second->id; |
| 91 | } |
| 92 | |
| 93 | // It doesn't exist yet, try to load the font. |
| 94 | if (!loadSoundFile(name)) |
| 95 | { |
| 96 | return -1; |
| 97 | } |
| 98 | |
| 99 | SoundBuffer* voc = new SoundBuffer; |
| 100 | if (!parseVoc(voc)) |
| 101 | { |
| 102 | delete voc; |
| 103 | return -1; |
| 104 | } |
| 105 | |
| 106 | s_vocAssets[name] = voc; |
| 107 | voc->id = (u32)s_vocAssetList.size(); |
| 108 | s_vocAssetList.push_back(voc); |
| 109 | return (s32)voc->id; |
| 110 | } |
| 111 | |
| 112 | SoundBuffer* getFromIndex(s32 index) |
| 113 | { |
nothing calls this directly
no test coverage detected