From d0a38f694d483fbd9c0554c8d7175a94097fd67e Mon Sep 17 00:00:00 2001 From: Thomas--S Date: Tue, 15 Dec 2020 19:06:36 +0100 Subject: Formspec: Allow to specify frame loop for model[] (#10679) Add the ability to specify an animation frame loop range for the model[] formspec element. --- src/gui/guiScene.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/guiScene.cpp') 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 &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() -- cgit v1.2.3