Alpha color offset

Color Offset gains an alpha channel (Frame Properties, Change All, property
copy, interpolation and root folding), drawn by adding it to the texel's
alpha. Saved as AlphaOffset in the editor's copy only and counted by the
Isaac warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 17:22:15 -04:00
1 parent 0adb0f89bc
commit 4375844c84
17 files changed
+39 -51

No files matched your search

+1
View File
@@ -191,6 +191,7 @@ namespace anm2ed
X(colorOffsetR, colorOffset.r, false, true, changeIsColorOffsetR, changeColorOffset.r) \
X(colorOffsetG, colorOffset.g, false, true, changeIsColorOffsetG, changeColorOffset.g) \
X(colorOffsetB, colorOffset.b, false, true, changeIsColorOffsetB, changeColorOffset.b) \
X(colorOffsetA, colorOffset.a, false, true, changeIsColorOffsetA, changeColorOffset.a) \
X(blur, blur, true, false, changeIsBlur, changeBlur)
struct FrameChange
+1 -1
View File
@@ -48,7 +48,7 @@ namespace anm2ed::model
glm::vec2 skew{};
float rotation{};
glm::vec4 tint{types::color::WHITE};
glm::vec3 colorOffset{};
glm::vec4 colorOffset{};
int duration{1};
bool isVisible{true};
Interpolation interpolation{Interpolation::NONE};
+5 -1
View File
@@ -39,7 +39,7 @@ namespace anm2ed::model
"LayerId", "NullId", "SpritesheetId", "Fps", "Version", "FrameNum", "Delay", "AtFrame", "EventId", "RegionId",
"ShaderId", "Depth", "SoundId", "GroupId", "Index", "Loop", "StartMarker", "EndMarker", "Visible", "ShowRect", "IsExpanded", "Enabled", "Rotation",
"XPivot", "YPivot", "XCrop", "YCrop", "XPosition", "YPosition", "Width", "Height", "XScale", "YScale", "SkewX",
"SkewY", "ShearX", "ShearY", "RedTint", "GreenTint", "BlueTint", "AlphaTint", "RedOffset", "GreenOffset", "BlueOffset",
"SkewY", "ShearX", "ShearY", "RedTint", "GreenTint", "BlueTint", "AlphaTint", "RedOffset", "GreenOffset", "BlueOffset", "AlphaOffset",
"Interpolated", "Origin", "BakeInterpolation", "BakeDelay", "BakeCount", "OriginalDelay", "Library", "Animation",
"ChildAnimation", "ChildMode", "ChildStart", "Restart", "Blur"};
// clang-format on
@@ -217,6 +217,7 @@ namespace anm2ed::model
frame.tint[i] = color_get(element, TINT_ATTRIBUTES[i], frame.tint[i]);
for (int i = 0; i < (int)std::size(OFFSET_ATTRIBUTES); ++i)
frame.colorOffset[i] = color_get(element, OFFSET_ATTRIBUTES[i], frame.colorOffset[i]);
frame.colorOffset.a = color_get(element, "AlphaOffset", frame.colorOffset.a);
frame.duration = int_get(element, "Delay", frame.duration);
frame.isVisible = bool_get(element, "Visible", frame.isVisible);
frame.interpolation = interpolation_read(element, "Interpolated");
@@ -1164,6 +1165,8 @@ namespace anm2ed::model
sink.attribute(TINT_ATTRIBUTES[i], math::float_to_uint8(frame.tint[i]));
for (int i = 0; i < (int)std::size(OFFSET_ATTRIBUTES); ++i)
sink.attribute(OFFSET_ATTRIBUTES[i], math::float_to_uint8(frame.colorOffset[i]));
if (writer.is(SERIALIZE_EXTENSIONS) && math::float_to_uint8(frame.colorOffset.a) != 0)
sink.attribute("AlphaOffset", math::float_to_uint8(frame.colorOffset.a));
sink.attribute("Rotation", frame.rotation);
interpolation_add(sink, "Interpolated", frame.interpolation);
if (writer.is(SERIALIZE_EXTENSIONS) && frame.shaderId != -1) sink.attribute("ShaderId", frame.shaderId);
@@ -1372,6 +1375,7 @@ namespace anm2ed::model
issues.skewFrames += frame.skew != glm::vec2();
issues.shaderFrames += frame.shaderId != -1;
issues.depthFrames += track.type == ItemType::LAYER && frame.depth != 0;
issues.alphaOffsetFrames += math::float_to_uint8(frame.colorOffset.a) != 0;
issues.blurFrames += track.type == ItemType::LAYER && frame.blur != 0.0f;
issues.triggerSounds +=
track.type == ItemType::TRIGGER &&
+1
View File
@@ -16,6 +16,7 @@ namespace anm2ed::model
int skewFrames{};
int shaderFrames{};
int depthFrames{};
int alphaOffsetFrames{};
int blurFrames{};
int triggerSounds{};
int animationLayers{};