diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 79cb6f30bd..3c8a0a4d9a 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -27,7 +27,7 @@ add_openmw_dir (mwrender add_openmw_dir (mwinput actions actionmanager bindingsmanager controllermanager controlswitch - inputmanagerimp mousemanager keyboardmanager gyroaxis sensormanager gyromanager + inputmanagerimp mousemanager keyboardmanager sensormanager gyromanager ) add_openmw_dir (mwgui diff --git a/apps/openmw/mwinput/gyroaxis.cpp b/apps/openmw/mwinput/gyroaxis.cpp deleted file mode 100644 index 3eb71fb30b..0000000000 --- a/apps/openmw/mwinput/gyroaxis.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "gyroaxis.hpp" - -namespace MWInput -{ - GyroscopeAxis gyroscopeAxisFromString(std::string_view s) - { - if (s == "x") - return GyroscopeAxis::X; - else if (s == "y") - return GyroscopeAxis::Y; - else if (s == "z") - return GyroscopeAxis::Z; - else if (s == "-x") - return GyroscopeAxis::Minus_X; - else if (s == "-y") - return GyroscopeAxis::Minus_Y; - else if (s == "-z") - return GyroscopeAxis::Minus_Z; - - return GyroscopeAxis::Unknown; - } -} diff --git a/apps/openmw/mwinput/gyroaxis.hpp b/apps/openmw/mwinput/gyroaxis.hpp deleted file mode 100644 index 542217351d..0000000000 --- a/apps/openmw/mwinput/gyroaxis.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MWINPUT_GYROAXIS -#define MWINPUT_GYROAXIS - -#include - -namespace MWInput -{ - enum GyroscopeAxis - { - Unknown = 0, - X = 1, - Y = 2, - Z = 3, - Minus_X = -1, - Minus_Y = -2, - Minus_Z = -3 - }; - - GyroscopeAxis gyroscopeAxisFromString(std::string_view s); -} - -#endif // !MWINPUT_GYROAXIS diff --git a/apps/openmw/mwinput/gyromanager.cpp b/apps/openmw/mwinput/gyromanager.cpp index e06f9ac08d..b0c6f121c5 100644 --- a/apps/openmw/mwinput/gyromanager.cpp +++ b/apps/openmw/mwinput/gyromanager.cpp @@ -7,6 +7,24 @@ namespace MWInput { + GyroManager::GyroscopeAxis GyroManager::gyroscopeAxisFromString(std::string_view s) + { + if (s == "x") + return GyroscopeAxis::X; + else if (s == "y") + return GyroscopeAxis::Y; + else if (s == "z") + return GyroscopeAxis::Z; + else if (s == "-x") + return GyroscopeAxis::Minus_X; + else if (s == "-y") + return GyroscopeAxis::Minus_Y; + else if (s == "-z") + return GyroscopeAxis::Minus_Z; + + return GyroscopeAxis::Unknown; + } + GyroManager::GyroManager() : mEnabled(Settings::Manager::getBool("enable gyroscope", "Input")) , mGuiCursorEnabled(true) diff --git a/apps/openmw/mwinput/gyromanager.hpp b/apps/openmw/mwinput/gyromanager.hpp index ede8eb5c81..bcd3b88f49 100644 --- a/apps/openmw/mwinput/gyromanager.hpp +++ b/apps/openmw/mwinput/gyromanager.hpp @@ -3,8 +3,6 @@ #include -#include "gyroaxis.hpp" - namespace MWInput { class GyroManager @@ -21,6 +19,19 @@ namespace MWInput void setGuiCursorEnabled(bool enabled) { mGuiCursorEnabled = enabled; } private: + enum GyroscopeAxis + { + Unknown = 0, + X = 1, + Y = 2, + Z = 3, + Minus_X = -1, + Minus_Y = -2, + Minus_Z = -3 + }; + + static GyroscopeAxis gyroscopeAxisFromString(std::string_view s); + bool mEnabled; bool mGuiCursorEnabled; float mSensitivityH;