X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fbox3d.cpp;h=71571b1013b9e59772ca4ac1b02e20e787039fd3;hb=cda8d6e3636e9ad6878b8e6b0c4449f6f9c635f0;hp=9b78836f1a25165fc2bf5d8b9c7ef71693217960;hpb=69ed7f57e6295034fa64ab2bf6d10da6882860ef;p=guile-irrlicht.git diff --git a/src/box3d.cpp b/src/box3d.cpp index 9b78836..71571b1 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -24,46 +24,45 @@ #include "box3d.h" #include "gsubr.h" #include "vector3d.h" -#include "wrapped.h" -extern "C" { - void - init_box3d (void) - { - init_box3d_type (); - DEFINE_GSUBR ("box3d-add-internal-point!", 2, 0, 0, box3d_add_internal_point); - DEFINE_GSUBR ("box3d-reset!", 2, 0, 0, box3d_reset); - DEFINE_GSUBR ("make-box3d", 0, 0, 0, make_box3d); - } +using namespace irr; - 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 - make_box3d () +SCM +aabbox3d_make () +{ + core::aabbox3df* aabbox = new core::aabbox3df (); + return scm_from_pointer ((void*)aabbox, NULL); +} + + +SCM +aabbox3d_reset (SCM box3d, + SCM init_value) +{ + ((core::aabbox3df*)scm_to_pointer (box3d))->reset (scm_to_vector3df (init_value)); + return SCM_UNSPECIFIED; +} + + +extern "C" { + + void + init_box3d (void) { - irr::core::aabbox3df* aabbox = new irr::core::aabbox3df (); - return wrap_box3d (aabbox); + 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); } }