From: Javier Sancho Date: Sun, 10 May 2020 08:13:01 +0000 (+0200) Subject: material-flags X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=18d3f6b2bd6c9a1433de2e3cc222f48f9cb8254e;p=guile-irrlicht.git material-flags --- diff --git a/src/material-flags.cpp b/src/material-flags.cpp index 0957af6..71fe9a4 100644 --- a/src/material-flags.cpp +++ b/src/material-flags.cpp @@ -22,97 +22,97 @@ #include #include -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)); + } } diff --git a/src/material-flags.h b/src/material-flags.h index 1b1f053..d73f691 100644 --- a/src/material-flags.h +++ b/src/material-flags.h @@ -25,11 +25,7 @@ #include #include -extern "C" { - - irr::video::E_MATERIAL_FLAG - scm_to_material_flag (SCM material_flag); - -} +irr::video::E_MATERIAL_FLAG +scm_to_material_flag (SCM material_flag); #endif