Actually oops meant t add multiply/divide to here
This commit is contained in:
@@ -77,8 +77,10 @@ namespace anm2ed::anm2
|
|||||||
|
|
||||||
enum ChangeType
|
enum ChangeType
|
||||||
{
|
{
|
||||||
|
ADJUST,
|
||||||
ADD,
|
ADD,
|
||||||
SUBTRACT,
|
SUBTRACT,
|
||||||
ADJUST
|
MULTIPLY,
|
||||||
|
DIVIDE
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,6 @@
|
|||||||
#include "anm2_type.h"
|
#include "anm2_type.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
#if defined(TRANSPARENT)
|
|
||||||
#undef TRANSPARENT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace anm2ed::anm2
|
namespace anm2ed::anm2
|
||||||
{
|
{
|
||||||
constexpr auto FRAME_DURATION_MIN = 1;
|
constexpr auto FRAME_DURATION_MIN = 1;
|
||||||
|
|||||||
@@ -176,6 +176,31 @@ namespace anm2ed::anm2
|
|||||||
if (change.colorOffset) frame.colorOffset = glm::clamp(frame.colorOffset - *change.colorOffset, 0.0f, 1.0f);
|
if (change.colorOffset) frame.colorOffset = glm::clamp(frame.colorOffset - *change.colorOffset, 0.0f, 1.0f);
|
||||||
if (change.tint) frame.tint = glm::clamp(frame.tint - *change.tint, 0.0f, 1.0f);
|
if (change.tint) frame.tint = glm::clamp(frame.tint - *change.tint, 0.0f, 1.0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MULTIPLY:
|
||||||
|
if (change.rotation) frame.rotation *= *change.rotation;
|
||||||
|
if (change.duration) frame.duration = std::max(FRAME_DURATION_MIN, frame.duration * *change.duration);
|
||||||
|
if (change.crop) frame.crop *= *change.crop;
|
||||||
|
if (change.pivot) frame.pivot *= *change.pivot;
|
||||||
|
if (change.position) frame.position *= *change.position;
|
||||||
|
if (change.size) frame.size *= *change.size;
|
||||||
|
if (change.scale) frame.scale *= *change.scale;
|
||||||
|
if (change.colorOffset) frame.colorOffset = glm::clamp(frame.colorOffset * *change.colorOffset, 0.0f, 1.0f);
|
||||||
|
if (change.tint) frame.tint = glm::clamp(frame.tint * *change.tint, 0.0f, 1.0f);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DIVIDE:
|
||||||
|
if (change.rotation && *change.rotation != 0.0f) frame.rotation /= *change.rotation;
|
||||||
|
if (change.duration && *change.duration != 0)
|
||||||
|
frame.duration = std::max(FRAME_DURATION_MIN, frame.duration / *change.duration);
|
||||||
|
if (change.crop) frame.crop /= *change.crop;
|
||||||
|
if (change.pivot) frame.pivot /= *change.pivot;
|
||||||
|
if (change.position) frame.position /= *change.position;
|
||||||
|
if (change.size) frame.size /= *change.size;
|
||||||
|
if (change.scale) frame.scale /= *change.scale;
|
||||||
|
if (change.colorOffset) frame.colorOffset = glm::clamp(frame.colorOffset / *change.colorOffset, 0.0f, 1.0f);
|
||||||
|
if (change.tint) frame.tint = glm::clamp(frame.tint / *change.tint, 0.0f, 1.0f);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,16 +216,24 @@ namespace anm2ed::imgui
|
|||||||
document.item_get()->frames_change(frameChange, type, *frames.begin(), (int)frames.size()));
|
document.item_get()->frames_change(frameChange, type, *frames.begin(), (int)frames.size()));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto widgetSize = widget_size_with_row_get(3);
|
auto rowOneWidgetSize = widget_size_with_row_get(1);
|
||||||
|
|
||||||
if (ImGui::Button("Adjust", widgetSize)) frame_change(anm2::ADJUST);
|
if (ImGui::Button("Adjust", rowOneWidgetSize)) frame_change(anm2::ADJUST);
|
||||||
ImGui::SetItemTooltip("Set the value of each specified value onto the frame's equivalent.");
|
ImGui::SetItemTooltip("Set the value of each specified value onto the frame's equivalent.");
|
||||||
ImGui::SameLine();
|
|
||||||
if (ImGui::Button("Add", widgetSize)) frame_change(anm2::ADD);
|
auto rowTwoWidgetSize = widget_size_with_row_get(4);
|
||||||
|
|
||||||
|
if (ImGui::Button("Add", rowTwoWidgetSize)) frame_change(anm2::ADD);
|
||||||
ImGui::SetItemTooltip("Add the specified values onto each frame.\n(Boolean values will simply be set.)");
|
ImGui::SetItemTooltip("Add the specified values onto each frame.\n(Boolean values will simply be set.)");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Subtract", widgetSize)) frame_change(anm2::SUBTRACT);
|
if (ImGui::Button("Subtract", rowTwoWidgetSize)) frame_change(anm2::SUBTRACT);
|
||||||
ImGui::SetItemTooltip("Subtract the specified values from each frame.\n(Boolean values will simply be set.)");
|
ImGui::SetItemTooltip("Subtract the specified values from each frame.\n(Boolean values will simply be set.)");
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Multiply", rowTwoWidgetSize)) frame_change(anm2::MULTIPLY);
|
||||||
|
ImGui::SetItemTooltip("Multiply the specified values for each frame.\n(Boolean values will simply be set.)");
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Divide", rowTwoWidgetSize)) frame_change(anm2::DIVIDE);
|
||||||
|
ImGui::SetItemTooltip("Divide the specified values for each frame.\n(Boolean values will simply be set.)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|||||||
Reference in New Issue
Block a user