summaryrefslogtreecommitdiff
path: root/src/gui/guiScene.cpp
diff options
context:
space:
mode:
authorThomas--S <Thomas--S@users.noreply.github.com>2020-12-15 19:06:36 +0100
committerGitHub <noreply@github.com>2020-12-15 19:06:36 +0100
commitd0a38f694d483fbd9c0554c8d7175a94097fd67e (patch)
tree67ab895363386282115cf6c0b34a9303c38b9a15 /src/gui/guiScene.cpp
parent3ed940ff13fc2b4ef4b63f2c506ed9e5ab59f54f (diff)
downloadminetest-d0a38f694d483fbd9c0554c8d7175a94097fd67e.tar.gz
minetest-d0a38f694d483fbd9c0554c8d7175a94097fd67e.tar.bz2
minetest-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 'src/gui/guiScene.cpp')
-rw-r--r--src/gui/guiScene.cpp9
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()