- irr::video::E_COLOR_PLANE
- scm_to_color_plane (SCM color_plane)
- {
- char* plane = scm_to_utf8_stringn (scm_symbol_to_string (color_plane), NULL);
- if (!strcmp (plane, "none"))
- {
- return irr::video::ECP_NONE;
- }
- else if (!strcmp (plane, "alpha"))
- {
- return irr::video::ECP_ALPHA;
- }
- else if (!strcmp (plane, "red"))
- {
- return irr::video::ECP_RED;
- }
- else if (!strcmp (plane, "green"))
- {
- return irr::video::ECP_GREEN;
- }
- else if (!strcmp (plane, "blue"))
- {
- return irr::video::ECP_BLUE;
- }
- else if (!strcmp (plane, "rgb"))
- {
- return irr::video::ECP_RGB;
- }
- else if (!strcmp (plane, "all"))
- {
- return irr::video::ECP_ALL;
- }
- else
- {
- scm_error (scm_arg_type_key, NULL, "Wrong color plane: ~S",
- scm_list_1 (color_plane), scm_list_1 (color_plane));
- }
- }
+ if (!strcmp (operation_name, "none"))
+ {
+ operation = video::EBO_NONE;
+ }
+ else if (!strcmp (operation_name, "add"))
+ {
+ operation = video::EBO_ADD;
+ }
+ else if (!strcmp (operation_name, "subtract"))
+ {
+ operation = video::EBO_SUBTRACT;
+ }
+ else if (!strcmp (operation_name, "rev-subtract"))
+ {
+ operation = video::EBO_REVSUBTRACT;
+ }
+ else if (!strcmp (operation_name, "min"))
+ {
+ operation = video::EBO_MIN;
+ }
+ else if (!strcmp (operation_name, "max"))
+ {
+ operation = video::EBO_MAX;
+ }
+ else if (!strcmp (operation_name, "min-factor"))
+ {
+ operation = video::EBO_MIN_FACTOR;
+ }
+ else if (!strcmp (operation_name, "max-factor"))
+ {
+ operation = video::EBO_MAX_FACTOR;
+ }
+ else if (!strcmp (operation_name, "min-alpha"))
+ {
+ operation = video::EBO_MIN_ALPHA;
+ }
+ else if (!strcmp (operation_name, "max-alpha"))
+ {
+ operation = video::EBO_MAX_ALPHA;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong blend operation: ~S",
+ scm_list_1 (blend_operation), scm_list_1 (blend_operation));
+ }
+
+ free (operation_name);
+ return operation;
+}
+
+video::E_COLOR_MATERIAL
+scm_to_color_material (SCM color_material)
+{
+ char* material_name = scm_to_utf8_string (scm_symbol_to_string (color_material));
+ video::E_COLOR_MATERIAL material;
+
+ if (!strcmp (material_name, "none"))
+ {
+ material = video::ECM_NONE;
+ }
+ else if (!strcmp (material_name, "diffuse"))
+ {
+ material = video::ECM_DIFFUSE;
+ }
+ else if (!strcmp (material_name, "ambient"))
+ {
+ material = video::ECM_AMBIENT;
+ }
+ else if (!strcmp (material_name, "emissive"))
+ {
+ material = video::ECM_EMISSIVE;
+ }
+ else if (!strcmp (material_name, "specular"))
+ {
+ material = video::ECM_SPECULAR;
+ }
+ else if (!strcmp (material_name, "diffuse-and-ambient"))
+ {
+ material = video::ECM_DIFFUSE_AND_AMBIENT;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong color material: ~S",
+ scm_list_1 (color_material), scm_list_1 (color_material));
+ }
+
+ free (material_name);
+ return material;
+}
+
+video::E_COLOR_PLANE
+scm_to_color_plane (SCM color_plane)
+{
+ char* plane_name = scm_to_utf8_string (scm_symbol_to_string (color_plane));
+ video::E_COLOR_PLANE plane;
+
+ if (!strcmp (plane_name, "none"))
+ {
+ plane = video::ECP_NONE;
+ }
+ else if (!strcmp (plane_name, "alpha"))
+ {
+ plane = video::ECP_ALPHA;
+ }
+ else if (!strcmp (plane_name, "red"))
+ {
+ plane = video::ECP_RED;
+ }
+ else if (!strcmp (plane_name, "green"))
+ {
+ plane = video::ECP_GREEN;
+ }
+ else if (!strcmp (plane_name, "blue"))
+ {
+ plane = video::ECP_BLUE;
+ }
+ else if (!strcmp (plane_name, "rgb"))
+ {
+ plane = video::ECP_RGB;
+ }
+ else if (!strcmp (plane_name, "all"))
+ {
+ plane = video::ECP_ALL;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong color plane: ~S",
+ scm_list_1 (color_plane), scm_list_1 (color_plane));
+ }
+
+ free (plane_name);
+ return plane;
+}
+
+video::E_COMPARISON_FUNC
+scm_to_comparison_func (SCM comparison_func)
+{
+ char* func_name = scm_to_utf8_string (scm_symbol_to_string (comparison_func));
+ video::E_COMPARISON_FUNC func;
+
+ if (!strcmp (func_name, "never"))
+ {
+ func = video::ECFN_NEVER;
+ }
+ else if (!strcmp (func_name, "less-equal"))
+ {
+ func = video::ECFN_LESSEQUAL;
+ }
+ else if (!strcmp (func_name, "equal"))
+ {
+ func = video::ECFN_EQUAL;
+ }
+ else if (!strcmp (func_name, "less"))
+ {
+ func = video::ECFN_LESS;
+ }
+ else if (!strcmp (func_name, "not-equal"))
+ {
+ func = video::ECFN_NOTEQUAL;
+ }
+ else if (!strcmp (func_name, "greater-equal"))
+ {
+ func = video::ECFN_GREATEREQUAL;
+ }
+ else if (!strcmp (func_name, "greater"))
+ {
+ func = video::ECFN_GREATER;
+ }
+ else if (!strcmp (func_name, "always"))
+ {
+ func = video::ECFN_ALWAYS;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong comparison func: ~S",
+ scm_list_1 (comparison_func), scm_list_1 (comparison_func));
+ }
+
+ free (func_name);
+ return func;
+}