]> git.jsancho.org Git - guile-irrlicht.git/blob - src/EMaterialFlags.cpp
drop refactor
[guile-irrlicht.git] / src / EMaterialFlags.cpp
1 /* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
2
3    Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
4
5    This file is part of guile-irrlicht.
6
7    guile-irrlicht is free software; you can redistribute it and/or modify
8    it under the terms of the GNU Lesser General Public License as
9    published by the Free Software Foundation; either version 3 of the
10    License, or (at your option) any later version.
11
12    guile-irrlicht is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16
17    You should have received a copy of the GNU Lesser General Public
18    License along with guile-irrlicht. If not, see
19    <http://www.gnu.org/licenses/>.
20 */
21
22 #include <irrlicht/irrlicht.h>
23 #include <libguile.h>
24 #include "EMaterialFlags.h"
25
26 extern "C" {
27
28   irr::video::E_MATERIAL_FLAG
29   scm_to_material_flag (SCM material_flag)
30   {
31     char* flag = scm_to_utf8_stringn (scm_symbol_to_string (material_flag), NULL);
32     if (!strcmp (flag, "wireframe"))
33       {
34         return irr::video::EMF_WIREFRAME;
35       }
36     else if (!strcmp (flag, "pointcloud"))
37       {
38         return irr::video::EMF_POINTCLOUD;
39       }
40     else if (!strcmp (flag, "gouraud-shading"))
41       {
42         return irr::video::EMF_GOURAUD_SHADING;
43       }
44     else if (!strcmp (flag, "lighting"))
45       {
46         return irr::video::EMF_LIGHTING;
47       }
48     else if (!strcmp (flag, "zbuffer"))
49       {
50         return irr::video::EMF_ZBUFFER;
51       }
52     else if (!strcmp (flag, "zwrite-enable"))
53       {
54         return irr::video::EMF_ZWRITE_ENABLE;
55       }
56     else if (!strcmp (flag, "back-face-culling"))
57       {
58         return irr::video::EMF_BACK_FACE_CULLING;
59       }
60     else if (!strcmp (flag, "front-face-culling"))
61       {
62         return irr::video::EMF_FRONT_FACE_CULLING;
63       }
64     else if (!strcmp (flag, "bilinear-filter"))
65       {
66         return irr::video::EMF_BILINEAR_FILTER;
67       }
68     else if (!strcmp (flag, "trilinear-filter"))
69       {
70         return irr::video::EMF_TRILINEAR_FILTER;
71       }
72     else if (!strcmp (flag, "anisotropic-filter"))
73       {
74         return irr::video::EMF_ANISOTROPIC_FILTER;
75       }
76     else if (!strcmp (flag, "fog-enable"))
77       {
78         return irr::video::EMF_FOG_ENABLE;
79       }
80     else if (!strcmp (flag, "normalize-normals"))
81       {
82         return irr::video::EMF_NORMALIZE_NORMALS;
83       }
84     else if (!strcmp (flag, "texture-wrap"))
85       {
86         return irr::video::EMF_TEXTURE_WRAP;
87       }
88     else if (!strcmp (flag, "anti-aliasing"))
89       {
90         return irr::video::EMF_ANTI_ALIASING;
91       }
92     else if (!strcmp (flag, "color-mask"))
93       {
94         return irr::video::EMF_COLOR_MASK;
95       }
96     else if (!strcmp (flag, "color-material"))
97       {
98         return irr::video::EMF_COLOR_MATERIAL;
99       }
100     else if (!strcmp (flag, "use-mip-maps"))
101       {
102         return irr::video::EMF_USE_MIP_MAPS;
103       }
104     else if (!strcmp (flag, "blend-operation"))
105       {
106         return irr::video::EMF_BLEND_OPERATION;
107       }
108     else if (!strcmp (flag, "polygon-offset"))
109       {
110         return irr::video::EMF_POLYGON_OFFSET;
111       }
112   }
113
114 }