]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/color.cpp
Some doc
[guile-irrlicht.git] / src / color.cpp
index 5ed16fe324100f2d623722e07db11190f68bae22..9308abc696d671f793dc231f599c71630cb50a6d 100644 (file)
 #include <libguile.h>
 #include "color.h"
 
-extern "C" {
-
-  irr::video::SColor
-  scm_to_color (SCM color)
-  {
-    return irr::video::SColor
-      (scm_to_uint32 (scm_car (color)),
-       scm_to_uint32 (scm_cadr (color)),
-       scm_to_uint32 (scm_caddr (color)),
-       scm_to_uint32 (scm_cadddr (color)));
-  }
+using namespace irr;
+
+SCM
+scm_from_color (video::SColor color)
+{
+  return scm_list_4 (scm_from_uint32 (color.getAlpha ()),
+                     scm_from_uint32 (color.getRed ()),
+                     scm_from_uint32 (color.getGreen ()),
+                     scm_from_uint32 (color.getBlue ()));
+}
 
+video::SColor
+scm_to_color (SCM color)
+{
+  return video::SColor
+    (scm_to_uint32 (scm_car (color)),
+     scm_to_uint32 (scm_cadr (color)),
+     scm_to_uint32 (scm_caddr (color)),
+     scm_to_uint32 (scm_cadddr (color)));
 }