aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2024-02-14 12:18:02 -0800
committerGarrett Brown <themagnificentmrb@gmail.com>2024-02-14 16:45:55 -0800
commit23e0b528386e0585bb1d244a9901ade28a3d42be (patch)
tree34428b6aa0b724e222b4191796e4a9278013d356
parentec608f332845b1fd26f2b5c6d7a3f3113ba49268 (diff)
Revert "[Joysticks] Replace magic strings with constants"
This reverts commit 5230ca12c587356843daaa58250688326efcafce.
-rw-r--r--xbmc/games/controllers/CMakeLists.txt8
-rw-r--r--xbmc/games/controllers/DefaultController.cpp34
-rw-r--r--xbmc/games/controllers/DefaultController.h50
-rw-r--r--xbmc/input/joysticks/JoystickEasterEgg.cpp21
4 files changed, 12 insertions, 101 deletions
diff --git a/xbmc/games/controllers/CMakeLists.txt b/xbmc/games/controllers/CMakeLists.txt
index b54f5c0604..b00e1caa4a 100644
--- a/xbmc/games/controllers/CMakeLists.txt
+++ b/xbmc/games/controllers/CMakeLists.txt
@@ -1,9 +1,7 @@
set(SOURCES Controller.cpp
ControllerLayout.cpp
ControllerManager.cpp
- ControllerTranslator.cpp
- DefaultController.cpp
-)
+ ControllerTranslator.cpp)
set(HEADERS Controller.h
ControllerDefinitions.h
@@ -11,8 +9,6 @@ set(HEADERS Controller.h
ControllerLayout.h
ControllerManager.h
ControllerTranslator.h
- ControllerTypes.h
- DefaultController.h
-)
+ ControllerTypes.h)
core_add_library(games_controller)
diff --git a/xbmc/games/controllers/DefaultController.cpp b/xbmc/games/controllers/DefaultController.cpp
deleted file mode 100644
index 58bb464e3d..0000000000
--- a/xbmc/games/controllers/DefaultController.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2024 Team Kodi
- * This file is part of Kodi - https://kodi.tv
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- * See LICENSES/README.md for more information.
- */
-
-#include "DefaultController.h"
-
-using namespace KODI;
-using namespace GAME;
-
-const char* CDefaultController::FEATURE_A = "a";
-const char* CDefaultController::FEATURE_B = "b";
-const char* CDefaultController::FEATURE_X = "x";
-const char* CDefaultController::FEATURE_Y = "y";
-const char* CDefaultController::FEATURE_START = "start";
-const char* CDefaultController::FEATURE_BACK = "back";
-const char* CDefaultController::FEATURE_GUIDE = "guide";
-const char* CDefaultController::FEATURE_UP = "up";
-const char* CDefaultController::FEATURE_RIGHT = "right";
-const char* CDefaultController::FEATURE_DOWN = "down";
-const char* CDefaultController::FEATURE_LEFT = "left";
-const char* CDefaultController::FEATURE_LEFT_THUMB = "leftthumb";
-const char* CDefaultController::FEATURE_RIGHT_THUMB = "rightthumb";
-const char* CDefaultController::FEATURE_LEFT_BUMPER = "leftbumper";
-const char* CDefaultController::FEATURE_RIGHT_BUMPER = "rightbumper";
-const char* CDefaultController::FEATURE_LEFT_TRIGGER = "lefttrigger";
-const char* CDefaultController::FEATURE_RIGHT_TRIGGER = "righttrigger";
-const char* CDefaultController::FEATURE_LEFT_STICK = "leftstick";
-const char* CDefaultController::FEATURE_RIGHT_STICK = "rightstick";
-const char* CDefaultController::FEATURE_LEFT_MOTOR = "leftmotor";
-const char* CDefaultController::FEATURE_RIGHT_MOTOR = "rightmotor";
diff --git a/xbmc/games/controllers/DefaultController.h b/xbmc/games/controllers/DefaultController.h
deleted file mode 100644
index f82ce49748..0000000000
--- a/xbmc/games/controllers/DefaultController.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2024 Team Kodi
- * This file is part of Kodi - https://kodi.tv
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- * See LICENSES/README.md for more information.
- */
-
-#pragma once
-
-namespace KODI
-{
-namespace GAME
-{
-class CDefaultController
-{
-public:
- // Face buttons
- static const char* FEATURE_A;
- static const char* FEATURE_B;
- static const char* FEATURE_X;
- static const char* FEATURE_Y;
- static const char* FEATURE_START;
- static const char* FEATURE_BACK;
- static const char* FEATURE_GUIDE;
- static const char* FEATURE_UP;
- static const char* FEATURE_RIGHT;
- static const char* FEATURE_DOWN;
- static const char* FEATURE_LEFT;
- static const char* FEATURE_LEFT_THUMB;
- static const char* FEATURE_RIGHT_THUMB;
-
- // Shoulder buttons
- static const char* FEATURE_LEFT_BUMPER;
- static const char* FEATURE_RIGHT_BUMPER;
-
- // Triggers
- static const char* FEATURE_LEFT_TRIGGER;
- static const char* FEATURE_RIGHT_TRIGGER;
-
- // Analog sticks
- static const char* FEATURE_LEFT_STICK;
- static const char* FEATURE_RIGHT_STICK;
-
- // Haptics
- static const char* FEATURE_LEFT_MOTOR;
- static const char* FEATURE_RIGHT_MOTOR;
-};
-} // namespace GAME
-} // namespace KODI
diff --git a/xbmc/input/joysticks/JoystickEasterEgg.cpp b/xbmc/input/joysticks/JoystickEasterEgg.cpp
index a25c4baf78..ab02ba0bde 100644
--- a/xbmc/input/joysticks/JoystickEasterEgg.cpp
+++ b/xbmc/input/joysticks/JoystickEasterEgg.cpp
@@ -12,7 +12,6 @@
#include "games/GameServices.h"
#include "games/GameSettings.h"
#include "games/controllers/ControllerIDs.h"
-#include "games/controllers/DefaultController.h"
#include "guilib/GUIAudioManager.h"
#include "guilib/WindowIDs.h"
@@ -23,16 +22,16 @@ const std::map<std::string, std::vector<FeatureName>> CJoystickEasterEgg::m_sequ
{
DEFAULT_CONTROLLER_ID,
{
- GAME::CDefaultController::FEATURE_UP,
- GAME::CDefaultController::FEATURE_UP,
- GAME::CDefaultController::FEATURE_DOWN,
- GAME::CDefaultController::FEATURE_DOWN,
- GAME::CDefaultController::FEATURE_LEFT,
- GAME::CDefaultController::FEATURE_RIGHT,
- GAME::CDefaultController::FEATURE_LEFT,
- GAME::CDefaultController::FEATURE_RIGHT,
- GAME::CDefaultController::FEATURE_B,
- GAME::CDefaultController::FEATURE_A,
+ "up",
+ "up",
+ "down",
+ "down",
+ "left",
+ "right",
+ "left",
+ "right",
+ "b",
+ "a",
},
},
{