windows fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user