#include <irrlicht/irrlicht.h>
#include <libguile.h>
+
#include "animated-mesh-md2.h"
#include "animated-mesh-scene-node.h"
#include "wrapped.h"
wrap_animated_mesh_scene_node, unwrap_animated_mesh_scene_node);
SCM
- irr_scene_setMD2Animation (SCM wrappedAnimatedMeshSceneNode,
+ irr_scene_setMD2Animation (SCM wrapped_animated_mesh_scene_node,
SCM anim)
{
irr::scene::IAnimatedMeshSceneNode* node =
- unwrap_animated_mesh_scene_node (wrappedAnimatedMeshSceneNode);
+ unwrap_animated_mesh_scene_node (wrapped_animated_mesh_scene_node);
bool result = node->setMD2Animation (scm_to_md2_animation_type (anim));
return scm_from_bool (result);
}
wrap_animated_mesh_scene_node, unwrap_animated_mesh_scene_node);
SCM
- irr_scene_setMD2Animation (SCM wrappedAnimatedMeshSceneNode,
+ irr_scene_setMD2Animation (SCM wrapped_animated_mesh_scene_node,
SCM anim);
}
#include "guile-irrlicht.h"
#include "keymap.h"
#include "material.h"
-#include "material-flags.h"
#include "mesh.h"
#include "mesh-scene-node.h"
#include "reference-counted.h"
init_gui_static_text ();
init_keymap ();
init_material ();
- init_material_flag ();
init_mesh ();
init_mesh_scene_node ();
init_reference_counted ();
scm_c_define_gsubr ("draw-all", 1, 0, 0, (scm_t_subr)irr_drawAll);
scm_c_define_gsubr ("get-name", 1, 0, 0, (scm_t_subr)irr_getName);
scm_c_define_gsubr ("set-material!", 2, 0, 0, (scm_t_subr)irr_setMaterial);
+ scm_c_define_gsubr ("set-material-flag!", 3, 0, 0, (scm_t_subr)irr_setMaterialFlag);
scm_c_define_gsubr ("set-position!", 2, 0, 0, (scm_t_subr)irr_setPosition);
scm_c_define_gsubr ("set-visible!", 2, 0, 0, (scm_t_subr)irr_setVisible);
- scm_c_export ("draw-all", "get-name", "set-material!", "set-position!",
- "set-visible!", NULL);
+ scm_c_export ("draw-all", "get-name", "set-material!", "set-material-flag!",
+ "set-position!", "set-visible!", NULL);
}
SCM
}
}
+ SCM
+ irr_setMaterialFlag (SCM wrapped_obj,
+ SCM flag,
+ SCM newvalue)
+ {
+ if (mesh_scene_node_p (wrapped_obj) || scene_node_p (wrapped_obj))
+ {
+ return irr_scene_ISceneNode_setMaterialFlag (wrapped_obj, flag, newvalue);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set material flag to object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
SCM
irr_setPosition (SCM wrapped_obj,
SCM position)
}
else
{
- scm_error (scm_arg_type_key, NULL, "Cannot set position for object: ~S",
+ scm_error (scm_arg_type_key, NULL, "Cannot set position to object: ~S",
scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
}
}
}
else
{
- scm_error (scm_arg_type_key, NULL, "Cannot set visibility for object: ~S",
+ scm_error (scm_arg_type_key, NULL, "Cannot set visibility to object: ~S",
scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
}
return SCM_UNSPECIFIED;
irr_setMaterial (SCM wrapped_obj,
SCM material);
+ SCM
+ irr_setMaterialFlag (SCM wrapped_obj,
+ SCM flag,
+ SCM newvalue);
+
SCM
irr_setPosition (SCM wrapped_obj,
SCM position);
#include <irrlicht/irrlicht.h>
#include <libguile.h>
-#include "animated-mesh-scene-node.h"
-#include "material-flags.h"
-#include "scene-node.h"
extern "C" {
- void
- init_material_flag (void)
- {
- scm_c_define_gsubr ("set-material-flag!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialFlag);
- scm_c_export ("set-material-flag!", NULL);
- }
-
- SCM
- irr_scene_setMaterialFlag (SCM wrapped_obj,
- SCM flag,
- SCM newvalue)
- {
- if (animated_mesh_scene_node_p (wrapped_obj))
- {
- unwrap_animated_mesh_scene_node (wrapped_obj)->setMaterialFlag (scm_to_material_flag (flag),
- scm_to_bool (newvalue));
- }
- else if (scene_node_p (wrapped_obj))
- {
- unwrap_scene_node (wrapped_obj)->setMaterialFlag (scm_to_material_flag (flag),
- scm_to_bool (newvalue));
- }
- else
- {
- scm_error (scm_arg_type_key, NULL, "Cannot set material flag for object: ~S",
- scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
- }
- return SCM_UNSPECIFIED;
- }
-
irr::video::E_MATERIAL_FLAG
scm_to_material_flag (SCM material_flag)
{
extern "C" {
- void
- init_material_flag (void);
-
- SCM
- irr_scene_setMaterialFlag (SCM wrapped_obj,
- SCM flag,
- SCM newvalue);
-
irr::video::E_MATERIAL_FLAG
scm_to_material_flag (SCM material_flag);
#include <libguile.h>
#include "animated-mesh-scene-node.h"
+#include "material-flags.h"
#include "matrix4.h"
#include "mesh-scene-node.h"
#include "scene-node.h"
return scm_from_matrix4 (node->getAbsoluteTransformation ());
}
+ SCM
+ irr_scene_ISceneNode_setMaterialFlag (SCM wrapped_scene_node,
+ SCM flag,
+ SCM newvalue)
+ {
+ irr::scene::ISceneNode* node;
+
+ if (animated_mesh_scene_node_p (wrapped_scene_node))
+ {
+ node = (irr::scene::ISceneNode*)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);
+ }
+ else if (scene_node_p (wrapped_scene_node))
+ {
+ node = unwrap_scene_node (wrapped_scene_node);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set material flag to object: ~S",
+ 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
irr_scene_setMaterialTexture (SCM wrapped_scene_node,
SCM texture_layer,
SCM texture)
{
+ irr::scene::ISceneNode* node;
+
if (animated_mesh_scene_node_p (wrapped_scene_node))
{
- unwrap_animated_mesh_scene_node (wrapped_scene_node)->
- setMaterialTexture (scm_to_uint32 (texture_layer),
- unwrap_texture (texture));
+ node = (irr::scene::ISceneNode*)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);
}
else if (scene_node_p (wrapped_scene_node))
{
- unwrap_scene_node (wrapped_scene_node)->
- setMaterialTexture (scm_to_uint32 (texture_layer),
- unwrap_texture (texture));
+ node = unwrap_scene_node (wrapped_scene_node);
}
else
{
scm_error (scm_arg_type_key, NULL, "Cannot set material texture to object: ~S",
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;
}
SCM
irr_scene_getAbsoluteTransformation (SCM wrapped_scene_node);
+ SCM
+ irr_scene_ISceneNode_setMaterialFlag (SCM wrapped_scene_node,
+ SCM flag,
+ SCM newvalue);
+
SCM
irr_scene_setMaterialTexture (SCM wrapped_scene_node,
SCM texture_layer,