diff options
author | Thomas--S <Thomas--S@users.noreply.github.com> | 2020-12-15 19:06:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 19:06:36 +0100 |
commit | d0a38f694d483fbd9c0554c8d7175a94097fd67e (patch) | |
tree | 67ab895363386282115cf6c0b34a9303c38b9a15 /src/gui/guiScene.cpp | |
parent | 3ed940ff13fc2b4ef4b63f2c506ed9e5ab59f54f (diff) | |
download | hax-minetest-server-d0a38f694d483fbd9c0554c8d7175a94097fd67e.tar.gz hax-minetest-server-d0a38f694d483fbd9c0554c8d7175a94097fd67e.zip |
Formspec: Allow to specify frame loop for model[] (#10679)
Add the ability to specify an animation frame loop range for the model[] formspec element.
Diffstat (limited to '')
-rw-r--r-- | src/gui/guiScene.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/guiScene.cpp b/src/gui/guiScene.cpp index 08f119e07..5f4c50b91 100644 --- a/src/gui/guiScene.cpp +++ b/src/gui/guiScene.cpp @@ -152,6 +152,15 @@ void GUIScene::setStyles(const std::array<StyleSpec, StyleSpec::NUM_STATES> &sty setBackgroundColor(style.getColor(StyleSpec::BGCOLOR, m_bgcolor)); } +/** + * Sets the frame loop range for the mesh + */ +void GUIScene::setFrameLoop(s32 begin, s32 end) +{ + if (m_mesh->getStartFrame() != begin || m_mesh->getEndFrame() != end) + m_mesh->setFrameLoop(begin, end); +} + /* Camera control functions */ inline void GUIScene::calcOptimalDistance() |