X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fscene-node.cpp;h=3700818f4c290eeeea6dff21c33f046347b87e7e;hb=79e12d94cc21232477796a4e76fc2ddb5d88f9dc;hp=0caea376d6837f06d7a8d70c32bd92ca35cac3f8;hpb=98052b04792129db97286fdd77ef3b0de8912286;p=guile-irrlicht.git diff --git a/src/scene-node.cpp b/src/scene-node.cpp index 0caea37..3700818 100644 --- a/src/scene-node.cpp +++ b/src/scene-node.cpp @@ -26,148 +26,135 @@ #include "matrix4.h" #include "scene-node.h" #include "vector3d.h" - +#include "wrapped.h" using namespace irr; - template SCM ISceneNode_addAnimator (SCM scene_node, SCM animator) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); - node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_pointer (animator)); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); + node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_irr_pointer (animator)); return SCM_UNSPECIFIED; } - template SCM ISceneNode_getAbsoluteTransformation (SCM scene_node) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); return scm_from_matrix4 (node->getAbsoluteTransformation ()); } - template SCM ISceneNode_getPosition (SCM scene_node) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); return scm_from_vector3df (node->getPosition ()); } - template SCM ISceneNode_setMaterialFlag (SCM scene_node, SCM flag, SCM newvalue) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); node->setMaterialFlag (scm_to_material_flag (flag), scm_to_bool (newvalue)); return SCM_UNSPECIFIED; } - template SCM ISceneNode_setMaterialTexture (SCM scene_node, SCM texture_layer, SCM texture) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); node->setMaterialTexture (scm_to_uint32 (texture_layer), - (video::ITexture*) scm_to_pointer (texture)); + (video::ITexture*) scm_to_irr_pointer (texture)); return SCM_UNSPECIFIED; } - template SCM ISceneNode_setPosition (SCM scene_node, SCM position) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); node->setPosition (scm_to_vector3df (position)); return SCM_UNSPECIFIED; } - template SCM ISceneNode_setRotation (SCM scene_node, SCM rotation) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); node->setRotation (scm_to_vector3df (rotation)); return SCM_UNSPECIFIED; } - template SCM ISceneNode_setScale (SCM scene_node, SCM scale) { - TSceneNode node = (TSceneNode) scm_to_pointer (scene_node); + TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); node->setScale (scm_to_vector3df (scale)); return SCM_UNSPECIFIED; } - -extern "C" { - - void - init_scene_node (void) - { - DEFINE_GSUBR ("IAnimatedMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("IMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("ISceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - - DEFINE_GSUBR ("ISceneNode_getAbsoluteTransformation", 1, 0, 0, - ISceneNode_getAbsoluteTransformation); - - DEFINE_GSUBR ("IMeshSceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - DEFINE_GSUBR ("ISceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("ISceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("ISceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - - DEFINE_GSUBR ("IMeshSceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - DEFINE_GSUBR ("ISceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ICameraSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ISceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); - DEFINE_GSUBR ("ISceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); - } - +void +init_scene_node (void) +{ + DEFINE_GSUBR ("IAnimatedMeshSceneNode_addAnimator", 2, 0, 0, + ISceneNode_addAnimator); + DEFINE_GSUBR ("IMeshSceneNode_addAnimator", 2, 0, 0, + ISceneNode_addAnimator); + DEFINE_GSUBR ("ISceneNode_addAnimator", 2, 0, 0, + ISceneNode_addAnimator); + + DEFINE_GSUBR ("ISceneNode_getAbsoluteTransformation", 1, 0, 0, + ISceneNode_getAbsoluteTransformation); + + DEFINE_GSUBR ("IMeshSceneNode_getPosition", 1, 0, 0, + ISceneNode_getPosition); + DEFINE_GSUBR ("ISceneNode_getPosition", 1, 0, 0, + ISceneNode_getPosition); + + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialFlag", 3, 0, 0, + ISceneNode_setMaterialFlag); + DEFINE_GSUBR ("IMeshSceneNode_setMaterialFlag", 3, 0, 0, + ISceneNode_setMaterialFlag); + DEFINE_GSUBR ("ISceneNode_setMaterialFlag", 3, 0, 0, + ISceneNode_setMaterialFlag); + + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialTexture", 3, 0, 0, + ISceneNode_setMaterialTexture); + DEFINE_GSUBR ("IMeshSceneNode_setMaterialTexture", 3, 0, 0, + ISceneNode_setMaterialTexture); + DEFINE_GSUBR ("ISceneNode_setMaterialTexture", 3, 0, 0, + ISceneNode_setMaterialTexture); + + DEFINE_GSUBR ("IMeshSceneNode_setPosition", 2, 0, 0, + ISceneNode_setPosition); + DEFINE_GSUBR ("ISceneNode_setPosition", 2, 0, 0, + ISceneNode_setPosition); + + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setRotation", 2, 0, 0, + ISceneNode_setRotation); + DEFINE_GSUBR ("ICameraSceneNode_setRotation", 2, 0, 0, + ISceneNode_setRotation); + DEFINE_GSUBR ("ISceneNode_setRotation", 2, 0, 0, + ISceneNode_setRotation); + + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setScale", 2, 0, 0, + ISceneNode_setScale); + DEFINE_GSUBR ("ISceneNode_setScale", 2, 0, 0, + ISceneNode_setScale); }