From aa81b0c480d9d6d8d82de1d574f4cceb6178c722 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sun, 10 May 2020 10:17:24 +0200 Subject: [PATCH] position2d --- src/position2d.cpp | 48 +++++++++++++++++++++++----------------------- src/position2d.h | 16 +++++++--------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/position2d.cpp b/src/position2d.cpp index 20fb743..0e41c50 100644 --- a/src/position2d.cpp +++ b/src/position2d.cpp @@ -23,29 +23,29 @@ #include #include "position2d.h" -extern "C" { - - SCM - scm_from_position2d_s32 (irr::core::position2d position2d) - { - return scm_list_2 (scm_from_int32 (position2d.X), - scm_from_int32 (position2d.Y)); - } - - irr::core::position2d - scm_to_position2d_f32 (SCM position2d) - { - return irr::core::position2d - (scm_to_double (scm_car (position2d)), - scm_to_double (scm_cadr (position2d))); - } - - irr::core::position2d - scm_to_position2d_s32 (SCM position2d) - { - return irr::core::position2d - (scm_to_int32 (scm_car (position2d)), - scm_to_int32 (scm_cadr (position2d))); - } +using namespace irr; + + +SCM +scm_from_position2d_s32 (core::position2d position2d) +{ + return scm_list_2 (scm_from_int32 (position2d.X), + scm_from_int32 (position2d.Y)); +} + +core::position2d +scm_to_position2d_f32 (SCM position2d) +{ + return core::position2d + (scm_to_double (scm_car (position2d)), + scm_to_double (scm_cadr (position2d))); +} + +core::position2d +scm_to_position2d_s32 (SCM position2d) +{ + return core::position2d + (scm_to_int32 (scm_car (position2d)), + scm_to_int32 (scm_cadr (position2d))); } diff --git a/src/position2d.h b/src/position2d.h index e13555b..ed83cff 100644 --- a/src/position2d.h +++ b/src/position2d.h @@ -25,17 +25,15 @@ #include #include -extern "C" { +using namespace irr; - SCM - scm_from_position2d_s32 (irr::core::position2d position2d); +SCM +scm_from_position2d_s32 (core::position2d position2d); - irr::core::position2d - scm_to_position2d_f32 (SCM position2d); +core::position2d +scm_to_position2d_f32 (SCM position2d); - irr::core::position2d - scm_to_position2d_s32 (SCM position2d); - -} +core::position2d +scm_to_position2d_s32 (SCM position2d); #endif -- 2.39.5