X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fanimated-mesh.cpp;h=cb88225c9f659c564df5bbb5ed7ac72e2c8aea2c;hb=41a6ad96e81a8d8153c54877c4c12f61100677a9;hp=327deb03b639a94f7909928567b7345372ae88cc;hpb=db41186ef83fe5def23e3eacfbcea9248adf700e;p=guile-irrlicht.git diff --git a/src/animated-mesh.cpp b/src/animated-mesh.cpp index 327deb0..cb88225 100644 --- a/src/animated-mesh.cpp +++ b/src/animated-mesh.cpp @@ -21,46 +21,22 @@ #include #include - #include "animated-mesh.h" -#include "animated-mesh-scene-node.h" #include "gsubr.h" -#include "wrapped.h" - -extern "C" { - - void - init_animated_mesh (void) - { - init_animated_mesh_type (); - DEFINE_GSUBR ("set-animation-speed!", 2, 0, 0, irr_scene_setAnimationSpeed); - } - DEFINE_WRAPPED_TYPE (irr::scene::IAnimatedMesh*, "animated-mesh", - init_animated_mesh_type, animated_mesh_p, - wrap_animated_mesh, unwrap_animated_mesh); +using namespace irr; - SCM - irr_scene_setAnimationSpeed (SCM wrapped_obj, - SCM frames_per_second) - { -#define SET_ANIMATION_SPEED(OBJ) OBJ->setAnimationSpeed (scm_to_double (frames_per_second)); - - if (animated_mesh_p (wrapped_obj)) - { - SET_ANIMATION_SPEED (unwrap_animated_mesh (wrapped_obj)); - } - else if (animated_mesh_scene_node_p (wrapped_obj)) - { - SET_ANIMATION_SPEED (unwrap_animated_mesh_scene_node (wrapped_obj)); - } - else - { - scm_error (scm_arg_type_key, NULL, "Cannot set animation speed to object: ~S", - scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); - } - - return SCM_UNSPECIFIED; - } +SCM +IAnimatedMesh_setAnimationSpeed (SCM animated_mesh, + SCM frames_per_second) +{ + ((scene::IAnimatedMesh*)scm_to_pointer (animated_mesh))-> + setAnimationSpeed (scm_to_double (frames_per_second)); + return SCM_UNSPECIFIED; +} +void +init_animated_mesh (void) +{ + DEFINE_GSUBR ("IAnimatedMesh_setAnimationSpeed", 2, 0, 0, IAnimatedMesh_setAnimationSpeed); }