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

index 57f5a7dbe0d52605f6bc85dbf6309defdb1d56d3..a192ca6a7b9fc72b433ff7477a1c46722cfac1c8 100644 (file)
 #include <libguile.h>
 #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)));
 }
index c2834ca39d0a39ebb34ffa1dc90542d4d512d7b7..c253ebb2765e339fe88ac1551cd803d1423fe7d2 100644 (file)
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
 
-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