]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
fix gsubr limits
authorJavier Sancho <jsf@jsancho.org>
Sun, 10 May 2020 12:24:25 +0000 (14:24 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 10 May 2020 12:24:25 +0000 (14:24 +0200)
src/material.cpp
src/scene-manager.cpp

index d24c2b428a9c4a1fa99c632b4ae44d35ebc4b70c..4be4054a550d9e7a7893fc44edadbccbc9e1fdd6 100644 (file)
@@ -32,16 +32,65 @@ using namespace irr;
 
 
 SCM
-video_SMaterial_make (SCM material_type, SCM ambient_color, SCM diffuse_color,
-                      SCM emissive_color, SCM specular_color, SCM shininess,
-                      SCM material_type_param, SCM material_type_param_2, SCM thickness,
-                      SCM z_buffer, SCM anti_aliasing, SCM color_mask,
-                      SCM color_material, SCM blend_operation, SCM polygon_offset_factor,
-                      SCM polygon_offset_direction, SCM wireframe, SCM point_cloud,
-                      SCM gouraud_shading, SCM lighting, SCM z_write_enable,
-                      SCM backface_culling, SCM frontface_culling, SCM fog_enable,
-                      SCM normalize_normals, SCM use_mip_maps)
+video_SMaterial_make (SCM rest)
 {
+  SCM material_type;
+  SCM ambient_color;
+  SCM diffuse_color;
+  SCM emissive_color;
+  SCM specular_color;
+  SCM shininess;
+  SCM material_type_param;
+  SCM material_type_param_2;
+  SCM thickness;
+  SCM z_buffer;
+  SCM anti_aliasing;
+  SCM color_mask;
+  SCM color_material;
+  SCM blend_operation;
+  SCM polygon_offset_factor;
+  SCM polygon_offset_direction;
+  SCM wireframe;
+  SCM point_cloud;
+  SCM gouraud_shading;
+  SCM lighting;
+  SCM z_write_enable;
+  SCM backface_culling;
+  SCM frontface_culling;
+  SCM fog_enable;
+  SCM normalize_normals;
+  SCM use_mip_maps;
+
+  scm_c_bind_keyword_arguments
+    ("video_SMaterial_make", rest, (scm_t_keyword_arguments_flags)0,
+     scm_from_utf8_keyword ("material-type"), &material_type,
+     scm_from_utf8_keyword ("ambient-color"), &ambient_color,
+     scm_from_utf8_keyword ("diffuse-color"), &diffuse_color,
+     scm_from_utf8_keyword ("emissive-color"), &emissive_color,
+     scm_from_utf8_keyword ("specular-color"), &specular_color,
+     scm_from_utf8_keyword ("shininess"), &shininess,
+     scm_from_utf8_keyword ("material-type-param"), &material_type_param,
+     scm_from_utf8_keyword ("material-type-param-2"), &material_type_param_2,
+     scm_from_utf8_keyword ("thickness"), &thickness,
+     scm_from_utf8_keyword ("z-buffer"), &z_buffer,
+     scm_from_utf8_keyword ("anti-aliasing"), &anti_aliasing,
+     scm_from_utf8_keyword ("color-mask"), &color_mask,
+     scm_from_utf8_keyword ("color-material"), &color_material,
+     scm_from_utf8_keyword ("blend-operation"), &blend_operation,
+     scm_from_utf8_keyword ("polygon-offset-factor"), &polygon_offset_factor,
+     scm_from_utf8_keyword ("polygon-offset-direction"), &polygon_offset_direction,
+     scm_from_utf8_keyword ("wireframe"), &wireframe,
+     scm_from_utf8_keyword ("point-cloud"), &point_cloud,
+     scm_from_utf8_keyword ("gouraud-shading"), &gouraud_shading,
+     scm_from_utf8_keyword ("lighting"), &lighting,
+     scm_from_utf8_keyword ("z-write-enable"), &z_write_enable,
+     scm_from_utf8_keyword ("backface-culling"), &backface_culling,
+     scm_from_utf8_keyword ("frontface-culling"), &frontface_culling,
+     scm_from_utf8_keyword ("fog-enable"), &fog_enable,
+     scm_from_utf8_keyword ("normalize-normals"), &normalize_normals,
+     scm_from_utf8_keyword ("use-mip-maps"), &use_mip_maps,
+     SCM_UNDEFINED);
+
   video::SMaterial* material = new video::SMaterial ();
   material->MaterialType = scm_to_material_type(material_type);
   material->AmbientColor = scm_to_color (ambient_color);
@@ -74,11 +123,11 @@ video_SMaterial_make (SCM material_type, SCM ambient_color, SCM diffuse_color,
 
 
 extern "C" {
-  
+
   void
   init_material (void)
   {
-    DEFINE_GSUBR ("video_SMaterial_make", 26, 0, 0, video_SMaterial_make);
+    DEFINE_GSUBR ("video_SMaterial_make", 0, 0, 1, video_SMaterial_make);
   }
 
 }
index c1c8e270611c294a92fe6cc8822cbe0f58e9369b..51e561ad4c5159861294c5d03e8dc63dde7689cb 100644 (file)
@@ -76,17 +76,33 @@ scene_ISceneManager_addCameraSceneNode (SCM scene_manager,
 template <typename TParent>
 SCM
 scene_ISceneManager_addCameraSceneNodeFPS (SCM scene_manager,
-                                           SCM parent,
-                                           SCM rotate_speed,
-                                           SCM move_speed,
-                                           SCM id,
-                                           SCM key_map_array,
-                                           SCM key_map_size,
-                                           SCM no_vertical_movement,
-                                           SCM jump_speed,
-                                           SCM invert_mouse,
-                                           SCM make_active)
+                                           SCM rest)
 {
+  SCM parent;
+  SCM rotate_speed;
+  SCM move_speed;
+  SCM id;
+  SCM key_map_array;
+  SCM key_map_size;
+  SCM no_vertical_movement;
+  SCM jump_speed;
+  SCM invert_mouse;
+  SCM make_active;
+
+  scm_c_bind_keyword_arguments ("scene_ISceneManager_addCameraSceneNodeFPS",
+                                rest, (scm_t_keyword_arguments_flags)0,
+                                scm_from_utf8_keyword ("parent"), &parent,
+                                scm_from_utf8_keyword ("rotate-speed"), &rotate_speed,
+                                scm_from_utf8_keyword ("move-speed"), &move_speed,
+                                scm_from_utf8_keyword ("id"), &id,
+                                scm_from_utf8_keyword ("key-map-array"), &key_map_array,
+                                scm_from_utf8_keyword ("key-map-size"), &key_map_size,
+                                scm_from_utf8_keyword ("no-vertical-movement"), &no_vertical_movement,
+                                scm_from_utf8_keyword ("jump-speed"), &jump_speed,
+                                scm_from_utf8_keyword ("invert-mouse"), &invert_mouse,
+                                scm_from_utf8_keyword ("make-active"), &make_active,
+                                SCM_UNDEFINED);
+
   scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
   scene::ICameraSceneNode* camera =
     smgr->addCameraSceneNodeFPS ((TParent) scm_to_pointer (parent),
@@ -341,7 +357,7 @@ extern "C" {
                   scene_ISceneManager_addAnimatedMeshSceneNode<scene::ISceneNode*>);
     DEFINE_GSUBR ("scene_ISceneManager_addCameraSceneNode_ISceneNode", 6, 0, 0,
                   scene_ISceneManager_addCameraSceneNode<scene::ISceneNode*>);
-    DEFINE_GSUBR ("scene_ISceneManager_addCameraSceneNodeFPS_ISceneNode", 11, 0, 0,
+    DEFINE_GSUBR ("scene_ISceneManager_addCameraSceneNodeFPS_ISceneNode", 1, 0, 1,
                   scene_ISceneManager_addCameraSceneNodeFPS<scene::ISceneNode*>);
     DEFINE_GSUBR ("scene_ISceneManager_addCubeSceneNode_ISceneNode", 7, 0, 0,
                   scene_ISceneManager_addCubeSceneNode<scene::ISceneNode*>);