Commit 51af1288 authored by nanahira's avatar nanahira Committed by GitHub

add utf8 decode back

parent 5dd3539f
...@@ -267,7 +267,13 @@ void SoundManager::PlayMusic(char* song, bool loop) { ...@@ -267,7 +267,13 @@ void SoundManager::PlayMusic(char* song, bool loop) {
StopBGM(); StopBGM();
#ifdef YGOPRO_USE_MINIAUDIO #ifdef YGOPRO_USE_MINIAUDIO
strcpy(currentPlayingMusic, song); strcpy(currentPlayingMusic, song);
#ifdef _WIN32
wchar_t song_w[1024];
BufferIO::DecodeUTF8(song, song_w);
ma_sound_init_from_file_w(&engineMusic, song_w, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#else
ma_sound_init_from_file(&engineMusic, song, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM); ma_sound_init_from_file(&engineMusic, song, MA_SOUND_FLAG_ASYNC | MA_SOUND_FLAG_STREAM, nullptr, nullptr, &soundBGM);
#endif
ma_sound_set_looping(&soundBGM, loop); ma_sound_set_looping(&soundBGM, loop);
ma_sound_start(&soundBGM); ma_sound_start(&soundBGM);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment