MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / load

Method load

src/Engine/Sound.cpp:48–60  ·  view source on GitHub ↗

* Loads a sound file from a specified filename. * @param filename Filename of the sound file. */

Source from the content-addressed store, hash-verified

46 * @param filename Filename of the sound file.
47 */
48void Sound::load(const std::string &filename)
49{
50 // SDL only takes UTF-8 filenames
51 // so here's an ugly hack to match this ugly reasoning
52 std::string utf8 = Language::wstrToUtf8(Language::fsToWstr(filename));
53
54 _sound = Mix_LoadWAV(utf8.c_str());
55 if (_sound == 0)
56 {
57 std::string err = filename + ":" + Mix_GetError();
58 throw Exception(err);
59 }
60}
61
62/**
63 * Loads a sound file from a specified memory chunk.

Callers

nothing calls this directly

Calls 1

ExceptionClass · 0.85

Tested by

no test coverage detected