From: Javier Sancho Date: Sat, 9 May 2020 11:47:31 +0000 (+0200) Subject: gui-in-out-fader X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=ada2b81f3dde8085dd583dd71674a7575d096fda;p=guile-irrlicht.git gui-in-out-fader --- diff --git a/src/gui-in-out-fader.cpp b/src/gui-in-out-fader.cpp index 41dfc3f..e571b30 100644 --- a/src/gui-in-out-fader.cpp +++ b/src/gui-in-out-fader.cpp @@ -21,39 +21,39 @@ #include #include - #include "color.h" +#include "gsubr.h" #include "gui-in-out-fader.h" -#include "wrapped.h" + + +using namespace irr; + + +SCM +gui_IGUIInOutFader_setColor (SCM in_out_fader, + SCM color, + SCM dest_color) +{ + gui::IGUIInOutFader* fader = (gui::IGUIInOutFader*)scm_to_pointer (in_out_fader); + if (dest_color == SCM_UNDEFINED) + { + fader->setColor (scm_to_color (color)); + } + else + { + fader->setColor (scm_to_color (color), + scm_to_color (dest_color)); + } + return SCM_UNSPECIFIED; +} + extern "C" { void init_gui_in_out_fader (void) { - init_gui_in_out_fader_type (); - } - - DEFINE_WRAPPED_TYPE (irr::gui::IGUIInOutFader*, "gui-in-out-fader", - init_gui_in_out_fader_type, gui_in_out_fader_p, - wrap_gui_in_out_fader, unwrap_gui_in_out_fader); - - SCM - irr_gui_IGUIInOutFader_setColor (SCM wrapped_in_out_fader, - SCM color, - SCM dest_color) - { - irr::gui::IGUIInOutFader* fader = unwrap_gui_in_out_fader (wrapped_in_out_fader); - if (dest_color == SCM_UNDEFINED) - { - fader->setColor (scm_to_color (color)); - } - else - { - fader->setColor (scm_to_color (color), - scm_to_color (dest_color)); - } - return SCM_UNSPECIFIED; + DEFINE_GSUBR ("gui_IGUIInOutFader_setColor", 2, 1, 0, gui_IGUIInOutFader_setColor); } } diff --git a/src/gui-in-out-fader.h b/src/gui-in-out-fader.h index ee79962..74c05e1 100644 --- a/src/gui-in-out-fader.h +++ b/src/gui-in-out-fader.h @@ -24,21 +24,15 @@ #include #include -#include "wrapped.h" -extern "C" { +SCM +gui_IGUIInOutFader_setColor (SCM in_out_fader, + SCM color, + SCM dest_color); +extern "C" { void init_gui_in_out_fader (void); - - DECLARE_WRAPPED_TYPE (irr::gui::IGUIInOutFader*, init_gui_in_out_fader_type, - gui_in_out_fader_p, wrap_gui_in_out_fader, unwrap_gui_in_out_fader); - - SCM - irr_gui_IGUIInOutFader_setColor (SCM wrapped_in_out_fader, - SCM color, - SCM dest_color); - } #endif