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

index 2593c756dbb738c21eece6746b4e995d27abb6ad..8cd2a505abdfe3714fe51b01b17456af30991e8c 100644 (file)
 #include <libguile.h>
 #include "primitive-types.h"
 
-extern "C" {
 
-  irr::scene::E_PRIMITIVE_TYPE
-  scm_to_primitive_type (SCM primitive_type)
-  {
-    char* type = scm_to_utf8_stringn (scm_symbol_to_string (primitive_type), NULL);
-    if (!strcmp (type, "points"))
-      {
-        return irr::scene::EPT_POINTS;
-      }
-    else if (!strcmp (type, "line-strip"))
-      {
-        return irr::scene::EPT_LINE_STRIP;
-      }
-    else if (!strcmp (type, "line-loop"))
-      {
-        return irr::scene::EPT_LINE_LOOP;
-      }
-    else if (!strcmp (type, "lines"))
-      {
-        return irr::scene::EPT_LINES;
-      }
-    else if (!strcmp (type, "triangle-strip"))
-      {
-        return irr::scene::EPT_TRIANGLE_STRIP;
-      }
-    else if (!strcmp (type, "triangle-fan"))
-      {
-        return irr::scene::EPT_TRIANGLE_FAN;
-      }
-    else if (!strcmp (type, "triangles"))
-      {
-        return irr::scene::EPT_TRIANGLES;
-      }
-    else if (!strcmp (type, "quad-strip"))
-      {
-        return irr::scene::EPT_QUAD_STRIP;
-      }
-    else if (!strcmp (type, "quads"))
-      {
-        return irr::scene::EPT_QUADS;
-      }
-    else if (!strcmp (type, "polygon"))
-      {
-        return irr::scene::EPT_POLYGON;
-      }
-    else if (!strcmp (type, "point-sprites"))
-      {
-        return irr::scene::EPT_POINT_SPRITES;
-      }
-    else
-      {
-        scm_error (scm_arg_type_key, NULL, "Wrong primitive type: ~S",
-                   scm_list_1 (primitive_type), scm_list_1 (primitive_type));
-      }
-  }
+using namespace irr;
 
+
+scene::E_PRIMITIVE_TYPE
+scm_to_primitive_type (SCM primitive_type)
+{
+  char* type = scm_to_utf8_stringn (scm_symbol_to_string (primitive_type), NULL);
+  if (!strcmp (type, "points"))
+    {
+      return scene::EPT_POINTS;
+    }
+  else if (!strcmp (type, "line-strip"))
+    {
+      return scene::EPT_LINE_STRIP;
+    }
+  else if (!strcmp (type, "line-loop"))
+    {
+      return scene::EPT_LINE_LOOP;
+    }
+  else if (!strcmp (type, "lines"))
+    {
+      return scene::EPT_LINES;
+    }
+  else if (!strcmp (type, "triangle-strip"))
+    {
+      return scene::EPT_TRIANGLE_STRIP;
+    }
+  else if (!strcmp (type, "triangle-fan"))
+    {
+      return scene::EPT_TRIANGLE_FAN;
+    }
+  else if (!strcmp (type, "triangles"))
+    {
+      return scene::EPT_TRIANGLES;
+    }
+  else if (!strcmp (type, "quad-strip"))
+    {
+      return scene::EPT_QUAD_STRIP;
+    }
+  else if (!strcmp (type, "quads"))
+    {
+      return scene::EPT_QUADS;
+    }
+  else if (!strcmp (type, "polygon"))
+    {
+      return scene::EPT_POLYGON;
+    }
+  else if (!strcmp (type, "point-sprites"))
+    {
+      return scene::EPT_POINT_SPRITES;
+    }
+  else
+    {
+      scm_error (scm_arg_type_key, NULL, "Wrong primitive type: ~S",
+                 scm_list_1 (primitive_type), scm_list_1 (primitive_type));
+    }
 }
index a3c8bb652da62c7ed843cd4a4c70f041c7082ebd..09ca8dfa8183c9cbfec6a109865faf7331a6caad 100644 (file)
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
 
-extern "C" {
-
-  irr::scene::E_PRIMITIVE_TYPE
-  scm_to_primitive_type (SCM primitive_type);
-
-}
+irr::scene::E_PRIMITIVE_TYPE
+scm_to_primitive_type (SCM primitive_type);
 
 #endif