From cbf3a5949a65ce0496fed440199d86c82ba9b02f Mon Sep 17 00:00:00 2001 From: im-tem Date: Fri, 15 Aug 2025 12:07:29 +0300 Subject: [PATCH 1/4] cmakelists: adjust windows icon path --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da46b39..eba1a4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ file(GLOB SOURCES if (WIN32) enable_language("RC") - set (WIN32_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/assets/win_icon.rc) + set (WIN32_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/assets/Icon.rc) endif() add_executable(${PROJECT_NAME} ${SOURCES} ${WIN32_RESOURCES}) From 73ba6af1254455229cf6a0e3dedb43c9622d1682 Mon Sep 17 00:00:00 2001 From: im-tem Date: Fri, 15 Aug 2025 12:13:26 +0300 Subject: [PATCH 2/4] misc: fixes to make it build --- src/COMMON.h | 2 +- src/clipboard.h | 1 + src/imgui.cpp | 4 ++-- src/imgui.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/COMMON.h b/src/COMMON.h index 7ea318a..a9f079a 100644 --- a/src/COMMON.h +++ b/src/COMMON.h @@ -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 parentPath = filePath.parent_path(); 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) diff --git a/src/clipboard.h b/src/clipboard.h index d5eb955..2f874ca 100644 --- a/src/clipboard.h +++ b/src/clipboard.h @@ -1,6 +1,7 @@ #pragma once #include "anm2.h" +#include enum ClipboardItemType { diff --git a/src/imgui.cpp b/src/imgui.cpp index 7596517..01396da 100644 --- a/src/imgui.cpp +++ b/src/imgui.cpp @@ -37,7 +37,7 @@ static void _imgui_spritesheet_add(Imgui* self, const std::string& path) { std::filesystem::path workingPath = std::filesystem::current_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); self->anm2->spritesheets[id] = Anm2Spritesheet{}; @@ -1996,7 +1996,7 @@ static void _imgui_spritesheets(Imgui* self) { std::filesystem::path workingPath = std::filesystem::current_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; resources_texture_init(self->resources, spritesheetPath, self->dialog->replaceID); diff --git a/src/imgui.h b/src/imgui.h index 4783a9f..3231c14 100644 --- a/src/imgui.h +++ b/src/imgui.h @@ -255,7 +255,7 @@ static inline void imgui_explore(Imgui* self) { std::filesystem::path filePath = self->anm2->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) From b3f99616c96ae5c4447c2ff2fcd0927df9ee1f86 Mon Sep 17 00:00:00 2001 From: im-tem Date: Fri, 15 Aug 2025 12:28:17 +0300 Subject: [PATCH 3/4] cmakelists: reintroduce /stack for win32 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eba1a4f..3b8e26a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ if (NOT MSVC) set(CMAKE_CXX_FLAGS "-O2 -std=c++23 -Wall -Wextra -pedantic -fmax-errors=1") else() set(CMAKE_CXX_FLAGS "/std:c++latest /EHsc") + target_link_options(${PROJECT_NAME} PRIVATE "/STACK:0xffffff") endif() if (CMAKE_BUILD_TYPE STREQUAL "Debug") From 5b4b0b2be5b9d4a3be7cb6d6b6f09574d2127f53 Mon Sep 17 00:00:00 2001 From: im-tem Date: Fri, 15 Aug 2025 12:41:03 +0300 Subject: [PATCH 4/4] enable vsync to prevent excess resource usage --- src/state.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/state.cpp b/src/state.cpp index b33d0ed..af70ee2 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -96,6 +96,8 @@ void init(State* self) glDisable(GL_DEPTH_TEST); glDisable(GL_LINE_SMOOTH); + SDL_GL_SetSwapInterval(1); + resources_init(&self->resources); dialog_init(&self->dialog, self->window); clipboard_init(&self->clipboard, &self->anm2);