]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
gui-in-out-fader
authorJavier Sancho <jsf@jsancho.org>
Sat, 9 May 2020 11:47:31 +0000 (13:47 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sat, 9 May 2020 11:47:31 +0000 (13:47 +0200)
src/gui-in-out-fader.cpp
src/gui-in-out-fader.h

index 41dfc3fcca12cdbed85e40cc029d87a75cb03bd9..e571b30530d5e9e35262edf3abf41d3dfa177285 100644 (file)
 
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
-
 #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);
   }
 
 }
index ee799626c0313793f599f2a40412213c32c37fd3..74c05e1fd994352299bccd64b2455556397b63bd 100644 (file)
 
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
-#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