misc: fixes to make it build

This commit is contained in:
im-tem
2025-08-15 12:13:26 +03:00
parent cbf3a5949a
commit 73ba6af125
4 changed files with 5 additions and 4 deletions

View File

@@ -189,7 +189,7 @@ static inline std::string working_directory_from_file_set(const std::string& pat
std::filesystem::path filePath = path; std::filesystem::path filePath = path;
std::filesystem::path parentPath = filePath.parent_path(); std::filesystem::path parentPath = filePath.parent_path();
std::filesystem::current_path(parentPath); std::filesystem::current_path(parentPath);
return parentPath; return parentPath.string();
}; };
static inline std::string path_extension_change(const std::string& path, const std::string& extension) static inline std::string path_extension_change(const std::string& path, const std::string& extension)

View File

@@ -1,6 +1,7 @@
#pragma once #pragma once
#include "anm2.h" #include "anm2.h"
#include <variant>
enum ClipboardItemType enum ClipboardItemType
{ {

View File

@@ -37,7 +37,7 @@ static void _imgui_spritesheet_add(Imgui* self, const std::string& path)
{ {
std::filesystem::path workingPath = std::filesystem::current_path(); std::filesystem::path workingPath = std::filesystem::current_path();
std::string anm2WorkingPath = working_directory_from_file_set(self->anm2->path); std::string anm2WorkingPath = working_directory_from_file_set(self->anm2->path);
std::string spritesheetPath = std::filesystem::relative(path, anm2WorkingPath); std::string spritesheetPath = std::filesystem::relative(path, anm2WorkingPath).string();
s32 id = map_next_id_get(self->resources->textures); s32 id = map_next_id_get(self->resources->textures);
self->anm2->spritesheets[id] = Anm2Spritesheet{}; self->anm2->spritesheets[id] = Anm2Spritesheet{};
@@ -1996,7 +1996,7 @@ static void _imgui_spritesheets(Imgui* self)
{ {
std::filesystem::path workingPath = std::filesystem::current_path(); std::filesystem::path workingPath = std::filesystem::current_path();
std::string anm2WorkingPath = working_directory_from_file_set(self->anm2->path); std::string anm2WorkingPath = working_directory_from_file_set(self->anm2->path);
std::string spritesheetPath = std::filesystem::relative(self->dialog->path, anm2WorkingPath); std::string spritesheetPath = std::filesystem::relative(self->dialog->path, anm2WorkingPath).string();
self->anm2->spritesheets[self->dialog->replaceID].path = spritesheetPath; self->anm2->spritesheets[self->dialog->replaceID].path = spritesheetPath;
resources_texture_init(self->resources, spritesheetPath, self->dialog->replaceID); resources_texture_init(self->resources, spritesheetPath, self->dialog->replaceID);

View File

@@ -255,7 +255,7 @@ static inline void imgui_explore(Imgui* self)
{ {
std::filesystem::path filePath = self->anm2->path; std::filesystem::path filePath = self->anm2->path;
std::filesystem::path parentPath = filePath.parent_path(); std::filesystem::path parentPath = filePath.parent_path();
dialog_explorer_open(parentPath); dialog_explorer_open(parentPath.string());
} }
static inline void imgui_undo_push(Imgui* self, const std::string& action = SNAPSHOT_ACTION) static inline void imgui_undo_push(Imgui* self, const std::string& action = SNAPSHOT_ACTION)