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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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)

View File

@@ -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)
{

View File

@@ -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

View File

@@ -1,6 +1,6 @@
#pragma once
#include <string>
#include <filesystem>
#include <glm/glm.hpp>