irr_scene_addAnimator (SCM wrapped_scene_node,
SCM animator)
{
- irr::scene::ISceneNode* node;
+#define ADD_ANIMATOR(NODE) NODE->addAnimator (unwrap_scene_node_animator (animator));
if (animated_mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_animated_mesh_scene_node (wrapped_scene_node);
+ ADD_ANIMATOR (unwrap_animated_mesh_scene_node (wrapped_scene_node));
}
else if (mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_mesh_scene_node (wrapped_scene_node);
+ ADD_ANIMATOR (unwrap_mesh_scene_node (wrapped_scene_node));
}
else if (scene_node_p (wrapped_scene_node))
{
- node = unwrap_scene_node (wrapped_scene_node);
+ ADD_ANIMATOR (unwrap_scene_node (wrapped_scene_node));
}
else
{
scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
}
- node->addAnimator (unwrap_scene_node_animator (animator));
return SCM_UNSPECIFIED;
}
SCM flag,
SCM newvalue)
{
- irr::scene::ISceneNode* node;
+#define SET_MATERIAL_FLAG(NODE) NODE->setMaterialFlag (scm_to_material_flag (flag), \
+ scm_to_bool (newvalue));
if (animated_mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_animated_mesh_scene_node (wrapped_scene_node);
+ SET_MATERIAL_FLAG (unwrap_animated_mesh_scene_node (wrapped_scene_node));
}
else if (mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_mesh_scene_node (wrapped_scene_node);
+ SET_MATERIAL_FLAG (unwrap_mesh_scene_node (wrapped_scene_node));
}
else if (scene_node_p (wrapped_scene_node))
{
- node = unwrap_scene_node (wrapped_scene_node);
+ SET_MATERIAL_FLAG (unwrap_scene_node (wrapped_scene_node));
}
else
{
scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
}
- node->setMaterialFlag (scm_to_material_flag (flag),
- scm_to_bool (newvalue));
return SCM_UNSPECIFIED;
}
SCM texture_layer,
SCM texture)
{
- irr::scene::ISceneNode* node;
+#define SET_MATERIAL_TEXTURE(NODE) NODE->setMaterialTexture (scm_to_uint32 (texture_layer), \
+ unwrap_texture (texture));
if (animated_mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_animated_mesh_scene_node (wrapped_scene_node);
+ SET_MATERIAL_TEXTURE (unwrap_animated_mesh_scene_node (wrapped_scene_node));
}
else if (mesh_scene_node_p (wrapped_scene_node))
{
- node = (irr::scene::ISceneNode*)unwrap_mesh_scene_node (wrapped_scene_node);
+ SET_MATERIAL_TEXTURE (unwrap_mesh_scene_node (wrapped_scene_node));
}
else if (scene_node_p (wrapped_scene_node))
{
- node = unwrap_scene_node (wrapped_scene_node);
+ SET_MATERIAL_TEXTURE (unwrap_scene_node (wrapped_scene_node));
}
else
{
scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
}
- node->setMaterialTexture (scm_to_uint32 (texture_layer),
- unwrap_texture (texture));
return SCM_UNSPECIFIED;
}
irr_scene_setPosition (SCM wrapped_scene_node,
SCM position)
{
+#define SET_POSITION(NODE) NODE->setPosition (scm_to_vector3df (position));
+
if (scene_node_p (wrapped_scene_node))
{
- unwrap_scene_node (wrapped_scene_node)->
- setPosition (scm_to_vector3df (position));
+ SET_POSITION (unwrap_scene_node (wrapped_scene_node));
}
else if (mesh_scene_node_p (wrapped_scene_node))
{
- unwrap_mesh_scene_node (wrapped_scene_node)->
- setPosition (scm_to_vector3df (position));
+ SET_POSITION (unwrap_mesh_scene_node (wrapped_scene_node));
}
else
{
scm_error (scm_arg_type_key, NULL, "Cannot set position to object: ~S",
scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
}
+
return SCM_UNSPECIFIED;
}