#include "file-system.h"
#include "gsubr.h"
#include "gui.h"
-#include "gui-edit-box.h"
#include "gui-element.h"
#include "gui-environment.h"
-#include "gui-image.h"
-#include "gui-static-text.h"
#include "guile-irrlicht.h"
#include "keymap.h"
#include "material.h"
init_file_archive ();
init_file_system ();
init_gui ();
- init_gui_edit_box ();
- init_gui_element ();
- init_gui_environment ();
- init_gui_image ();
- init_gui_static_text ();
init_keymap ();
init_material ();
init_mesh ();
// 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);
}
{
SET_VISIBLE (unwrap_gui_element (wrapped_obj));
}
- else if (scene_node_p (wrapped_obj))
+ else if (is_scene_node_object (wrapped_obj))
{
SET_VISIBLE (unwrap_scene_node (wrapped_obj));
}