mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-02-28 23:41:33 +01:00
Add explicity utf8 conversions on openFromFile SFML calls
This commit is contained in:
parent
ad48a4c11c
commit
b0da3382ec
@ -11,6 +11,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "al_check.hpp"
|
#include "al_check.hpp"
|
||||||
|
#include "utf8_strings.hpp"
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
@ -24,7 +25,7 @@ OpenMusic::OpenMusic(const std::filesystem::path& filename) :
|
|||||||
m_file(),
|
m_file(),
|
||||||
m_loopSpan(0, 0)
|
m_loopSpan(0, 0)
|
||||||
{
|
{
|
||||||
if (not openFromFile(filename)) {
|
if (not openFromFile(to_utf8_encoded_string(filename))) {
|
||||||
throw std::runtime_error("Could not open "+filename.string());
|
throw std::runtime_error("Could not open "+filename.string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,7 +42,7 @@ bool OpenMusic::openFromFile(const std::filesystem::path& filename) {
|
|||||||
stop();
|
stop();
|
||||||
|
|
||||||
// Open the underlying sound file
|
// Open the underlying sound file
|
||||||
if (!m_file.openFromFile(filename)) {
|
if (!m_file.openFromFile(to_utf8_encoded_string(filename))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1459,7 +1459,7 @@ void EditorState::reload_preview_audio() {
|
|||||||
|
|
||||||
const auto path = song_path->parent_path() / song.metadata.preview_file;
|
const auto path = song_path->parent_path() / song.metadata.preview_file;
|
||||||
preview_audio.emplace();
|
preview_audio.emplace();
|
||||||
if (not preview_audio->openFromFile(path.string())) {
|
if (not preview_audio->openFromFile(to_utf8_encoded_string(path))) {
|
||||||
preview_audio.reset();
|
preview_audio.reset();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user