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

Method load

src/Engine/Music.cpp:52–65  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

50 * @param filename Filename of the music file.
51 */
52void Music::load(const std::string &filename)
53{
54#ifndef __NO_MUSIC
55 // SDL only takes UTF-8 filenames
56 // so here's an ugly hack to match this ugly reasoning
57 std::string utf8 = Language::wstrToUtf8(Language::fsToWstr(filename));
58
59 _music = Mix_LoadMUS(utf8.c_str());
60 if (_music == 0)
61 {
62 throw Exception(Mix_GetError());
63 }
64#endif
65}
66
67/**
68 * Loads a music file from a specified memory chunk.

Callers

nothing calls this directly

Calls 1

ExceptionClass · 0.85

Tested by

no test coverage detected