SPECIAL LITTLE WARNING FOR STUPID LITTLE CHUDS WHO CAN'T READ
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user