#include "file-archive.h"
#include "file-system.h"
#include "gsubr.h"
+#include "gui.h"
#include "gui-element.h"
#include "gui-environment.h"
-#include "gui-static-text.h"
#include "guile-irrlicht.h"
#include "keymap.h"
#include "material.h"
#include "scene-node.h"
#include "scene-node-animator.h"
#include "texture.h"
+#include "timer.h"
#include "vertex3d.h"
#include "video-driver.h"
#include "wchar.h"
init_event_receiver ();
init_file_archive ();
init_file_system ();
- init_gui_element ();
- init_gui_environment ();
- init_gui_static_text ();
+ init_gui ();
init_keymap ();
init_material ();
init_mesh ();
init_scene_node ();
init_scene_node_animator ();
init_texture ();
+ init_timer ();
init_vertex3d ();
init_video_driver ();
// Shared procedures (used by two or more objects)
DEFINE_GSUBR ("draw-all", 1, 0, 0, irr_drawAll);
+ DEFINE_GSUBR ("get-position", 1, 1, 0, irr_getPosition);
DEFINE_GSUBR ("get-name", 1, 0, 0, irr_getName);
DEFINE_GSUBR ("set-material!", 2, 0, 0, irr_setMaterial);
DEFINE_GSUBR ("set-material-flag!", 3, 0, 0, irr_setMaterialFlag);
}
}
+ SCM
+ irr_getPosition (SCM wrapped_obj,
+ SCM i)
+ {
+ if (cursor_control_p (wrapped_obj))
+ {
+ return irr_gui_getPosition (wrapped_obj);
+ }
+ else if (is_scene_node_object (wrapped_obj))
+ {
+ return irr_scene_getPosition (wrapped_obj);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot get position from object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
SCM
irr_setMaterial (SCM wrapped_obj,
SCM material)
SCM flag,
SCM newvalue)
{
- if (animated_mesh_scene_node_p (wrapped_obj) ||
- mesh_scene_node_p (wrapped_obj) ||
- scene_node_p (wrapped_obj))
+ if (is_scene_node_object (wrapped_obj))
{
return irr_scene_ISceneNode_setMaterialFlag (wrapped_obj, flag, newvalue);
}
{
return irr_gui_setPosition (wrapped_obj, position);
}
- else if (scene_node_p (wrapped_obj) || mesh_scene_node_p (wrapped_obj))
+ else if (is_scene_node_object (wrapped_obj))
{
return irr_scene_setPosition (wrapped_obj, position);
}
irr_setVisible (SCM wrapped_obj,
SCM visible)
{
+#define SET_VISIBLE(OBJ) OBJ->setVisible (scm_to_bool (visible));
+
if (cursor_control_p (wrapped_obj))
{
- unwrap_cursor_control (wrapped_obj)->setVisible (scm_to_bool (visible));
+ SET_VISIBLE (unwrap_cursor_control (wrapped_obj));
}
else if (gui_element_p (wrapped_obj))
{
- unwrap_gui_element (wrapped_obj)->setVisible (scm_to_bool (visible));
+ SET_VISIBLE (unwrap_gui_element (wrapped_obj));
}
- else if (scene_node_p (wrapped_obj))
+ else if (is_scene_node_object (wrapped_obj))
{
- unwrap_scene_node (wrapped_obj)->setVisible (scm_to_bool (visible));
+ SET_VISIBLE (unwrap_scene_node (wrapped_obj));
}
else
{