From 4f5966dad6b7f9c848f4ee117aee7502349383b2 Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 17 Mar 2026 00:47:36 -0400 Subject: [PATCH] fix path issues --- compile_commands.json | 2 +- src/anm2/spritesheet.cpp | 6 ++++-- src/imgui/window/animation_preview.cpp | 5 +---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/compile_commands.json b/compile_commands.json index bc0dce8..5e95284 120000 --- a/compile_commands.json +++ b/compile_commands.json @@ -1 +1 @@ -/home/anon/sda/Personal/Repos/anm2ed/out/build/linux-debug/compile_commands.json \ No newline at end of file +/home/anon/sda/Personal/Repos/anm2ed/build/compile_commands.json \ No newline at end of file diff --git a/src/anm2/spritesheet.cpp b/src/anm2/spritesheet.cpp index 5c9034f..bd8f68e 100644 --- a/src/anm2/spritesheet.cpp +++ b/src/anm2/spritesheet.cpp @@ -91,9 +91,10 @@ namespace anm2ed::anm2 Spritesheet::Spritesheet(const std::filesystem::path& directory, const std::filesystem::path& path) { WorkingDirectory workingDirectory(directory); + auto loadPath = !path.empty() ? path::lower_case_backslash_handle(path) : this->path; this->path = !path.empty() ? path::make_relative(path) : this->path; this->path = path::lower_case_backslash_handle(this->path); - texture = Texture(this->path); + texture = Texture(!loadPath.empty() ? loadPath : this->path); } XMLElement* Spritesheet::to_element(XMLDocument& document, int id, Flags flags) @@ -234,9 +235,10 @@ namespace anm2ed::anm2 void Spritesheet::reload(const std::filesystem::path& directory, const std::filesystem::path& path) { WorkingDirectory workingDirectory(directory); + auto loadPath = !path.empty() ? path::lower_case_backslash_handle(path) : this->path; this->path = !path.empty() ? path::make_relative(path) : this->path; this->path = path::lower_case_backslash_handle(this->path); - texture = Texture(this->path); + texture = Texture(!loadPath.empty() ? loadPath : this->path); } bool Spritesheet::is_valid() { return texture.is_valid(); } diff --git a/src/imgui/window/animation_preview.cpp b/src/imgui/window/animation_preview.cpp index b6602c5..78b817c 100644 --- a/src/imgui/window/animation_preview.cpp +++ b/src/imgui/window/animation_preview.cpp @@ -1,8 +1,8 @@ #include "animation_preview.hpp" #include -#include #include +#include #include #include #include @@ -105,7 +105,6 @@ namespace anm2ed::imgui pixels[index + 2] = (uint8_t)glm::clamp((float)std::round((float)pixels[index + 2] / alphaUnit), 0.0f, 255.0f); } } -<<<<<<< HEAD bool render_audio_stream_generate(AudioStream& audioStream, std::map& sounds, const std::vector& frameSoundIDs, int fps) @@ -151,8 +150,6 @@ namespace anm2ed::imgui MIX_DestroyMixer(mixer); return true; } -======= ->>>>>>> f58d894 (Render animation fixes, vs code tasks) } AnimationPreview::AnimationPreview() : Canvas(vec2()) {}