From 10b175d2183bb4dbe9a53c773465ed714e890290 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 7 May 2020 13:23:47 +0200 Subject: [PATCH] driver-types --- src/driver-types.cpp | 72 ++++++++++++++++++++++---------------------- src/driver-types.h | 8 ++--- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/src/driver-types.cpp b/src/driver-types.cpp index 886d40d..d0fec50 100644 --- a/src/driver-types.cpp +++ b/src/driver-types.cpp @@ -23,41 +23,41 @@ #include #include "driver-types.h" -extern "C" { - - irr::video::E_DRIVER_TYPE - scm_to_driver_type (SCM driver_type) - { - char* driverType = scm_to_utf8_stringn (scm_symbol_to_string (driver_type), NULL); - if (!strcmp (driverType, "null")) - { - return irr::video::EDT_NULL; - } - else if (!strcmp (driverType, "software")) - { - return irr::video::EDT_SOFTWARE; - } - else if (!strcmp (driverType, "burnings")) - { - return irr::video::EDT_BURNINGSVIDEO; - } - else if (!strcmp (driverType, "direct3d8")) - { - return irr::video::EDT_DIRECT3D8; - } - else if (!strcmp (driverType, "direct3d9")) - { - return irr::video::EDT_DIRECT3D9; - } - else if (!strcmp (driverType, "opengl")) - { - return irr::video::EDT_OPENGL; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong driver type: ~S", - scm_list_1 (driver_type), scm_list_1 (driver_type)); - } - } +using namespace irr; + + +video::E_DRIVER_TYPE +scm_to_driver_type (SCM driver_type) +{ + char* driverType = scm_to_utf8_stringn (scm_symbol_to_string (driver_type), NULL); + if (!strcmp (driverType, "null")) + { + return video::EDT_NULL; + } + else if (!strcmp (driverType, "software")) + { + return video::EDT_SOFTWARE; + } + else if (!strcmp (driverType, "burnings")) + { + return video::EDT_BURNINGSVIDEO; + } + else if (!strcmp (driverType, "direct3d8")) + { + return video::EDT_DIRECT3D8; + } + else if (!strcmp (driverType, "direct3d9")) + { + return video::EDT_DIRECT3D9; + } + else if (!strcmp (driverType, "opengl")) + { + return video::EDT_OPENGL; + } + else + { + scm_error (scm_arg_type_key, NULL, "Wrong driver type: ~S", + scm_list_1 (driver_type), scm_list_1 (driver_type)); + } } diff --git a/src/driver-types.h b/src/driver-types.h index dff3802..acabf0b 100644 --- a/src/driver-types.h +++ b/src/driver-types.h @@ -25,11 +25,7 @@ #include #include -extern "C" { - - irr::video::E_DRIVER_TYPE - scm_to_driver_type (SCM driver_type); - -} +irr::video::E_DRIVER_TYPE +scm_to_driver_type (SCM driver_type); #endif -- 2.39.2