| 183 | } |
| 184 | |
| 185 | WaveStream* OGGLoadFile(const char* name) |
| 186 | { |
| 187 | QIFStream in; |
| 188 | GFileServer->Open(in, name); |
| 189 | if (in.fail() || in.eof()) |
| 190 | { |
| 191 | return nullptr; |
| 192 | } |
| 193 | |
| 194 | if (in.rest() <= 0) |
| 195 | { |
| 196 | return nullptr; |
| 197 | } |
| 198 | |
| 199 | WaveStreamOGG* ret = new WaveStreamOGG(in); |
| 200 | if (ret->GetError()) |
| 201 | { |
| 202 | delete ret; |
| 203 | return nullptr; |
| 204 | } |
| 205 | return ret; |
| 206 | } |
| 207 | |
| 208 | } // namespace Poseidon |