diff --git a/src/anm2/anm2.cpp b/src/anm2/anm2.cpp index 4e040ad..7a78b79 100644 --- a/src/anm2/anm2.cpp +++ b/src/anm2/anm2.cpp @@ -23,7 +23,7 @@ namespace anm2ed::anm2 { XMLDocument document; - if (document.LoadFile(path.c_str()) != XML_SUCCESS) + if (document.LoadFile(path.string().c_str()) != XML_SUCCESS) { if (errorString) *errorString = document.ErrorStr(); return; @@ -56,7 +56,7 @@ namespace anm2ed::anm2 XMLDocument document; document.InsertFirstChild(to_element(document)); - if (document.SaveFile(path.c_str()) != XML_SUCCESS) + if (document.SaveFile(path.string().c_str()) != XML_SUCCESS) { if (errorString) *errorString = document.ErrorStr(); return false; diff --git a/src/anm2/anm2_sounds.cpp b/src/anm2/anm2_sounds.cpp index 2b46925..ac25f02 100644 --- a/src/anm2/anm2_sounds.cpp +++ b/src/anm2/anm2_sounds.cpp @@ -22,8 +22,8 @@ namespace anm2ed::anm2 labels.emplace_back(localize.get(BASIC_NONE)); for (auto& [id, sound] : content.sounds) { - auto pathCStr = sound.path.c_str(); - labels.emplace_back(std::vformat(localize.get(FORMAT_SOUND), std::make_format_args(id, pathCStr))); + auto pathString = sound.path.string(); + labels.emplace_back(std::vformat(localize.get(FORMAT_SOUND), std::make_format_args(id, pathString))); } return labels; } diff --git a/src/anm2/anm2_spritesheets.cpp b/src/anm2/anm2_spritesheets.cpp index f351d46..93972e8 100644 --- a/src/anm2/anm2_spritesheets.cpp +++ b/src/anm2/anm2_spritesheets.cpp @@ -41,8 +41,8 @@ namespace anm2ed::anm2 labels.emplace_back(localize.get(BASIC_NONE)); for (auto& [id, spritesheet] : content.spritesheets) { - auto pathCStr = spritesheet.path.c_str(); - labels.emplace_back(std::vformat(localize.get(FORMAT_SPRITESHEET), std::make_format_args(id, pathCStr))); + auto pathString = spritesheet.path.string(); + labels.emplace_back(std::vformat(localize.get(FORMAT_SPRITESHEET), std::make_format_args(id, pathString))); } return labels; } diff --git a/src/dialog.cpp b/src/dialog.cpp index 81c0949..b32f8ac 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -61,7 +61,7 @@ namespace anm2ed void Dialog::file_explorer_open(const std::filesystem::path& path) { #ifdef _WIN32 - ShellExecuteA(NULL, "open", path.c_str(), NULL, NULL, SW_SHOWNORMAL); + ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWNORMAL); #elif __unix__ system(std::format("xdg-open \"{}\" &", path.c_str()).c_str()); #else diff --git a/src/imgui/taskbar.cpp b/src/imgui/taskbar.cpp index 57ce9c3..069d486 100644 --- a/src/imgui/taskbar.cpp +++ b/src/imgui/taskbar.cpp @@ -745,7 +745,7 @@ namespace anm2ed::imgui if (dialog.is_selected(dialog::FFMPEG_PATH_SET)) { - ffmpegPath = dialog.path; + ffmpegPath = dialog.path.string(); dialog.reset(); } @@ -763,7 +763,7 @@ namespace anm2ed::imgui if (dialog.is_selected(dialogType)) { - path = dialog.path; + path = dialog.path.string(); dialog.reset(); } diff --git a/src/imgui/window/sounds.cpp b/src/imgui/window/sounds.cpp index 993b6de..a9c8854 100644 --- a/src/imgui/window/sounds.cpp +++ b/src/imgui/window/sounds.cpp @@ -210,7 +210,7 @@ namespace anm2ed::imgui bool isValid = sound.is_valid(); auto& soundIcon = isValid ? resources.icons[icon::SOUND] : resources.icons[icon::NONE]; auto tintColor = !isValid ? ImVec4(1.0f, 0.25f, 0.25f, 1.0f) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); - auto pathCStr = sound.path.c_str(); + auto pathCStr = sound.path.string().c_str(); ImGui::SetNextItemSelectionUserData(id); ImGui::SetNextItemStorageID(id); @@ -236,7 +236,7 @@ namespace anm2ed::imgui if (ImGui::BeginItemTooltip()) { ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE); - ImGui::TextUnformatted(sound.path.c_str()); + ImGui::TextUnformatted(pathCStr); ImGui::PopFont(); ImGui::Text("%s: %d", localize.get(BASIC_ID), id); if (!isValid) diff --git a/src/loader.cpp b/src/loader.cpp index 32dc249..5ec1c20 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -210,7 +210,7 @@ namespace anm2ed ImGui::GetStyle().FontScaleMain = settings.uiScale; io.ConfigWindowsMoveFromTitleBarOnly = true; - ImGui::LoadIniSettingsFromDisk(settings_path().c_str()); + ImGui::LoadIniSettingsFromDisk(settings_path().string().c_str()); if (isSocketThread) { diff --git a/src/resource/texture.cpp b/src/resource/texture.cpp index 9d8c66b..13d7d79 100644 --- a/src/resource/texture.cpp +++ b/src/resource/texture.cpp @@ -116,7 +116,7 @@ namespace anm2ed::resource Texture::Texture(const std::filesystem::path& pngPath) { - if (const uint8_t* data = stbi_load(pngPath.c_str(), &size.x, &size.y, nullptr, CHANNELS); data) + if (const uint8_t* data = stbi_load(pngPath.string().c_str(), &size.x, &size.y, nullptr, CHANNELS); data) { upload(data); stbi_image_free((void*)data); @@ -125,7 +125,7 @@ namespace anm2ed::resource bool Texture::write_png(const std::filesystem::path& path) { - return stbi_write_png(path.c_str(), size.x, size.y, CHANNELS, this->pixels.data(), size.x * CHANNELS); + return stbi_write_png(path.string().c_str(), size.x, size.y, CHANNELS, this->pixels.data(), size.x * CHANNELS); } vec4 Texture::pixel_read(vec2 position) const diff --git a/src/settings.h b/src/settings.h index d414f40..300345c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include