diff options
| author | iamgoofball <iamgoofball@gmail.com> | 2019-01-19 21:01:19 -0800 |
|---|---|---|
| committer | iamgoofball <iamgoofball@gmail.com> | 2019-01-19 21:01:19 -0800 |
| commit | 10436992148e2342e6bd563d1acfb684f225aa30 (patch) | |
| tree | 466e25514efc1b53bf22b3c6ed3d6ab58f391fd9 /src/path_functions.cpp | |
| parent | c44832a707f655191e4337e3b3fc567ff02636eb (diff) | |
Suffix-independent Music, Mod Music List, looping bugfixes, easter eggs, etc.
Diffstat (limited to 'src/path_functions.cpp')
| -rw-r--r-- | src/path_functions.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/path_functions.cpp b/src/path_functions.cpp index c51cfde3..92ff765b 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -94,11 +94,28 @@ QString AOApplication::get_sounds_path(QString p_file) QString AOApplication::get_music_path(QString p_song) { - QString path = get_base_path() + "sounds/music/" + p_song; + QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; + QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; + if (file_exists(opus_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return get_base_path() + "sounds/music/" + p_song + ".opus"; + #else + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".opus"); + #endif + } + else if (file_exists(mp3_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return get_base_path() + "sounds/music/" + p_song + ".mp3"; + #else + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".mp3"); + #endif + } #ifndef CASE_SENSITIVE_FILESYSTEM - return path; + return get_base_path() + "sounds/music/" + p_song + ".wav"; #else - return get_case_sensitive_path(path); + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".wav"); #endif } |
