From 06d4163c5154f0fd2e934e197bb55d06e1a2b0fa Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Fri, 22 May 2020 08:40:56 +0200 Subject: [PATCH 1/1] set-animation-speed! --- irrlicht.scm | 1 + irrlicht/scene.scm | 6 +++++- src/animated-mesh-scene-node.cpp | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/irrlicht.scm b/irrlicht.scm index 22f5a60..75e03f7 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -95,6 +95,7 @@ make-vertex3d reset-box3d! run + set-animation-speed! set-frame-loop! set-material! set-material-flag! diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index a20b78c..34853d3 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -247,6 +247,10 @@ (define-class () (irr-class #:init-value "IAnimatedMeshSceneNode")) +(define-method (set-animation-speed! (node ) frames-per-second) + (let ((setAnimationSpeed (get-irrlicht-proc "setAnimationSpeed" node))) + (setAnimationSpeed node frames-per-second))) + (define-method (set-frame-loop! (node ) begin end) (let ((setFrameLoop (get-irrlicht-proc "setFrameLoop" node))) (setFrameLoop node begin end))) @@ -256,7 +260,7 @@ node anim)) -(export set-frame-loop! set-md2-animation!) +(export set-animation-speed! set-frame-loop! set-md2-animation!) ;; ICameraSceneNode diff --git a/src/animated-mesh-scene-node.cpp b/src/animated-mesh-scene-node.cpp index 040b7cd..e63541b 100644 --- a/src/animated-mesh-scene-node.cpp +++ b/src/animated-mesh-scene-node.cpp @@ -28,6 +28,16 @@ using namespace irr; +SCM +IAnimatedMeshSceneNode_setAnimationSpeed (SCM animated_mesh_scene_node, + SCM frames_per_second) +{ + scene::IAnimatedMeshSceneNode* node = + (scene::IAnimatedMeshSceneNode*) scm_to_irr_pointer (animated_mesh_scene_node); + node->setAnimationSpeed (scm_to_double (frames_per_second)); + return SCM_UNSPECIFIED; +} + SCM IAnimatedMeshSceneNode_setFrameLoop (SCM animated_mesh_scene_node, SCM begin, @@ -51,6 +61,8 @@ IAnimatedMeshSceneNode_setMD2Animation (SCM animated_mesh_scene_node, void init_animated_mesh_scene_node (void) { + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setAnimationSpeed", 2, 0, 0, + IAnimatedMeshSceneNode_setAnimationSpeed); DEFINE_GSUBR ("IAnimatedMeshSceneNode_setFrameLoop", 3, 0, 0, IAnimatedMeshSceneNode_setFrameLoop); DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMD2Animation", 2, 0, 0, -- 2.39.5