X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcolor.cpp;h=d21704d5070dec8790e8e68b1e08bc6734da256e;hb=f02a0f66bfcd16d3c3b08091c1b97b92aeee42fe;hp=a6879c382bf4e9564b12b929f7bb272d8f48f473;hpb=704cf6c2cc3d308c625071f6e03bd20ed2d833f8;p=guile-irrlicht.git diff --git a/src/color.cpp b/src/color.cpp index a6879c3..d21704d 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -21,18 +21,25 @@ #include #include -#include "rect.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))); - } +SCM +scm_from_color (irr::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 ())); +} + +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))); }