From e32e781b4662c5ac72179d07dd142e2f71c829d7 Mon Sep 17 00:00:00 2001 From: shweet Date: Thu, 6 Aug 2026 11:47:20 -0400 Subject: [PATCH] remove compile commands --- .gitignore | 1 + compile_commands.json | 1 - .../wizard/change_all_frame_properties.cpp | 22 ++++++++++++------- src/snapshots.cpp | 6 +++++ 4 files changed, 21 insertions(+), 9 deletions(-) delete mode 120000 compile_commands.json diff --git a/.gitignore b/.gitignore index 0aaab7c..232f9ae 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ cmake-build-debug/ .vs/ .idea/ .codex +compile_commands.json AGENTS.md \ No newline at end of file diff --git a/compile_commands.json b/compile_commands.json deleted file mode 120000 index e2be980..0000000 --- a/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -/home/anon/sda/Personal/Repos/anm2ed/out/build/linux-release/compile_commands.json \ No newline at end of file diff --git a/src/imgui/wizard/change_all_frame_properties.cpp b/src/imgui/wizard/change_all_frame_properties.cpp index 7fda1f5..e3bf9ff 100644 --- a/src/imgui/wizard/change_all_frame_properties.cpp +++ b/src/imgui/wizard/change_all_frame_properties.cpp @@ -283,7 +283,7 @@ namespace anm2ed::imgui::wizard "##Tint A", localize.get(BASIC_TINT), isTintR, isTintG, isTintB, isTintA, tint); color3_value("##Is Color Offset R", "##Is Color Offset G", "##Is Color Offset B", "##Color Offset R", - "##Color Offset B", "##Color Offset G", localize.get(BASIC_COLOR_OFFSET), isColorOffsetR, + "##Color Offset G", "##Color Offset B", localize.get(BASIC_COLOR_OFFSET), isColorOffsetR, isColorOffsetG, isColorOffsetB, colorOffset); ImGui::BeginDisabled(!isLayerPropertyAvailable); @@ -334,6 +334,12 @@ namespace anm2ed::imgui::wizard auto frame_change = [&](ChangeType changeType) { + auto color_value_get = [&](float value) + { + if (changeType == ChangeType::MULTIPLY || changeType == ChangeType::DIVIDE) return (float)float_to_uint8(value); + return value; + }; + FrameChange frameChange; if (isCropX) frameChange.cropX = crop.x; if (isCropY) frameChange.cropY = crop.y; @@ -348,13 +354,13 @@ namespace anm2ed::imgui::wizard if (isRotation) frameChange.rotation = std::make_optional(rotation); if (isDuration) frameChange.duration = std::make_optional(duration); if (isRegion) frameChange.regionId = std::make_optional(regionId); - if (isTintR) frameChange.tintR = tint.r; - if (isTintG) frameChange.tintG = tint.g; - if (isTintB) frameChange.tintB = tint.b; - if (isTintA) frameChange.tintA = tint.a; - if (isColorOffsetR) frameChange.colorOffsetR = colorOffset.r; - if (isColorOffsetG) frameChange.colorOffsetG = colorOffset.g; - if (isColorOffsetB) frameChange.colorOffsetB = colorOffset.b; + if (isTintR) frameChange.tintR = color_value_get(tint.r); + if (isTintG) frameChange.tintG = color_value_get(tint.g); + if (isTintB) frameChange.tintB = color_value_get(tint.b); + if (isTintA) frameChange.tintA = color_value_get(tint.a); + if (isColorOffsetR) frameChange.colorOffsetR = color_value_get(colorOffset.r); + if (isColorOffsetG) frameChange.colorOffsetG = color_value_get(colorOffset.g); + if (isColorOffsetB) frameChange.colorOffsetB = color_value_get(colorOffset.b); if (isVisibleSet) frameChange.isVisible = std::make_optional(isVisible); if (isInterpolationSet) frameChange.interpolation = std::make_optional(static_cast(interpolation)); if (isFlipXSet) frameChange.isFlipX = std::make_optional(isFlipX); diff --git a/src/snapshots.cpp b/src/snapshots.cpp index 79cc6ee..6d2d67b 100644 --- a/src/snapshots.cpp +++ b/src/snapshots.cpp @@ -364,12 +364,14 @@ namespace anm2ed void Snapshots::anm2_push(const Snapshot& snapshot, const std::string& message) { + if (pendingStep) commit(snapshot); pendingStep = snapshots::step_anm2_seed(snapshot, message); } void Snapshots::tracks_push(const Snapshot& snapshot, const std::string& message, const std::set& trackReferences) { + if (pendingStep) commit(snapshot); SnapshotStep step{}; step.message = message; for (auto trackReference : trackReferences) @@ -382,6 +384,7 @@ namespace anm2ed void Snapshots::frames_push(const Snapshot& snapshot, const std::string& message, const std::set& frameReferences) { + if (pendingStep) commit(snapshot); SnapshotStep step{}; step.message = message; for (auto frameReference : frameReferences) @@ -393,6 +396,7 @@ namespace anm2ed void Snapshots::regions_push(const Snapshot& snapshot, const std::string& message, int spritesheetId, const std::set& regionIds) { + if (pendingStep) commit(snapshot); SnapshotStep step{}; step.message = message; for (auto regionId : regionIds) @@ -403,6 +407,7 @@ namespace anm2ed void Snapshots::textures_push(const Snapshot& snapshot, const std::string& message) { + if (pendingStep) commit(snapshot); SnapshotStep step{}; step.message = message; snapshots::step_textures_seed(step, snapshot); @@ -411,6 +416,7 @@ namespace anm2ed void Snapshots::anm2_textures_push(const Snapshot& snapshot, const std::string& message) { + if (pendingStep) commit(snapshot); auto step = snapshots::step_anm2_seed(snapshot, message); snapshots::step_textures_seed(step, snapshot); pendingStep = std::move(step);