SPECIAL LITTLE WARNING FOR STUPID LITTLE CHUDS WHO CAN'T READ

This commit is contained in:
2026-04-15 14:12:08 -04:00
parent f1b46fbf60
commit fc54412eb9
12 changed files with 157 additions and 18 deletions
+24
View File
@@ -146,6 +146,30 @@ namespace anm2ed::anm2
}
}
bool Anm2::has_special_interpolated_frames() const
{
auto item_has_special_frames = [](const Item& item)
{
for (const auto& frame : item.frames)
{
auto interpolation = frame.interpolation;
if (interpolation != Frame::Interpolation::NONE && interpolation != Frame::Interpolation::LINEAR) return true;
}
return false;
};
for (const auto& animation : animations.items)
{
if (item_has_special_frames(animation.rootAnimation)) return true;
for (const auto& item : animation.layerAnimations | std::views::values)
if (item_has_special_frames(item)) return true;
for (const auto& item : animation.nullAnimations | std::views::values)
if (item_has_special_frames(item)) return true;
}
return false;
}
Anm2::Anm2(const std::filesystem::path& path, std::string* errorString)
{
XMLDocument document;
+1
View File
@@ -82,6 +82,7 @@ namespace anm2ed::anm2
bool animations_deserialize(const std::string&, int, std::set<int>&, std::string* = nullptr);
Frame frame_effective(int, const Frame&) const;
glm::vec4 animation_rect(Animation&, bool) const;
bool has_special_interpolated_frames() const;
void bake_special_interpolated_frames(int, bool, bool);
Item* item_get(int, Type, int = -1);
+5 -1
View File
@@ -295,7 +295,11 @@ namespace anm2ed::anm2
if (!vector::in_bounds(frames, index)) return;
auto original = frames[index];
if (original.duration == FRAME_DURATION_MIN) return;
if (original.duration == FRAME_DURATION_MIN)
{
frames[index].interpolation = Frame::Interpolation::NONE;
return;
}
auto nextFrame = vector::in_bounds(frames, index + 1) ? frames[index + 1] : original;