From c126b0718ca4ffff463c4462ca38f61019df4acf Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Mon, 13 Dec 2021 10:41:30 -0500
Subject: tas_input: Make TasAxes enum an enum class

Prevents these values from potentially clashing with anything in other
headers.
---
 src/input_common/drivers/tas_input.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'src/input_common/drivers/tas_input.cpp')

diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index 0e01fb0d96..1a38616b49 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -15,7 +15,7 @@
 
 namespace InputCommon::TasInput {
 
-enum TasAxes : u8 {
+enum class Tas::TasAxis : u8 {
     StickX,
     StickY,
     SubstickX,
@@ -205,10 +205,10 @@ void Tas::UpdateThread() {
                 const int button = static_cast<int>(i);
                 SetButton(identifier, button, button_status);
             }
-            SetAxis(identifier, TasAxes::StickX, command.l_axis.x);
-            SetAxis(identifier, TasAxes::StickY, command.l_axis.y);
-            SetAxis(identifier, TasAxes::SubstickX, command.r_axis.x);
-            SetAxis(identifier, TasAxes::SubstickY, command.r_axis.y);
+            SetTasAxis(identifier, TasAxis::StickX, command.l_axis.x);
+            SetTasAxis(identifier, TasAxis::StickY, command.l_axis.y);
+            SetTasAxis(identifier, TasAxis::SubstickX, command.r_axis.x);
+            SetTasAxis(identifier, TasAxis::SubstickY, command.r_axis.y);
         }
     } else {
         is_running = Settings::values.tas_loop.GetValue();
@@ -267,6 +267,10 @@ std::string Tas::WriteCommandAxis(TasAnalog analog) const {
     return fmt::format("{};{}", analog.x * 32767, analog.y * 32767);
 }
 
+void Tas::SetTasAxis(const PadIdentifier& identifier, TasAxis axis, f32 value) {
+    SetAxis(identifier, static_cast<int>(axis), value);
+}
+
 void Tas::StartStop() {
     if (!Settings::values.tas_enable) {
         return;
-- 
cgit v1.2.3-70-g09d2