windows fixes

This commit is contained in:
2025-12-12 23:17:06 -08:00
parent 94a3371509
commit 61275d9e75
9 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ namespace anm2ed::anm2
{ {
XMLDocument document; XMLDocument document;
if (document.LoadFile(path.c_str()) != XML_SUCCESS) if (document.LoadFile(path.string().c_str()) != XML_SUCCESS)
{ {
if (errorString) *errorString = document.ErrorStr(); if (errorString) *errorString = document.ErrorStr();
return; return;
@@ -56,7 +56,7 @@ namespace anm2ed::anm2
XMLDocument document; XMLDocument document;
document.InsertFirstChild(to_element(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(); if (errorString) *errorString = document.ErrorStr();
return false; return false;
+2 -2
View File
@@ -22,8 +22,8 @@ namespace anm2ed::anm2
labels.emplace_back(localize.get(BASIC_NONE)); labels.emplace_back(localize.get(BASIC_NONE));
for (auto& [id, sound] : content.sounds) for (auto& [id, sound] : content.sounds)
{ {
auto pathCStr = sound.path.c_str(); auto pathString = sound.path.string();
labels.emplace_back(std::vformat(localize.get(FORMAT_SOUND), std::make_format_args(id, pathCStr))); labels.emplace_back(std::vformat(localize.get(FORMAT_SOUND), std::make_format_args(id, pathString)));
} }
return labels; return labels;
} }
+2 -2
View File
@@ -41,8 +41,8 @@ namespace anm2ed::anm2
labels.emplace_back(localize.get(BASIC_NONE)); labels.emplace_back(localize.get(BASIC_NONE));
for (auto& [id, spritesheet] : content.spritesheets) for (auto& [id, spritesheet] : content.spritesheets)
{ {
auto pathCStr = spritesheet.path.c_str(); auto pathString = spritesheet.path.string();
labels.emplace_back(std::vformat(localize.get(FORMAT_SPRITESHEET), std::make_format_args(id, pathCStr))); labels.emplace_back(std::vformat(localize.get(FORMAT_SPRITESHEET), std::make_format_args(id, pathString)));
} }
return labels; return labels;
} }
+1 -1
View File
@@ -61,7 +61,7 @@ namespace anm2ed
void Dialog::file_explorer_open(const std::filesystem::path& path) void Dialog::file_explorer_open(const std::filesystem::path& path)
{ {
#ifdef _WIN32 #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__ #elif __unix__
system(std::format("xdg-open \"{}\" &", path.c_str()).c_str()); system(std::format("xdg-open \"{}\" &", path.c_str()).c_str());
#else #else
+2 -2
View File
@@ -745,7 +745,7 @@ namespace anm2ed::imgui
if (dialog.is_selected(dialog::FFMPEG_PATH_SET)) if (dialog.is_selected(dialog::FFMPEG_PATH_SET))
{ {
ffmpegPath = dialog.path; ffmpegPath = dialog.path.string();
dialog.reset(); dialog.reset();
} }
@@ -763,7 +763,7 @@ namespace anm2ed::imgui
if (dialog.is_selected(dialogType)) if (dialog.is_selected(dialogType))
{ {
path = dialog.path; path = dialog.path.string();
dialog.reset(); dialog.reset();
} }
+2 -2
View File
@@ -210,7 +210,7 @@ namespace anm2ed::imgui
bool isValid = sound.is_valid(); bool isValid = sound.is_valid();
auto& soundIcon = isValid ? resources.icons[icon::SOUND] : resources.icons[icon::NONE]; 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 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::SetNextItemSelectionUserData(id);
ImGui::SetNextItemStorageID(id); ImGui::SetNextItemStorageID(id);
@@ -236,7 +236,7 @@ namespace anm2ed::imgui
if (ImGui::BeginItemTooltip()) if (ImGui::BeginItemTooltip())
{ {
ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE); ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE);
ImGui::TextUnformatted(sound.path.c_str()); ImGui::TextUnformatted(pathCStr);
ImGui::PopFont(); ImGui::PopFont();
ImGui::Text("%s: %d", localize.get(BASIC_ID), id); ImGui::Text("%s: %d", localize.get(BASIC_ID), id);
if (!isValid) if (!isValid)
+1 -1
View File
@@ -210,7 +210,7 @@ namespace anm2ed
ImGui::GetStyle().FontScaleMain = settings.uiScale; ImGui::GetStyle().FontScaleMain = settings.uiScale;
io.ConfigWindowsMoveFromTitleBarOnly = true; io.ConfigWindowsMoveFromTitleBarOnly = true;
ImGui::LoadIniSettingsFromDisk(settings_path().c_str()); ImGui::LoadIniSettingsFromDisk(settings_path().string().c_str());
if (isSocketThread) if (isSocketThread)
{ {
+2 -2
View File
@@ -116,7 +116,7 @@ namespace anm2ed::resource
Texture::Texture(const std::filesystem::path& pngPath) 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); upload(data);
stbi_image_free((void*)data); stbi_image_free((void*)data);
@@ -125,7 +125,7 @@ namespace anm2ed::resource
bool Texture::write_png(const std::filesystem::path& path) 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 vec4 Texture::pixel_read(vec2 position) const
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once #pragma once
#include <string> #include <filesystem>
#include <glm/glm.hpp> #include <glm/glm.hpp>