From f02a0f66bfcd16d3c3b08091c1b97b92aeee42fe Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sun, 10 May 2020 13:10:16 +0200 Subject: [PATCH] vector3d --- src/vector3d.cpp | 37 +++++++++++++++++++------------------ src/vector3d.h | 12 ++++-------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/vector3d.cpp b/src/vector3d.cpp index 57f5a7d..a192ca6 100644 --- a/src/vector3d.cpp +++ b/src/vector3d.cpp @@ -23,23 +23,24 @@ #include #include "vector3d.h" -extern "C" { - - SCM - scm_from_vector3df (irr::core::vector3df vector3d) - { - return scm_list_3 (scm_from_double (vector3d.X), - scm_from_double (vector3d.Y), - scm_from_double (vector3d.Z)); - } - - irr::core::vector3df - scm_to_vector3df (SCM vector3d) - { - return irr::core::vector3df - (scm_to_double (scm_car (vector3d)), - scm_to_double (scm_cadr (vector3d)), - scm_to_double (scm_caddr (vector3d))); - } +using namespace irr; + + +SCM +scm_from_vector3df (core::vector3df vector3d) +{ + return scm_list_3 (scm_from_double (vector3d.X), + scm_from_double (vector3d.Y), + scm_from_double (vector3d.Z)); +} + + +core::vector3df +scm_to_vector3df (SCM vector3d) +{ + return core::vector3df + (scm_to_double (scm_car (vector3d)), + scm_to_double (scm_cadr (vector3d)), + scm_to_double (scm_caddr (vector3d))); } diff --git a/src/vector3d.h b/src/vector3d.h index c2834ca..c253ebb 100644 --- a/src/vector3d.h +++ b/src/vector3d.h @@ -25,14 +25,10 @@ #include #include -extern "C" { +SCM +scm_from_vector3df (irr::core::vector3df vector3d); - SCM - scm_from_vector3df (irr::core::vector3df vector3d); - - irr::core::vector3df - scm_to_vector3df (SCM vector3d); - -} +irr::core::vector3df +scm_to_vector3df (SCM vector3d); #endif -- 2.39.5