#include <irrlicht/irrlicht.h>
#include <libguile.h>
-extern "C" {
- irr::video::E_MATERIAL_FLAG
- scm_to_material_flag (SCM material_flag)
- {
- char* flag = scm_to_utf8_stringn (scm_symbol_to_string (material_flag), NULL);
- if (!strcmp (flag, "wireframe"))
- {
- return irr::video::EMF_WIREFRAME;
- }
- else if (!strcmp (flag, "pointcloud"))
- {
- return irr::video::EMF_POINTCLOUD;
- }
- else if (!strcmp (flag, "gouraud-shading"))
- {
- return irr::video::EMF_GOURAUD_SHADING;
- }
- else if (!strcmp (flag, "lighting"))
- {
- return irr::video::EMF_LIGHTING;
- }
- else if (!strcmp (flag, "zbuffer"))
- {
- return irr::video::EMF_ZBUFFER;
- }
- else if (!strcmp (flag, "zwrite-enable"))
- {
- return irr::video::EMF_ZWRITE_ENABLE;
- }
- else if (!strcmp (flag, "back-face-culling"))
- {
- return irr::video::EMF_BACK_FACE_CULLING;
- }
- else if (!strcmp (flag, "front-face-culling"))
- {
- return irr::video::EMF_FRONT_FACE_CULLING;
- }
- else if (!strcmp (flag, "bilinear-filter"))
- {
- return irr::video::EMF_BILINEAR_FILTER;
- }
- else if (!strcmp (flag, "trilinear-filter"))
- {
- return irr::video::EMF_TRILINEAR_FILTER;
- }
- else if (!strcmp (flag, "anisotropic-filter"))
- {
- return irr::video::EMF_ANISOTROPIC_FILTER;
- }
- else if (!strcmp (flag, "fog-enable"))
- {
- return irr::video::EMF_FOG_ENABLE;
- }
- else if (!strcmp (flag, "normalize-normals"))
- {
- return irr::video::EMF_NORMALIZE_NORMALS;
- }
- else if (!strcmp (flag, "texture-wrap"))
- {
- return irr::video::EMF_TEXTURE_WRAP;
- }
- else if (!strcmp (flag, "anti-aliasing"))
- {
- return irr::video::EMF_ANTI_ALIASING;
- }
- else if (!strcmp (flag, "color-mask"))
- {
- return irr::video::EMF_COLOR_MASK;
- }
- else if (!strcmp (flag, "color-material"))
- {
- return irr::video::EMF_COLOR_MATERIAL;
- }
- else if (!strcmp (flag, "use-mip-maps"))
- {
- return irr::video::EMF_USE_MIP_MAPS;
- }
- else if (!strcmp (flag, "blend-operation"))
- {
- return irr::video::EMF_BLEND_OPERATION;
- }
- else if (!strcmp (flag, "polygon-offset"))
- {
- return irr::video::EMF_POLYGON_OFFSET;
- }
- else
- {
- scm_error (scm_arg_type_key, NULL, "Wrong material flag: ~S",
- scm_list_1 (material_flag), scm_list_1 (material_flag));
- }
- }
+using namespace irr;
+
+video::E_MATERIAL_FLAG
+scm_to_material_flag (SCM material_flag)
+{
+ char* flag = scm_to_utf8_stringn (scm_symbol_to_string (material_flag), NULL);
+ if (!strcmp (flag, "wireframe"))
+ {
+ return video::EMF_WIREFRAME;
+ }
+ else if (!strcmp (flag, "pointcloud"))
+ {
+ return video::EMF_POINTCLOUD;
+ }
+ else if (!strcmp (flag, "gouraud-shading"))
+ {
+ return video::EMF_GOURAUD_SHADING;
+ }
+ else if (!strcmp (flag, "lighting"))
+ {
+ return video::EMF_LIGHTING;
+ }
+ else if (!strcmp (flag, "zbuffer"))
+ {
+ return video::EMF_ZBUFFER;
+ }
+ else if (!strcmp (flag, "zwrite-enable"))
+ {
+ return video::EMF_ZWRITE_ENABLE;
+ }
+ else if (!strcmp (flag, "back-face-culling"))
+ {
+ return video::EMF_BACK_FACE_CULLING;
+ }
+ else if (!strcmp (flag, "front-face-culling"))
+ {
+ return video::EMF_FRONT_FACE_CULLING;
+ }
+ else if (!strcmp (flag, "bilinear-filter"))
+ {
+ return video::EMF_BILINEAR_FILTER;
+ }
+ else if (!strcmp (flag, "trilinear-filter"))
+ {
+ return video::EMF_TRILINEAR_FILTER;
+ }
+ else if (!strcmp (flag, "anisotropic-filter"))
+ {
+ return video::EMF_ANISOTROPIC_FILTER;
+ }
+ else if (!strcmp (flag, "fog-enable"))
+ {
+ return video::EMF_FOG_ENABLE;
+ }
+ else if (!strcmp (flag, "normalize-normals"))
+ {
+ return video::EMF_NORMALIZE_NORMALS;
+ }
+ else if (!strcmp (flag, "texture-wrap"))
+ {
+ return video::EMF_TEXTURE_WRAP;
+ }
+ else if (!strcmp (flag, "anti-aliasing"))
+ {
+ return video::EMF_ANTI_ALIASING;
+ }
+ else if (!strcmp (flag, "color-mask"))
+ {
+ return video::EMF_COLOR_MASK;
+ }
+ else if (!strcmp (flag, "color-material"))
+ {
+ return video::EMF_COLOR_MATERIAL;
+ }
+ else if (!strcmp (flag, "use-mip-maps"))
+ {
+ return video::EMF_USE_MIP_MAPS;
+ }
+ else if (!strcmp (flag, "blend-operation"))
+ {
+ return video::EMF_BLEND_OPERATION;
+ }
+ else if (!strcmp (flag, "polygon-offset"))
+ {
+ return video::EMF_POLYGON_OFFSET;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong material flag: ~S",
+ scm_list_1 (material_flag), scm_list_1 (material_flag));
+ }
}