X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fguile-irrlicht.cpp;h=cd18a09c3d5f81c1500fd9a79d7ed07fe3390d0d;hb=79027b9833bbb753e7576091a8907605c2d89707;hp=a1e84116ed28d4b07e88e873ae740eaaf5e7384c;hpb=789237bc01f8b2172725b51dbc7ae72b9a30be7a;p=guile-irrlicht.git diff --git a/src/guile-irrlicht.cpp b/src/guile-irrlicht.cpp index a1e8411..cd18a09 100644 --- a/src/guile-irrlicht.cpp +++ b/src/guile-irrlicht.cpp @@ -20,179 +20,56 @@ */ #include - #include "animated-mesh.h" #include "animated-mesh-scene-node.h" #include "box3d.h" -#include "camera-scene-node.h" #include "cursor-control.h" #include "device.h" #include "event-receiver.h" -#include "file-archive.h" #include "file-system.h" -#include "gui-element.h" #include "gui-environment.h" +#include "gui-in-out-fader.h" +#include "gui-listbox.h" +#include "gui-scrollbar.h" +#include "gui-skin.h" #include "gui-static-text.h" +#include "gui-toolbar.h" #include "guile-irrlicht.h" -#include "keymap.h" #include "material.h" -#include "mesh.h" -#include "mesh-scene-node.h" #include "reference-counted.h" #include "scene-manager.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" + extern "C" { void init_guile_irrlicht (void) { - // Init modules init_animated_mesh (); init_animated_mesh_scene_node (); init_box3d (); - init_camera_scene_node (); init_cursor_control (); init_device (); init_event_receiver (); - init_file_archive (); init_file_system (); - init_gui_element (); init_gui_environment (); + init_gui_in_out_fader (); + init_gui_listbox (); + init_gui_scrollbar (); + init_gui_skin (); init_gui_static_text (); - init_keymap (); + init_gui_toolbar (); init_material (); - init_mesh (); - init_mesh_scene_node (); init_reference_counted (); init_scene_manager (); init_scene_node (); - init_scene_node_animator (); - init_texture (); + init_timer (); init_vertex3d (); init_video_driver (); - - // Shared procedures (used by two or more objects) - 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-material-flag!", - "set-position!", "set-visible!", NULL); - } - - SCM - irr_drawAll (SCM wrapped_obj) - { - if (gui_environment_p (wrapped_obj)) - { - unwrap_gui_environment (wrapped_obj)->drawAll (); - } - else if (scene_manager_p (wrapped_obj)) - { - unwrap_scene_manager (wrapped_obj)->drawAll (); - } - else - { - scm_error (scm_arg_type_key, NULL, "Cannot draw all elements from object: ~S", - scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); - } - return SCM_UNSPECIFIED; - } - - SCM - irr_getName (SCM wrapped_obj) - { - if (video_driver_p (wrapped_obj)) - { - return scm_from_wide_char_string (unwrap_video_driver (wrapped_obj)->getName ()); - } - else - { - scm_error (scm_arg_type_key, NULL, "Cannot get name from object: ~S", - scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); - } - } - - SCM - irr_setMaterial (SCM wrapped_obj, - SCM material) - { - if (video_driver_p (wrapped_obj)) - { - return irr_video_setMaterial (wrapped_obj, material); - } - else - { - scm_error (scm_arg_type_key, NULL, "Cannot set material to object: ~S", - scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); - } - } - - 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) - { - if (cursor_control_p (wrapped_obj)) - { - return irr_gui_setPosition (wrapped_obj, position); - } - else if (scene_node_p (wrapped_obj) || mesh_scene_node_p (wrapped_obj)) - { - return irr_scene_setPosition (wrapped_obj, position); - } - else - { - scm_error (scm_arg_type_key, NULL, "Cannot set position to object: ~S", - scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); - } - } - - SCM - irr_setVisible (SCM wrapped_obj, - SCM visible) - { - if (cursor_control_p (wrapped_obj)) - { - unwrap_cursor_control (wrapped_obj)->setVisible (scm_to_bool (visible)); - } - else if (gui_element_p (wrapped_obj)) - { - unwrap_gui_element (wrapped_obj)->setVisible (scm_to_bool (visible)); - } - else if (scene_node_p (wrapped_obj)) - { - unwrap_scene_node (wrapped_obj)->setVisible (scm_to_bool (visible)); - } - else - { - 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; } }