]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
position2d
authorJavier Sancho <jsf@jsancho.org>
Sun, 10 May 2020 08:17:24 +0000 (10:17 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 10 May 2020 08:17:24 +0000 (10:17 +0200)
src/position2d.cpp
src/position2d.h

index 20fb74316f87b04a5e1779a69079fd7e04c4d6a3..0e41c50047e75da3f98b002241e6dd3ff6c2047b 100644 (file)
 #include <libguile.h>
 #include "position2d.h"
 
-extern "C" {
-
-  SCM
-  scm_from_position2d_s32 (irr::core::position2d<irr::s32> position2d)
-  {
-    return scm_list_2 (scm_from_int32 (position2d.X),
-                       scm_from_int32 (position2d.Y));
-  }
-
-  irr::core::position2d<irr::f32>
-  scm_to_position2d_f32 (SCM position2d)
-  {
-    return irr::core::position2d<irr::f32>
-      (scm_to_double (scm_car (position2d)),
-       scm_to_double (scm_cadr (position2d)));
-  }
-
-  irr::core::position2d<irr::s32>
-  scm_to_position2d_s32 (SCM position2d)
-  {
-    return irr::core::position2d<irr::s32>
-      (scm_to_int32 (scm_car (position2d)),
-       scm_to_int32 (scm_cadr (position2d)));
-  }
 
+using namespace irr;
+
+
+SCM
+scm_from_position2d_s32 (core::position2d<s32> position2d)
+{
+  return scm_list_2 (scm_from_int32 (position2d.X),
+                     scm_from_int32 (position2d.Y));
+}
+
+core::position2d<f32>
+scm_to_position2d_f32 (SCM position2d)
+{
+  return core::position2d<f32>
+    (scm_to_double (scm_car (position2d)),
+     scm_to_double (scm_cadr (position2d)));
+}
+
+core::position2d<s32>
+scm_to_position2d_s32 (SCM position2d)
+{
+  return core::position2d<s32>
+    (scm_to_int32 (scm_car (position2d)),
+     scm_to_int32 (scm_cadr (position2d)));
 }
index e13555bacd025a11ac9ddf9653f6263c71f38cdf..ed83cff6a180b6cc7388ae97d31036728090c971 100644 (file)
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
 
-extern "C" {
+using namespace irr;
 
-  SCM
-  scm_from_position2d_s32 (irr::core::position2d<irr::s32> position2d);
+SCM
+scm_from_position2d_s32 (core::position2d<s32> position2d);
 
-  irr::core::position2d<irr::f32>
-  scm_to_position2d_f32 (SCM position2d);
+core::position2d<f32>
+scm_to_position2d_f32 (SCM position2d);
 
-  irr::core::position2d<irr::s32>
-  scm_to_position2d_s32 (SCM position2d);
-
-}
+core::position2d<s32>
+scm_to_position2d_s32 (SCM position2d);
 
 #endif