X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fbox3d.cpp;h=ed56fdc3228f514e9bbf52f30c5d153c5200f69e;hb=41a6ad96e81a8d8153c54877c4c12f61100677a9;hp=7185c0b3c072c707e2caef882922a5177b4812c0;hpb=445b38f04b47d1d664afebc4304385ec8fa7a998;p=guile-irrlicht.git diff --git a/src/box3d.cpp b/src/box3d.cpp index 7185c0b..ed56fdc 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -22,48 +22,38 @@ #include #include #include "box3d.h" +#include "gsubr.h" #include "vector3d.h" -#include "wrapped.h" -extern "C" { +using namespace irr; - void - init_box3d (void) - { - init_box3d_type (); - scm_c_define_gsubr ("box3d-add-internal-point!", 2, 0, 0, (scm_t_subr)box3d_add_internal_point); - scm_c_define_gsubr ("box3d-reset!", 2, 0, 0, (scm_t_subr)box3d_reset); - scm_c_define_gsubr ("make-box3d", 0, 0, 0, (scm_t_subr)make_box3d); - scm_c_export ("box3d-add-internal-point!", "box3d-reset!", "make-box3d", NULL); - } - - DEFINE_WRAPPED_TYPE (irr::core::aabbox3df*, "box3d", - init_box3d_type, box3d_p, - wrap_box3d, unwrap_box3d); - - SCM - box3d_add_internal_point (SCM box3d, - SCM point) - { - irr::core::aabbox3df* aabbox = unwrap_box3d (box3d); - aabbox->addInternalPoint (scm_to_vector3df (point)); - return SCM_UNSPECIFIED; - } +SCM +aabbox3d_addInternalPoint (SCM box3d, + SCM point) +{ + ((core::aabbox3df*)scm_to_pointer (box3d))->addInternalPoint (scm_to_vector3df (point)); + return SCM_UNSPECIFIED; +} - SCM - box3d_reset (SCM box3d, - SCM init_value) - { - irr::core::aabbox3df* aabbox = unwrap_box3d (box3d); - aabbox->reset (scm_to_vector3df (init_value)); - return SCM_UNSPECIFIED; - } +SCM +aabbox3d_make () +{ + core::aabbox3df* aabbox = new core::aabbox3df (); + return scm_from_pointer ((void*)aabbox, NULL); +} - SCM - make_box3d () - { - irr::core::aabbox3df* aabbox = new irr::core::aabbox3df (); - return wrap_box3d (aabbox); - } +SCM +aabbox3d_reset (SCM box3d, + SCM init_value) +{ + ((core::aabbox3df*)scm_to_pointer (box3d))->reset (scm_to_vector3df (init_value)); + return SCM_UNSPECIFIED; +} +void +init_box3d (void) +{ + DEFINE_GSUBR ("aabbox3d_addInternalPoint", 2, 0, 0, aabbox3d_addInternalPoint); + DEFINE_GSUBR ("aabbox3d_make", 0, 0, 0, aabbox3d_make); + DEFINE_GSUBR ("aabbox3d_reset", 2, 0, 0, aabbox3d_reset); }