diff --git a/targets/app/common/Game.cpp b/targets/app/common/Game.cpp index eca6a2359..5f1446e92 100644 --- a/targets/app/common/Game.cpp +++ b/targets/app/common/Game.cpp @@ -2,7 +2,7 @@ #include "app/common/Game.h" #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" @@ -74,7 +74,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "app/common/Audio/SoundEngine.h" #include "app/common/Colours/ColourTable.h" #include "app/common/DLC/DLCPack.h" @@ -258,7 +258,7 @@ bool Game::DebugArtToolsOn() { #endif void Game::SetDebugSequence(const char* pchSeq) { - InputManager.SetDebugSequence(pchSeq, [this]() -> int { + PlatformInput.SetDebugSequence(pchSeq, [this]() -> int { // printf("sequence matched\n"); m_debugOptions.setDebugOptions(!m_debugOptions.settingsOn()); @@ -624,7 +624,7 @@ float Game::getTrialTimer(void) { bool Game::IsLocalMultiplayerAvailable() { unsigned int connectedControllers = 0; for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) + if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ++connectedControllers; } @@ -635,8 +635,8 @@ bool Game::IsLocalMultiplayerAvailable() { // Found this in GameNetworkManager? // #ifdef 0 // iOtherConnectedControllers = - // InputManager.GetConnectedGamepadCount(); - // if((InputManager.IsPadConnected(userIndex) || + // PlatformInput.GetConnectedGamepadCount(); + // if((PlatformInput.IsPadConnected(userIndex) || // ProfileManager.IsSignedIn(userIndex))) // { // --iOtherConnectedControllers; @@ -644,7 +644,7 @@ bool Game::IsLocalMultiplayerAvailable() { // #else // for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) // { - // if( (i!=userIndex) && (InputManager.IsPadConnected(i) || + // if( (i!=userIndex) && (PlatformInput.IsPadConnected(i) || // ProfileManager.IsSignedIn(i)) ) // { // iOtherConnectedControllers++; diff --git a/targets/app/common/GameSettingsManager.cpp b/targets/app/common/GameSettingsManager.cpp index c79bcbf14..769d903a5 100644 --- a/targets/app/common/GameSettingsManager.cpp +++ b/targets/app/common/GameSettingsManager.cpp @@ -20,7 +20,7 @@ #include "minecraft/server/level/ServerPlayer.h" #include "minecraft/world/entity/player/Player.h" #include "minecraft/world/level/tile/Tile.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" #include "app/common/Audio/SoundEngine.h" @@ -301,37 +301,37 @@ void GameSettingsManager::actionGameSettings(int iPad, eGameSetting eVal) { case eGameSetting_ViewBob: break; case eGameSetting_ControlScheme: - InputManager.SetJoypadMapVal( + PlatformInput.SetJoypadMapVal( iPad, (GameSettingsA[iPad]->usBitmaskValues & 0x30) >> 4); break; case eGameSetting_ControlInvertLook: break; case eGameSetting_ControlSouthPaw: if (GameSettingsA[iPad]->usBitmaskValues & 0x80) { - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX, AXIS_MAP_RX); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY, AXIS_MAP_RY); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX, AXIS_MAP_LX); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY, AXIS_MAP_LY); - InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0, + PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0, TRIGGER_MAP_1); - InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1, + PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1, TRIGGER_MAP_0); } else { - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LX, AXIS_MAP_LX); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_LY, AXIS_MAP_LY); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RX, AXIS_MAP_RX); - InputManager.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY, + PlatformInput.SetJoypadStickAxisMap(iPad, AXIS_MAP_RY, AXIS_MAP_RY); - InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0, + PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_0, TRIGGER_MAP_0); - InputManager.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1, + PlatformInput.SetJoypadStickTriggerMap(iPad, TRIGGER_MAP_1, TRIGGER_MAP_1); } break; diff --git a/targets/app/common/Game_XuiActions.cpp b/targets/app/common/Game_XuiActions.cpp index c68b6f445..0517349bc 100644 --- a/targets/app/common/Game_XuiActions.cpp +++ b/targets/app/common/Game_XuiActions.cpp @@ -430,7 +430,7 @@ void Game::HandleXuiActions(void) { // 4J-PB - cancel any possible std::string verifications // queued with LIVE - // InputManager.CancelAllVerifyInProgress(); + // PlatformInput.CancelAllVerifyInProgress(); // In a split screen, only the primary player actually // quits the game, others just remove their players diff --git a/targets/app/common/LocalizationManager.cpp b/targets/app/common/LocalizationManager.cpp index 3937fce4a..cb5244516 100644 --- a/targets/app/common/LocalizationManager.cpp +++ b/targets/app/common/LocalizationManager.cpp @@ -16,8 +16,8 @@ #include "minecraft/client/Minecraft.h" #include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePackRepository.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "platform/XboxStubs.h" #include "strings.h" @@ -348,8 +348,8 @@ std::wstring LocalizationManager::formatHTMLString( std::wstring LocalizationManager::getActionReplacement( int iPad, unsigned char ucAction) { - unsigned int input = InputManager.GetGameJoypadMaps( - InputManager.GetJoypadMapVal(iPad), ucAction); + unsigned int input = PlatformInput.GetGameJoypadMaps( + PlatformInput.GetJoypadMapVal(iPad), ucAction); std::wstring replacement = L""; diff --git a/targets/app/common/Network/GameNetworkManager.cpp b/targets/app/common/Network/GameNetworkManager.cpp index e7ad30899..97cb21b6a 100644 --- a/targets/app/common/Network/GameNetworkManager.cpp +++ b/targets/app/common/Network/GameNetworkManager.cpp @@ -9,7 +9,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" @@ -1506,7 +1506,7 @@ void CGameNetworkManager::ServerStoppedWait() { // Tick some simple things ProfileManager.Tick(); StorageManager.Tick(); - InputManager.Tick(); + PlatformInput.Tick(); RenderManager.Tick(); ui.tick(); ui.render(); diff --git a/targets/app/common/NetworkController.cpp b/targets/app/common/NetworkController.cpp index d66ff0057..3189229b6 100644 --- a/targets/app/common/NetworkController.cpp +++ b/targets/app/common/NetworkController.cpp @@ -17,7 +17,7 @@ #include "minecraft/world/entity/player/Player.h" #include "minecraft/world/level/tile/Tile.h" #include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Storage.h" #include "app/common/Audio/SoundEngine.h" @@ -384,7 +384,7 @@ void NetworkController::notificationsCallback(void* pParam, case XN_SYS_INPUTDEVICESCHANGED: if (app.GetGameStarted() && g_NetworkManager.IsInSession()) { for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if (!InputManager.IsPadConnected(i) && + if (!PlatformInput.IsPadConnected(i) && Minecraft::GetInstance()->localplayers[i] != nullptr && !ui.IsPauseMenuDisplayed(i) && !ui.IsSceneInStack(i, eUIScene_EndPoem)) { diff --git a/targets/app/common/Tutorial/Constraints/InputConstraint.cpp b/targets/app/common/Tutorial/Constraints/InputConstraint.cpp index e09a1a667..fd63b22d7 100644 --- a/targets/app/common/Tutorial/Constraints/InputConstraint.cpp +++ b/targets/app/common/Tutorial/Constraints/InputConstraint.cpp @@ -1,7 +1,7 @@ #include "InputConstraint.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" bool InputConstraint::isMappingConstrained(int iPad, int mapping) { // If it's a menu button, then we ignore all inputs @@ -10,11 +10,11 @@ bool InputConstraint::isMappingConstrained(int iPad, int mapping) { } // Otherwise see if they map to the same actual button - unsigned char layoutMapping = InputManager.GetJoypadMapVal(iPad); + unsigned char layoutMapping = PlatformInput.GetJoypadMapVal(iPad); // 4J HEG - Replaced the equivalance test with bitwise AND, important in // some mapping configurations (e.g. when comparing two action map values // and one has extra buttons mapped) - return (InputManager.GetGameJoypadMaps(layoutMapping, m_inputMapping) & - InputManager.GetGameJoypadMaps(layoutMapping, mapping)) > 0; + return (PlatformInput.GetGameJoypadMaps(layoutMapping, m_inputMapping) & + PlatformInput.GetGameJoypadMaps(layoutMapping, mapping)) > 0; } diff --git a/targets/app/common/Tutorial/FullTutorial.cpp b/targets/app/common/Tutorial/FullTutorial.cpp index c0d45db3d..4d6fbe1e9 100644 --- a/targets/app/common/Tutorial/FullTutorial.cpp +++ b/targets/app/common/Tutorial/FullTutorial.cpp @@ -3,7 +3,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h" #include "app/common/Tutorial/Constraints/AreaConstraint.h" #include "app/common/Tutorial/Constraints/ChangeStateConstraint.h" diff --git a/targets/app/common/Tutorial/Tasks/ChoiceTask.cpp b/targets/app/common/Tutorial/Tasks/ChoiceTask.cpp index 9847c2981..fbc14d81e 100644 --- a/targets/app/common/Tutorial/Tasks/ChoiceTask.cpp +++ b/targets/app/common/Tutorial/Tasks/ChoiceTask.cpp @@ -3,7 +3,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "app/common/Tutorial/Constraints/InputConstraint.h" #include "app/common/Tutorial/Tasks/TutorialTask.h" #include "app/common/Tutorial/Tutorial.h" @@ -54,12 +54,12 @@ bool ChoiceTask::isCompleted() { return false; if (!m_bConfirmMappingComplete && - InputManager.GetValue(pMinecraft->player->GetXboxPad(), + PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), m_iConfirmMapping) > 0) { m_bConfirmMappingComplete = true; } if (!m_bCancelMappingComplete && - InputManager.GetValue(pMinecraft->player->GetXboxPad(), + PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), m_iCancelMapping) > 0) { m_bCancelMappingComplete = true; } diff --git a/targets/app/common/Tutorial/Tasks/ControllerTask.cpp b/targets/app/common/Tutorial/Tasks/ControllerTask.cpp index c1dce5cdb..62b91e381 100644 --- a/targets/app/common/Tutorial/Tasks/ControllerTask.cpp +++ b/targets/app/common/Tutorial/Tasks/ControllerTask.cpp @@ -6,7 +6,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "minecraft/GameEnums.h" #include "app/common/Tutorial/Constraints/InputConstraint.h" #include "app/common/Tutorial/Tasks/TutorialTask.h" @@ -81,7 +81,7 @@ bool ControllerTask::isCompleted() { for (auto it = southpawCompletedMappings.begin(); it != southpawCompletedMappings.end(); ++it) { if (!it->second) { - if (InputManager.GetValue(pMinecraft->player->GetXboxPad(), + if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), it->first) > 0) { it->second = true; m_uiCompletionMask |= 1 << iCurrent; @@ -95,7 +95,7 @@ bool ControllerTask::isCompleted() { for (auto it = completedMappings.begin(); it != completedMappings.end(); ++it) { if (!it->second) { - if (InputManager.GetValue(pMinecraft->player->GetXboxPad(), + if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), it->first) > 0) { it->second = true; m_uiCompletionMask |= 1 << iCurrent; diff --git a/targets/app/common/Tutorial/Tasks/InfoTask.cpp b/targets/app/common/Tutorial/Tasks/InfoTask.cpp index c9dfc0283..65a41a07e 100644 --- a/targets/app/common/Tutorial/Tasks/InfoTask.cpp +++ b/targets/app/common/Tutorial/Tasks/InfoTask.cpp @@ -5,7 +5,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "app/common/Tutorial/Constraints/InputConstraint.h" #include "app/common/Tutorial/Tasks/TutorialTask.h" #include "app/common/Tutorial/Tutorial.h" @@ -63,7 +63,7 @@ bool InfoTask::isCompleted() { ++it) { bool current = (*it).second; if (!current) { - if (InputManager.GetValue(pMinecraft->player->GetXboxPad(), + if (PlatformInput.GetValue(pMinecraft->player->GetXboxPad(), (*it).first) > 0) { (*it).second = true; bAllComplete = true; diff --git a/targets/app/common/Tutorial/Tutorial.cpp b/targets/app/common/Tutorial/Tutorial.cpp index 9a82d358b..1da388404 100644 --- a/targets/app/common/Tutorial/Tutorial.cpp +++ b/targets/app/common/Tutorial/Tutorial.cpp @@ -6,7 +6,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/App_structs.h" diff --git a/targets/app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp b/targets/app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp index d1fb9835a..b58e60814 100644 --- a/targets/app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp +++ b/targets/app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.cpp @@ -7,8 +7,8 @@ #include #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "minecraft/GameEnums.h" #include "app/common/Tutorial/Tutorial.h" @@ -263,11 +263,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick() { bool bStickInput = false; float fInputX = - InputManager.GetJoypadStick_LX(iPad, false) * + PlatformInput.GetJoypadStick_LX(iPad, false) * ((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu) / 100.0f); // apply the sensitivity float fInputY = - InputManager.GetJoypadStick_LY(iPad, false) * + PlatformInput.GetJoypadStick_LY(iPad, false) * ((float)app.GetGameSettings(iPad, eGameSetting_Sensitivity_InMenu) / 100.0f); // apply the sensitivity diff --git a/targets/app/common/UI/All Platforms/IUIScene_CraftingMenu.cpp b/targets/app/common/UI/All Platforms/IUIScene_CraftingMenu.cpp index af15c437d..f545eed7a 100644 --- a/targets/app/common/UI/All Platforms/IUIScene_CraftingMenu.cpp +++ b/targets/app/common/UI/All Platforms/IUIScene_CraftingMenu.cpp @@ -7,7 +7,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "minecraft/GameEnums.h" diff --git a/targets/app/common/UI/All Platforms/IUIScene_CreativeMenu.cpp b/targets/app/common/UI/All Platforms/IUIScene_CreativeMenu.cpp index 59233e5dc..a446a4a46 100644 --- a/targets/app/common/UI/All Platforms/IUIScene_CreativeMenu.cpp +++ b/targets/app/common/UI/All Platforms/IUIScene_CreativeMenu.cpp @@ -6,7 +6,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/All Platforms/IUIScene_AbstractContainerMenu.h" #include "app/linux/LinuxGame.h" #include "app/linux/Linux_UIController.h" diff --git a/targets/app/common/UI/All Platforms/IUIScene_TradingMenu.cpp b/targets/app/common/UI/All Platforms/IUIScene_TradingMenu.cpp index 30f14552d..c67cc7e70 100644 --- a/targets/app/common/UI/All Platforms/IUIScene_TradingMenu.cpp +++ b/targets/app/common/UI/All Platforms/IUIScene_TradingMenu.cpp @@ -4,7 +4,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/Tutorial/Tutorial.h" #include "app/common/UI/All Platforms/UIEnums.h" #include "app/linux/LinuxGame.h" diff --git a/targets/app/common/UI/Components/UIComponent_Tooltips.h b/targets/app/common/UI/Components/UIComponent_Tooltips.h index e07969066..b0d59aa8c 100644 --- a/targets/app/common/UI/Components/UIComponent_Tooltips.h +++ b/targets/app/common/UI/Components/UIComponent_Tooltips.h @@ -3,7 +3,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Render.h" #include "minecraft/GameEnums.h" #include "app/common/UI/All Platforms/UIEnums.h" diff --git a/targets/app/common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp b/targets/app/common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp index 726eba47b..74d318b85 100644 --- a/targets/app/common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp +++ b/targets/app/common/UI/Scenes/Debug/UIScene_DebugCreateSchematic.cpp @@ -3,8 +3,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h" @@ -130,12 +130,12 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) { case eControl_EndY: case eControl_EndZ: m_keyboardCallbackControl = (eControls)((int)controlId); - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( L"Enter something", L"", 0, 25, [this](bool bRes) -> int { return handleKeyboardComplete(bRes); }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); break; }; } @@ -156,7 +156,7 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, } int UIScene_DebugCreateSchematic::handleKeyboardComplete(bool bRes) { - const char* text = InputManager.GetText(); + const char* text = PlatformInput.GetText(); if (text[0] != '\0') { std::wstring value = convStringToWstring(text); int iVal = 0; diff --git a/targets/app/common/UI/Scenes/Debug/UIScene_DebugOptions.cpp b/targets/app/common/UI/Scenes/Debug/UIScene_DebugOptions.cpp index 87045c669..7a102e0ae 100644 --- a/targets/app/common/UI/Scenes/Debug/UIScene_DebugOptions.cpp +++ b/targets/app/common/UI/Scenes/Debug/UIScene_DebugOptions.cpp @@ -1,6 +1,6 @@ #include "UIScene_DebugOptions.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/Console_Debug_enum.h" #include "app/common/UI/Controls/UIControl_CheckBox.h" #include "app/common/UI/UIScene.h" diff --git a/targets/app/common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp b/targets/app/common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp index 59e3d96b3..187e32296 100644 --- a/targets/app/common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp +++ b/targets/app/common/UI/Scenes/Debug/UIScene_DebugOverlay.cpp @@ -5,7 +5,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Tutorial/Tutorial.h" diff --git a/targets/app/common/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp b/targets/app/common/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp index 581d81420..290445a84 100644 --- a/targets/app/common/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp +++ b/targets/app/common/UI/Scenes/Debug/UIScene_DebugSetCamera.cpp @@ -5,8 +5,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/UI/All Platforms/UIStructs.h" @@ -119,12 +119,12 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) { case eControl_YRot: case eControl_Elevation: m_keyboardCallbackControl = (eControls)((int)controlId); - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( L"Enter something", L"", 0, 25, [this](bool bRes) -> int { return handleKeyboardComplete(bRes); }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); break; }; } @@ -139,7 +139,7 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, } int UIScene_DebugSetCamera::handleKeyboardComplete(bool bRes) { - const char* text = InputManager.GetText(); + const char* text = PlatformInput.GetText(); if (text[0] != '\0') { std::wstring value = convStringToWstring(text); double val = 0; diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp index fd55a5b58..698ab0179 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp @@ -7,8 +7,8 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" @@ -353,7 +353,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { switch ((int)controlId) { case eControl_EditWorldName: { m_bIgnoreInput = true; - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( app.GetString(IDS_CREATE_NEW_WORLD), m_editWorldName.getLabel(), 0, 25, [this](bool bRes) -> int { @@ -361,7 +361,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { // 4J HEG - No reason to set value if keyboard was cancelled if (bRes) { std::wstring str = - convStringToWstring(InputManager.GetText()); + convStringToWstring(PlatformInput.GetText()); if (!str.empty()) { m_editWorldName.setLabel(str); m_worldName = std::move(str); @@ -370,7 +370,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { } return 0; }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); } break; case eControl_GameModeToggle: switch (m_iGameModeId) { @@ -623,7 +623,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() { // the sign-in UI again int connectedControllers = 0; for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) + if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ++connectedControllers; } @@ -990,7 +990,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned( // the sign-in UI again int connectedControllers = 0; for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) + if (PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ++connectedControllers; } diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp index f803dd8b1..62cce0128 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCMainMenu.cpp @@ -1,7 +1,7 @@ #include "UIScene_DLCMainMenu.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/Controls/UIControl_ButtonList.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp index beadbe741..61d7a1b25 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_DLCOffersMenu.cpp @@ -4,7 +4,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Render.h" #include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/Controls/UIControl_DLCList.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp index af1e574e5..8c1776f40 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp @@ -4,8 +4,8 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" @@ -46,7 +46,7 @@ UIScene_EULA::UIScene_EULA(int iPad, void* initData, UILayer* parentLayer) // 4J-PB - If we have a signed in user connected, let's get the DLC now for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if ((InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) { + if ((PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) { if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) { app.StartInstallDLCProcess(i); break; diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp index 64eb2b1f6..138ef39bb 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_Intro.cpp @@ -1,6 +1,6 @@ #include "UIScene_Intro.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/UIScene.h" #include "app/linux/Iggy/include/iggy.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp index f2fd29f87..5ba2df3ff 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp @@ -5,7 +5,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp index 3977355c9..189f29393 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp @@ -4,8 +4,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "app/common/App_Defines.h" @@ -547,21 +547,21 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) { switch ((int)controlId) { case eControl_EditSeed: { m_bIgnoreInput = true; - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( app.GetString(IDS_CREATE_NEW_WORLD_SEED), m_editSeed.getLabel(), 0, 60, [this](bool bRes) -> int { // 4J HEG - No reason to set value if keyboard was cancelled if (bRes) { std::wstring str = - convStringToWstring(InputManager.GetText()); + convStringToWstring(PlatformInput.GetText()); m_editSeed.setLabel(str); m_params->seed = std::move(str); } m_bIgnoreInput = false; return 0; }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); } break; } } diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp index e972b3ff1..9b8356a95 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LeaderboardsMenu.cpp @@ -8,7 +8,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/Console_Debug_enum.h" #include "app/common/Leaderboards/LeaderboardInterface.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp index 45034a7e6..763c88654 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp @@ -5,7 +5,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "app/common/App_Defines.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp index 43676d4d3..1eb606ab5 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp @@ -6,8 +6,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" @@ -823,7 +823,7 @@ int UIScene_LoadOrJoinMenu::handleKeyboardCompleteWorldName(bool bRes) { // 4J HEG - No reason to set value if keyboard was cancelled m_bIgnoreInput = false; if (bRes) { - const char* text = InputManager.GetText(); + const char* text = PlatformInput.GetText(); // check the name is valid if (text[0] != '\0') { } else { @@ -1492,12 +1492,12 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned( .UTF8SaveName, strlen(pClass->m_saveDetails->UTF8SaveName) + 1); // plus null wchar_t* ptr = wSaveName; - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( app.GetString(IDS_RENAME_WORLD_TITLE), wSaveName, 0, 25, [pClass](bool bRes) -> int { return pClass->handleKeyboardCompleteWorldName(bRes); }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); } break; case C4JStorage::EMessage_ResultThirdOption: // delete - diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp index 3b9a12f68..070c56eb8 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp @@ -7,7 +7,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "app/common/App_Defines.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp index c49d994fa..bc11fc542 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Button.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp index 931a8c4f6..c68b0f0ba 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp @@ -2,8 +2,8 @@ #include "UIScene_SaveMessage.h" #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "app/common/UI/Controls/UIControl_Button.h" @@ -39,7 +39,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void* initData, // 4J-PB - If we have a signed in user connected, let's get the DLC now for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if ((InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) { + if ((PlatformInput.IsPadConnected(i) || ProfileManager.IsSignedIn(i))) { if (!app.DLCInstallProcessCompleted() && !app.DLCInstallPending()) { app.StartInstallDLCProcess(i); break; diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp index 0949775d3..508cd538f 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp @@ -1,7 +1,7 @@ #include "UIScene_TrialExitUpsell.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/App_Defines.h" #include "app/common/UI/UIScene.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp index 2de72d80e..f348711ae 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_ControlsMenu.cpp @@ -4,8 +4,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "minecraft/GameEnums.h" #include "app/common/BuildVer/BuildVer.h" #include "app/common/UI/Controls/UIControl_Button.h" @@ -251,7 +251,7 @@ void UIScene_ControlsMenu::PositionAllText(int iPad) { void UIScene_ControlsMenu::PositionText(int iPad, int iTextID, unsigned char ucAction) { - unsigned int uiVal = InputManager.GetGameJoypadMaps( + unsigned int uiVal = PlatformInput.GetGameJoypadMaps( m_iCurrentNavigatedControlsLayout, ucAction); if (uiVal & _360_JOY_BUTTON_A) diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_Credits.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_Credits.cpp index 1897318a1..8d60b0a33 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_Credits.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_Credits.cpp @@ -4,7 +4,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/UILayer.h" #include "app/common/UI/UIScene.h" #include "app/linux/LinuxGame.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp index c290b5781..b8cbb8e83 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_HelpAndOptionsMenu.cpp @@ -1,7 +1,7 @@ #include "UIScene_HelpAndOptionsMenu.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/UILayer.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp index 916bd3dd1..f8030cd5d 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlay.cpp @@ -6,7 +6,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Label.h" #include "app/common/UI/UIScene.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp index c453ff0fa..0b06c417a 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_HowToPlayMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/Controls/UIControl_ButtonList.h" #include "app/common/UI/UILayer.h" #include "app/common/UI/UIScene.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp index f65eb66bd..9f4a3cc83 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.cpp @@ -1,6 +1,6 @@ #include "UIScene_LanguageSelector.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/Controls/UIControl_ButtonList.h" #include "app/common/UI/UILayer.h" #include "app/common/UI/UIScene.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp index 185e50dd0..173ddd7d9 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_ReinstallMenu.cpp @@ -1,7 +1,7 @@ #include "UIScene_ReinstallMenu.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/UI/UILayer.h" #include "app/common/UI/UIScene.h" #include "app/linux/LinuxGame.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp index 6c8ef57cb..d4a7a677c 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsAudioMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Slider.h" #include "app/common/UI/UILayer.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp index 8775cbce6..2b00fb243 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsControlMenu.cpp @@ -2,7 +2,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Slider.h" #include "app/common/UI/UILayer.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp index aad9811cb..e5de3e687 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsGraphicsMenu.cpp @@ -2,7 +2,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp index 1d9533e40..16995bc5c 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsMenu.cpp @@ -1,7 +1,7 @@ #include "UIScene_SettingsMenu.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/UILayer.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp index d9cbf6935..eb53ae30e 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsOptionsMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "minecraft/GameEnums.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp index 103459bf2..ab430aeb2 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SettingsUIMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_CheckBox.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp index a9dc5777e..00729a969 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp @@ -5,7 +5,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "app/common/App_Defines.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp index 2345d8042..32ec0ad59 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AbstractContainerMenu.cpp @@ -4,7 +4,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/TutorialMode.h" #include "app/common/UI/All Platforms/UIStructs.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp index 6e216951c..c6388196e 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.cpp @@ -7,7 +7,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/TutorialEnum.h" @@ -316,20 +316,20 @@ UIControl* UIScene_AnvilMenu::getSection(ESceneSection eSection) { void UIScene_AnvilMenu::handleEditNamePressed() { setIgnoreInput(true); - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( app.GetString(IDS_TITLE_RENAME), m_textInputAnvil.getLabel(), m_iPad, 30, [this](bool bRes) -> int { // 4J HEG - No reason to set value if keyboard was cancelled setIgnoreInput(false); if (bRes) { - std::wstring str = convStringToWstring(InputManager.GetText()); + std::wstring str = convStringToWstring(PlatformInput.GetText()); setEditNameValue(str); m_itemName = std::move(str); updateItemName(); } return 0; }, - C_4JInput::EKeyboardMode_Default); + IPlatformInput::EKeyboardMode_Default); } void UIScene_AnvilMenu::setEditNameValue(const std::wstring& name) { diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h index f7106a6f0..b17e11b65 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_AnvilMenu.h @@ -2,7 +2,7 @@ #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "app/common/Tutorial/TutorialMode.h" #include "app/common/UI/All Platforms/IUIScene_AnvilMenu.h" #include "app/common/UI/All Platforms/UIEnums.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp index cef0b16fa..cf1fdb305 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.cpp @@ -5,7 +5,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/TutorialEnum.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp index 1ac22cb8d..bdba3b2c3 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_CraftingMenu.cpp @@ -1,7 +1,7 @@ #include "UIScene_CraftingMenu.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/Tutorial/Tutorial.h" #include "app/common/Tutorial/TutorialEnum.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp index 955a61c1f..e4907cd16 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_DeathMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Storage.h" #include "minecraft/GameEnums.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp index b4f2dd238..ad3e71681 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_EndPoem.cpp @@ -7,7 +7,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Tutorial/Tutorial.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp index e8f4e7386..394246c94 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameHostOptionsMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/NetworkPlayerInterface.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp index 5f5bb4d07..559ccd2e4 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGameInfoMenu.cpp @@ -3,7 +3,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Console_Debug_enum.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp index f0af5a898..05fa69ef0 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_InGamePlayerOptionsMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/NetworkPlayerInterface.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp index 1f2d7c3b9..6ee8af491 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_PauseMenu.cpp @@ -5,7 +5,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/DLC/DLCManager.h" diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp index a86982b93..bb7f91a6c 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_SignEntryMenu.cpp @@ -1,8 +1,8 @@ #include "UIScene_SignEntryMenu.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_Label.h" @@ -50,10 +50,10 @@ UIScene_SignEntryMenu::UIScene_SignEntryMenu(int iPad, void* _initData, case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_RUSSIAN: m_signRows[i].SetKeyboardType( - C_4JInput::EKeyboardMode_Alphabet); + IPlatformInput::EKeyboardMode_Alphabet); break; default: - m_signRows[i].SetKeyboardType(C_4JInput::EKeyboardMode_Full); + m_signRows[i].SetKeyboardType(IPlatformInput::EKeyboardMode_Full); break; } @@ -158,7 +158,7 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) { case eControl_Line4: { m_iEditingLine = (int)controlId; m_bIgnoreInput = true; - InputManager.RequestKeyboard( + PlatformInput.RequestKeyboard( app.GetString(IDS_SIGN_TITLE), m_textInputLines[m_iEditingLine].getLabel(), m_iPad, 15, [this](bool bRes) -> int { @@ -166,13 +166,13 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) { m_bIgnoreInput = false; if (bRes && m_iEditingLine >= 0 && m_iEditingLine < 4) { std::wstring str = - convStringToWstring(InputManager.GetText()); + convStringToWstring(PlatformInput.GetText()); if (str.size() > 15) str.resize(15); m_textInputLines[m_iEditingLine].setLabel(str); } return 0; }, - C_4JInput::EKeyboardMode_Alphabet); + IPlatformInput::EKeyboardMode_Alphabet); } break; } } diff --git a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp index 7609c73a1..9b5a14269 100644 --- a/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp +++ b/targets/app/common/UI/Scenes/In-Game Menu Screens/UIScene_TeleportMenu.cpp @@ -3,7 +3,7 @@ #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/Console_Debug_enum.h" #include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/NetworkPlayerInterface.h" diff --git a/targets/app/common/UI/Scenes/UIScene_ConnectingProgress.cpp b/targets/app/common/UI/Scenes/UIScene_ConnectingProgress.cpp index c00a2d1ba..ffd65d895 100644 --- a/targets/app/common/UI/Scenes/UIScene_ConnectingProgress.cpp +++ b/targets/app/common/UI/Scenes/UIScene_ConnectingProgress.cpp @@ -1,7 +1,7 @@ #include "UIScene_ConnectingProgress.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" diff --git a/targets/app/common/UI/Scenes/UIScene_FullscreenProgress.cpp b/targets/app/common/UI/Scenes/UIScene_FullscreenProgress.cpp index 61869e35a..182bd1444 100644 --- a/targets/app/common/UI/Scenes/UIScene_FullscreenProgress.cpp +++ b/targets/app/common/UI/Scenes/UIScene_FullscreenProgress.cpp @@ -5,7 +5,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" diff --git a/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp b/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp index 44dbaa8d1..c93d5be06 100644 --- a/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp +++ b/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp @@ -1,6 +1,6 @@ #include "UIScene_Keyboard.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "app/common/App_Defines.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_Label.h" diff --git a/targets/app/common/UI/Scenes/UIScene_MessageBox.cpp b/targets/app/common/UI/Scenes/UIScene_MessageBox.cpp index 348461ba0..62a16ea6f 100644 --- a/targets/app/common/UI/Scenes/UIScene_MessageBox.cpp +++ b/targets/app/common/UI/Scenes/UIScene_MessageBox.cpp @@ -2,7 +2,7 @@ #include "UIScene_MessageBox.h" #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/Controls/UIControl_Button.h" diff --git a/targets/app/common/UI/Scenes/UIScene_QuadrantSignin.cpp b/targets/app/common/UI/Scenes/UIScene_QuadrantSignin.cpp index 1cfb41e50..8f7f0bc00 100644 --- a/targets/app/common/UI/Scenes/UIScene_QuadrantSignin.cpp +++ b/targets/app/common/UI/Scenes/UIScene_QuadrantSignin.cpp @@ -4,8 +4,8 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "app/common/UI/Controls/UIControl_BitmapIcon.h" #include "app/common/UI/Controls/UIControl_Label.h" @@ -137,7 +137,7 @@ int UIScene_QuadrantSignin::SignInReturned(void* pParam, bool bContinue, void UIScene_QuadrantSignin::updateState() { for (unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if (ProfileManager.IsSignedIn(i) && InputManager.IsPadConnected(i)) { + if (ProfileManager.IsSignedIn(i) && PlatformInput.IsPadConnected(i)) { // app.DebugPrintf("Index %d is signed in, display name - '%s'\n", // i, ProfileManager.GetDisplayName(i).data()); @@ -159,7 +159,7 @@ void UIScene_QuadrantSignin::updateState() { m_lastRequestedAvatar = i; } } - } else if (InputManager.IsPadConnected(i)) { + } else if (PlatformInput.IsPadConnected(i)) { // app.DebugPrintf("Index %d is not signed in\n", i); setControllerState(i, eControllerStatus_PressToJoin); @@ -234,7 +234,7 @@ void UIScene_QuadrantSignin::_initQuadrants() { } m_labelDisplayName[i].init(ProfileManager.GetDisplayName(i)); - } else if (InputManager.IsPadConnected(i)) { + } else if (PlatformInput.IsPadConnected(i)) { app.DebugPrintf("Index %d is not signed in\n", i); setControllerState(i, eControllerStatus_PressToJoin); diff --git a/targets/app/common/UI/UIController.cpp b/targets/app/common/UI/UIController.cpp index 8f77249dd..23fe7cf1c 100644 --- a/targets/app/common/UI/UIController.cpp +++ b/targets/app/common/UI/UIController.cpp @@ -10,7 +10,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/Audio/SoundEngine.h" @@ -737,7 +737,7 @@ void UIController::tickInput() { if (!m_bSystemUIShowing) { #if defined(ENABLE_IGGY_PERFMON) if (m_iggyPerfmonEnabled) { - if (InputManager.ButtonPressed(ProfileManager.GetPrimaryPad(), + if (PlatformInput.ButtonPressed(ProfileManager.GetPrimaryPad(), ACTION_MENU_STICK_PRESS)) m_iggyPerfmonEnabled = !m_iggyPerfmonEnabled; } else @@ -765,9 +765,9 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) { bool released = false; // Toggle bool repeat = false; - down = InputManager.ButtonDown(iPad, key); - pressed = InputManager.ButtonPressed(iPad, key); // Toggle - released = InputManager.ButtonReleased(iPad, key); // Toggle + down = PlatformInput.ButtonDown(iPad, key); + pressed = PlatformInput.ButtonPressed(iPad, key); // Toggle + released = PlatformInput.ButtonReleased(iPad, key); // Toggle if (pressed) app.DebugPrintf("Pressed %d\n", key); if (released) app.DebugPrintf("Released %d\n", key); @@ -847,29 +847,29 @@ void UIController::renderScenes() { IggyPerfmonPad pm_pad; pm_pad.bits = 0; - pm_pad.field.dpad_up = InputManager.ButtonPressed( + pm_pad.field.dpad_up = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_UP); - pm_pad.field.dpad_down = InputManager.ButtonPressed( + pm_pad.field.dpad_down = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_DOWN); - pm_pad.field.dpad_left = InputManager.ButtonPressed( + pm_pad.field.dpad_left = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_LEFT); - pm_pad.field.dpad_right = InputManager.ButtonPressed( + pm_pad.field.dpad_right = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_RIGHT); - pm_pad.field.button_up = InputManager.ButtonPressed( + pm_pad.field.button_up = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_Y); - pm_pad.field.button_down = InputManager.ButtonPressed( + pm_pad.field.button_down = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_A); - pm_pad.field.button_left = InputManager.ButtonPressed( + pm_pad.field.button_left = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_X); - pm_pad.field.button_right = InputManager.ButtonPressed( + pm_pad.field.button_right = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_B); - pm_pad.field.shoulder_left_hi = InputManager.ButtonPressed( + pm_pad.field.shoulder_left_hi = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_LEFT_SCROLL); - pm_pad.field.shoulder_right_hi = InputManager.ButtonPressed( + pm_pad.field.shoulder_right_hi = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_RIGHT_SCROLL); - pm_pad.field.trigger_left_low = InputManager.ButtonPressed( + pm_pad.field.trigger_left_low = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_PAGEUP); - pm_pad.field.trigger_right_low = InputManager.ButtonPressed( + pm_pad.field.trigger_right_low = PlatformInput.ButtonPressed( ProfileManager.GetPrimaryPad(), ACTION_MENU_PAGEDOWN); // IggyPerfmonPadFromXInputStatePointer(pm_pad, &xi_pad); @@ -1582,7 +1582,7 @@ void UIController::SetMenuDisplayed(int iPad, bool bVal) { if (bVal) { if (iPad == XUSER_INDEX_ANY) { for (int i = 0; i < XUSER_MAX_COUNT; i++) { - InputManager.SetMenuDisplayed(i, true); + PlatformInput.SetMenuDisplayed(i, true); m_bMenuDisplayed[i] = true; // 4J Stu - Fix for #11018 - Functional: When the controller is // unplugged during active gameplay and plugged back in at the @@ -1590,7 +1590,7 @@ void UIController::SetMenuDisplayed(int iPad, bool bVal) { m_bMenuToBeClosed[i] = false; } } else { - InputManager.SetMenuDisplayed(iPad, true); + PlatformInput.SetMenuDisplayed(iPad, true); m_bMenuDisplayed[iPad] = true; // 4J Stu - Fix for #11018 - Functional: When the controller is // unplugged during active gameplay and plugged back in at the @@ -1618,7 +1618,7 @@ void UIController::CheckMenuDisplayed() { } else { m_bMenuToBeClosed[iPad] = false; m_bMenuDisplayed[iPad] = false; - InputManager.SetMenuDisplayed(iPad, false); + PlatformInput.SetMenuDisplayed(iPad, false); } } } diff --git a/targets/app/common/UI/UIController.h b/targets/app/common/UI/UIController.h index dfd92ec1a..cf808ed11 100644 --- a/targets/app/common/UI/UIController.h +++ b/targets/app/common/UI/UIController.h @@ -21,7 +21,7 @@ #endif #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" #include "app/common/UI/All Platforms/IUIController.h" diff --git a/targets/app/common/UI/UIScene.cpp b/targets/app/common/UI/UIScene.cpp index 8bded15d2..efb0da2f0 100644 --- a/targets/app/common/UI/UIScene.cpp +++ b/targets/app/common/UI/UIScene.cpp @@ -5,7 +5,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Render.h" #include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIStructs.h" diff --git a/targets/app/linux/Linux_Minecraft.cpp b/targets/app/linux/Linux_Minecraft.cpp index 93c109dc2..fe6b4689c 100644 --- a/targets/app/linux/Linux_Minecraft.cpp +++ b/targets/app/linux/Linux_Minecraft.cpp @@ -54,8 +54,8 @@ static void sigsegv_handler(int sig) { // #include "../Common/XUI/XUI_Scene_Container.h" // #include "NetworkManager.h" #include "platform/PlatformTypes.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" @@ -112,302 +112,302 @@ void DefineActions(void) { // Split into Menu actions, and in-game actions - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEUP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEUP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); } @@ -474,12 +474,12 @@ int main(int argc, const char* argv[]) { // Set the number of possible joypad layouts that the user can switch // between, and the number of actions - InputManager.Initialise(1, 5, MINECRAFT_ACTION_MAX, ACTION_MAX_MENU); + PlatformInput.Initialise(1, 5, MINECRAFT_ACTION_MAX, ACTION_MAX_MENU); // Set the default joypad action mappings for Minecraft DefineActions(); - InputManager.SetJoypadMapVal(0, 0); - InputManager.SetKeyRepeatRate(0.3f, 0.2f); + PlatformInput.SetJoypadMapVal(0, 0); + PlatformInput.SetKeyRepeatRate(0.3f, 0.2f); // Initialise the profile manager with the game Title ID, Offer ID, a // profile version number, and the number of profile values and settings @@ -532,7 +532,7 @@ int main(int argc, const char* argv[]) { ui.setScreenSize(fbw, fbh); } app.UpdateTime(); - InputManager.Tick(); + PlatformInput.Tick(); ProfileManager.Tick(); diff --git a/targets/app/windows/src/Windows64_Minecraft.cpp b/targets/app/windows/src/Windows64_Minecraft.cpp index 7b43f2d06..416ebef5e 100644 --- a/targets/app/windows/src/Windows64_Minecraft.cpp +++ b/targets/app/windows/src/Windows64_Minecraft.cpp @@ -74,302 +74,302 @@ void DefineActions(void) { // Split into Menu actions, and in-game actions - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_0, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEUP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_0, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_1, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEUP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_1, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_A, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_A, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_B, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_B, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_X, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_X, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_Y, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_Y, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OK, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OK, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_CANCEL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_CANCEL, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_UP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_DOWN, _360_JOY_BUTTON_DPAD_DOWN | _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_LEFT, _360_JOY_BUTTON_DPAD_LEFT | _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT | _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps( + PlatformInput.SetGameJoypadMaps( MAP_STYLE_2, ACTION_MENU_PAGEUP, _360_JOY_BUTTON_DPAD_UP | _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAGEDOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAGEDOWN, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_RIGHT_SCROLL, _360_JOY_BUTTON_RB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_LEFT_SCROLL, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_JUMP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_JUMP, _360_JOY_BUTTON_LT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_FORWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_FORWARD, _360_JOY_BUTTON_LSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_BACKWARD, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_BACKWARD, _360_JOY_BUTTON_LSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT, _360_JOY_BUTTON_LSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT, _360_JOY_BUTTON_LSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LOOK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_USE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_USE, _360_JOY_BUTTON_RT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_ACTION, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_ACTION, _360_JOY_BUTTON_A); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RIGHT_SCROLL, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT_SCROLL, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_LEFT_SCROLL, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_INVENTORY, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_INVENTORY, _360_JOY_BUTTON_Y); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DROP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DROP, _360_JOY_BUTTON_B); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_SNEAK_TOGGLE, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_SNEAK_TOGGLE, _360_JOY_BUTTON_LB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_CRAFTING, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_GAME_INFO, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAUSEMENU, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_PAUSEMENU, _360_JOY_BUTTON_START); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_STICK_PRESS, _360_JOY_BUTTON_LTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_PRESS, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_PRESS, _360_JOY_BUTTON_RTHUMB); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_UP, _360_JOY_BUTTON_RSTICK_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_DOWN, _360_JOY_BUTTON_RSTICK_DOWN); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_LEFT, _360_JOY_BUTTON_RSTICK_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, ACTION_MENU_OTHER_STICK_RIGHT, _360_JOY_BUTTON_RSTICK_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_LEFT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_RIGHT, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_UP, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP); - InputManager.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_DOWN, + PlatformInput.SetGameJoypadMaps(MAP_STYLE_2, MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN); } @@ -718,12 +718,12 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // Set the number of possible joypad layouts that the user can switch // between, and the number of actions - InputManager.Initialise(1, 3, MINECRAFT_ACTION_MAX, ACTION_MAX_MENU); + PlatformInput.Initialise(1, 3, MINECRAFT_ACTION_MAX, ACTION_MAX_MENU); // Set the default joypad action mappings for Minecraft DefineActions(); - InputManager.SetJoypadMapVal(0, 0); - InputManager.SetKeyRepeatRate(0.3f, 0.2f); + PlatformInput.SetJoypadMapVal(0, 0); + PlatformInput.SetKeyRepeatRate(0.3f, 0.2f); // Initialise the profile manager with the game Title ID, Offer ID, a // profile version number, and the number of profile values and settings @@ -790,7 +790,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // } app.UpdateTime(); - InputManager.Tick(); + PlatformInput.Tick(); // ProfileManager.Tick(); diff --git a/targets/minecraft/client/Minecraft.cpp b/targets/minecraft/client/Minecraft.cpp index a83545736..675b2144c 100644 --- a/targets/minecraft/client/Minecraft.cpp +++ b/targets/minecraft/client/Minecraft.cpp @@ -13,7 +13,7 @@ #include #include -#include "platform/InputActions.h" +#include "platform/input/InputActions.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "platform/sdl2/Storage.h" @@ -104,7 +104,7 @@ #if defined(ENABLE_JAVA_GUIS) #include "minecraft/client/gui/inventory/CreativeInventoryScreen.h" #endif -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "app/common/Minecraft_Macros.h" #include "app/common/Colours/ColourTable.h" #include "app/common/ConsoleGameMode.h" @@ -560,11 +560,11 @@ void Minecraft::setScreen(Screen* screen) { #if defined(ENABLE_JAVA_GUIS) if (screen != nullptr && player != nullptr) { if (player && player->GetXboxPad() != -1) { - InputManager.SetMenuDisplayed(player->GetXboxPad(), true); + PlatformInput.SetMenuDisplayed(player->GetXboxPad(), true); } } else if (player != nullptr) { if (player && player->GetXboxPad() != -1) { - InputManager.SetMenuDisplayed(player->GetXboxPad(), false); + PlatformInput.SetMenuDisplayed(player->GetXboxPad(), false); } } #endif @@ -634,11 +634,11 @@ void Minecraft::destroy() { #if defined(ENABLE_JAVA_GUIS) if (screen != nullptr) { if (player && player->GetXboxPad() != -1) { - InputManager.SetMenuDisplayed(player->GetXboxPad(), true); + PlatformInput.SetMenuDisplayed(player->GetXboxPad(), true); } } else { if (player && player->GetXboxPad() != -1) { - InputManager.SetMenuDisplayed(player->GetXboxPad(), false); + PlatformInput.SetMenuDisplayed(player->GetXboxPad(), false); } } #endif @@ -716,7 +716,7 @@ void Minecraft::updatePlayerViewportAssignments() { for (int i = 0; i < XUSER_MAX_COUNT; i++) { if (localplayers[i] != nullptr) { // Primary player settings decide what the mode is - if (gameServices().getGameSettings(InputManager.GetPrimaryPad(), + if (gameServices().getGameSettings(PlatformInput.GetPrimaryPad(), eGameSetting_SplitScreenVertical)) { localplayers[i]->m_iScreenSection = C4JRender::VIEWPORT_TYPE_SPLIT_LEFT + found; @@ -983,7 +983,7 @@ void Minecraft::removeLocalPlayerIdx(int idx) { } localplayers[idx] = nullptr; - if (idx == InputManager.GetPrimaryPad()) { + if (idx == PlatformInput.GetPrimaryPad()) { // We should never try to remove the Primary player in this way assert(false); /* @@ -1014,9 +1014,9 @@ void Minecraft::createPrimaryLocalPlayer(int iPad) { localplayers[iPad] = player; // gameRenderer->itemInHandRenderer = localitemInHandRenderers[iPad]; // Give them the gamertag if they're signed in - if (ProfileManager.IsSignedIn(InputManager.GetPrimaryPad())) { + if (ProfileManager.IsSignedIn(PlatformInput.GetPrimaryPad())) { user->name = convStringToWstring( - ProfileManager.GetGamertag(InputManager.GetPrimaryPad())); + ProfileManager.GetGamertag(PlatformInput.GetPrimaryPad())); } } @@ -1076,17 +1076,17 @@ void Minecraft::run_middle() { // player has a app action running , or has any crafting // or containers open, don't autosave if (!StorageManager.GetSaveDisabled() && - (gameServices().getXuiAction(InputManager.GetPrimaryPad()) == + (gameServices().getXuiAction(PlatformInput.GetPrimaryPad()) == eAppAction_Idle)) { if (!ui.IsPauseMenuDisplayed( - InputManager.GetPrimaryPad()) && + PlatformInput.GetPrimaryPad()) && !ui.IsIgnoreAutosaveMenuDisplayed( - InputManager.GetPrimaryPad())) { + PlatformInput.GetPrimaryPad())) { // check if the autotimer countdown has reached // zero unsigned char ucAutosaveVal = gameServices().getGameSettings( - InputManager.GetPrimaryPad(), + PlatformInput.GetPrimaryPad(), eGameSetting_Autosave); bool bTrialTexturepack = false; if (!Minecraft::GetInstance() @@ -1123,7 +1123,7 @@ void Minecraft::run_middle() { Log::info("+++Autosave\n"); Log::info("+++++++++++\n"); gameServices().setAction( - InputManager.GetPrimaryPad(), + PlatformInput.GetPrimaryPad(), eAppAction_AutosaveSaveGame); // gameServices().setAutosaveTimerTime(); #if !defined(_CONTENT_PACKAGE) @@ -1219,7 +1219,7 @@ void Minecraft::run_middle() { if (gameServices().isLocalMultiplayerAvailable()) { for (int i = 0; i < XUSER_MAX_COUNT; i++) { if ((localplayers[i] == nullptr) && - InputManager.IsPadConnected(i)) { + PlatformInput.IsPadConnected(i)) { if (!ui.PressStartPlaying(i)) { ui.ShowPressStart(i); } @@ -1236,27 +1236,27 @@ void Minecraft::run_middle() { for (int i = 0; i < XUSER_MAX_COUNT; i++) { if (localplayers[i]) { // 4J-PB - add these to check for coming out of idle - if (InputManager.ButtonPressed(i, + if (PlatformInput.ButtonPressed(i, MINECRAFT_ACTION_JUMP)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_JUMP; - if (InputManager.ButtonPressed(i, MINECRAFT_ACTION_USE)) + if (PlatformInput.ButtonPressed(i, MINECRAFT_ACTION_USE)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_USE; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_INVENTORY)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_INVENTORY; - if (InputManager.ButtonPressed(i, + if (PlatformInput.ButtonPressed(i, MINECRAFT_ACTION_ACTION)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_ACTION; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_CRAFTING)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_CRAFTING; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_PAUSEMENU)) { localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_PAUSEMENU; @@ -1267,7 +1267,7 @@ void Minecraft::run_middle() { pauseGame(); #endif } - if (InputManager.ButtonPressed(i, + if (PlatformInput.ButtonPressed(i, MINECRAFT_ACTION_DROP)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROP; @@ -1275,21 +1275,21 @@ void Minecraft::run_middle() { // 4J-PB - If we're flying, the sneak needs to be held // on to go down if (localplayers[i]->abilities.flying) { - if (InputManager.ButtonDown( + if (PlatformInput.ButtonDown( i, MINECRAFT_ACTION_SNEAK_TOGGLE)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_SNEAK_TOGGLE; } else { - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_SNEAK_TOGGLE)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_SNEAK_TOGGLE; } - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_RENDER_THIRD_PERSON)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_RENDER_THIRD_PERSON; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_GAME_INFO)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_GAME_INFO; @@ -1299,19 +1299,19 @@ void Minecraft::run_middle() { localplayers[i]->ullDpad_last = 0; localplayers[i]->ullDpad_this = 0; localplayers[i]->ullDpad_filtered = 0; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_DPAD_RIGHT)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_CHANGE_SKIN; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_DPAD_UP)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_FLY_TOGGLE; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_DPAD_DOWN)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_RENDER_DEBUG; - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_DPAD_LEFT)) localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_SPAWN_CREEPER; @@ -1328,25 +1328,25 @@ void Minecraft::run_middle() { localplayers[i]->ullDpad_this = 0; int dirCount = 0; - if (InputManager.ButtonDown( + if (PlatformInput.ButtonDown( i, MINECRAFT_ACTION_DPAD_LEFT)) { localplayers[i]->ullDpad_this |= 1LL << MINECRAFT_ACTION_DPAD_LEFT; dirCount++; } - if (InputManager.ButtonDown( + if (PlatformInput.ButtonDown( i, MINECRAFT_ACTION_DPAD_RIGHT)) { localplayers[i]->ullDpad_this |= 1LL << MINECRAFT_ACTION_DPAD_RIGHT; dirCount++; } - if (InputManager.ButtonDown( + if (PlatformInput.ButtonDown( i, MINECRAFT_ACTION_DPAD_UP)) { localplayers[i]->ullDpad_this |= 1LL << MINECRAFT_ACTION_DPAD_UP; dirCount++; } - if (InputManager.ButtonDown( + if (PlatformInput.ButtonDown( i, MINECRAFT_ACTION_DPAD_DOWN)) { localplayers[i]->ullDpad_this |= 1LL << MINECRAFT_ACTION_DPAD_DOWN; @@ -1365,12 +1365,12 @@ void Minecraft::run_middle() { } // for the opacity timer - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_LEFT_SCROLL) || - InputManager.ButtonPressed( + PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_RIGHT_SCROLL)) - // InputManager.ButtonPressed(i, MINECRAFT_ACTION_USE) - // || InputManager.ButtonPressed(i, + // PlatformInput.ButtonPressed(i, MINECRAFT_ACTION_USE) + // || PlatformInput.ButtonPressed(i, // MINECRAFT_ACTION_ACTION)) { gameServices().setOpacityTimer(i); @@ -1382,10 +1382,10 @@ void Minecraft::run_middle() { // exist? They'll be wanting to join the game then bool tryJoin = !pause && !ui.IsIgnorePlayerJoinMenuDisplayed( - InputManager.GetPrimaryPad()) && + PlatformInput.GetPrimaryPad()) && g_NetworkManager.SessionHasSpace() && RenderManager.IsHiDef() && - InputManager.ButtonPressed(i); + PlatformInput.ButtonPressed(i); if (tryJoin) { if (!ui.PressStartPlaying(i)) { ui.ShowPressStart(i); @@ -1393,7 +1393,7 @@ void Minecraft::run_middle() { // did we just get input from a player who // doesn't exist? They'll be wanting to join the // game then - if (InputManager.ButtonPressed( + if (PlatformInput.ButtonPressed( i, MINECRAFT_ACTION_PAUSEMENU)) { // Let them join @@ -1539,7 +1539,7 @@ void Minecraft::run_middle() { // twice with the same time - let's tick the inputmanager // again if (i != 0) { - InputManager.Tick(); + PlatformInput.Tick(); gameServices().handleButtonPresses(); } @@ -1559,13 +1559,13 @@ void Minecraft::run_middle() { if (localplayers[idx] != nullptr) { // any input received? if ((localplayers[idx]->ullButtonsPressed != 0) || - InputManager.GetJoypadStick_LX(idx, false) != + PlatformInput.GetJoypadStick_LX(idx, false) != 0.0f || - InputManager.GetJoypadStick_LY(idx, false) != + PlatformInput.GetJoypadStick_LY(idx, false) != 0.0f || - InputManager.GetJoypadStick_RX(idx, false) != + PlatformInput.GetJoypadStick_RX(idx, false) != 0.0f || - InputManager.GetJoypadStick_RY(idx, false) != + PlatformInput.GetJoypadStick_RY(idx, false) != 0.0f) { localplayers[idx]->ResetInactiveTicks(); } else { @@ -1602,7 +1602,7 @@ void Minecraft::run_middle() { ui.HandleGameTick(); - setLocalPlayerIdx(InputManager.GetPrimaryPad()); + setLocalPlayerIdx(PlatformInput.GetPrimaryPad()); // 4J - added - now do the equivalent of level::animateTick, // but taking into account the positions of all our players @@ -1648,7 +1648,7 @@ void Minecraft::run_middle() { if (!noRender) { bool bFirst = true; - int iPrimaryPad = InputManager.GetPrimaryPad(); + int iPrimaryPad = PlatformInput.GetPrimaryPad(); for (int i = 0; i < XUSER_MAX_COUNT; i++) { if (setLocalPlayerIdx(i)) { RenderManager.StateSetViewport( @@ -2082,14 +2082,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { int* piUse; int* piAlt; - unsigned int uiAction = InputManager.GetGameJoypadMaps( - InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_ACTION); - unsigned int uiJump = InputManager.GetGameJoypadMaps( - InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_JUMP); - unsigned int uiUse = InputManager.GetGameJoypadMaps( - InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_USE); - unsigned int uiAlt = InputManager.GetGameJoypadMaps( - InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_SNEAK_TOGGLE); + unsigned int uiAction = PlatformInput.GetGameJoypadMaps( + PlatformInput.GetJoypadMapVal(iPad), MINECRAFT_ACTION_ACTION); + unsigned int uiJump = PlatformInput.GetGameJoypadMaps( + PlatformInput.GetJoypadMapVal(iPad), MINECRAFT_ACTION_JUMP); + unsigned int uiUse = PlatformInput.GetGameJoypadMaps( + PlatformInput.GetJoypadMapVal(iPad), MINECRAFT_ACTION_USE); + unsigned int uiAlt = PlatformInput.GetGameJoypadMaps( + PlatformInput.GetJoypadMapVal(iPad), MINECRAFT_ACTION_SNEAK_TOGGLE); // Also need to handle PS3 having swapped triggers/bumpers switch (uiAction) { @@ -3228,9 +3228,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { int wheel = 0; unsigned int leftTicks = - InputManager.GetValue(iPad, MINECRAFT_ACTION_LEFT_SCROLL, true); + PlatformInput.GetValue(iPad, MINECRAFT_ACTION_LEFT_SCROLL, true); unsigned int rightTicks = - InputManager.GetValue(iPad, MINECRAFT_ACTION_RIGHT_SCROLL, true); + PlatformInput.GetValue(iPad, MINECRAFT_ACTION_RIGHT_SCROLL, true); if (leftTicks > 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_LEFT_SCROLL)) { wheel = (int)leftTicks; // positive = left @@ -3261,21 +3261,21 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { if (gameMode->isInputAllowed(MINECRAFT_ACTION_ACTION)) { if ((player->ullButtonsPressed & (1LL << MINECRAFT_ACTION_ACTION))) - // if(InputManager.ButtonPressed(iPad, MINECRAFT_ACTION_ACTION) ) + // if(PlatformInput.ButtonPressed(iPad, MINECRAFT_ACTION_ACTION) ) { // printf("MINECRAFT_ACTION_ACTION ButtonPressed"); player->handleMouseClick(0); player->lastClickTick[0] = ticks; } - if (InputManager.ButtonDown(iPad, MINECRAFT_ACTION_ACTION) && + if (PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_ACTION) && ticks - player->lastClickTick[0] >= timer->ticksPerSecond / 4) { // printf("MINECRAFT_ACTION_ACTION ButtonDown"); player->handleMouseClick(0); player->lastClickTick[0] = ticks; } - if (InputManager.ButtonDown(iPad, MINECRAFT_ACTION_ACTION)) { + if (PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_ACTION)) { player->handleMouseDown(0, true); } else { player->handleMouseDown(0, false); @@ -3287,7 +3287,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { // Java game does it, however we may find that the way we had it // previously is more fun to play. /* - if ((InputManager.GetValue(iPad, MINECRAFT_ACTION_USE,true)>0) && + if ((PlatformInput.GetValue(iPad, MINECRAFT_ACTION_USE,true)>0) && gameMode->isInputAllowed(MINECRAFT_ACTION_USE) ) { handleMouseClick(1); @@ -3295,14 +3295,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { } */ if (player->isUsingItem()) { - if (!InputManager.ButtonDown(iPad, MINECRAFT_ACTION_USE)) + if (!PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_USE)) gameMode->releaseUsingItem(player); } else if (gameMode->isInputAllowed(MINECRAFT_ACTION_USE)) { if (player->abilities.instabuild) { // 4J - attempt to handle click in special creative mode fashion // if possible (used for placing blocks at regular intervals) bool didClick = player->creativeModeHandleMouseClick( - 1, InputManager.ButtonDown(iPad, MINECRAFT_ACTION_USE)); + 1, PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_USE)); // If this handler has put us in lastClick_oldRepeat mode then // it is because we aren't placing blocks - behave largely as // the code used to @@ -3316,7 +3316,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { } else { // Otherwise just the original game code for handling // autorepeat - if (InputManager.ButtonDown(iPad, + if (PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_USE) && ticks - player->lastClickTick[1] >= timer->ticksPerSecond / 4) { @@ -3339,7 +3339,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { if (player->isRiding() || player->isSprinting() || player->isSleeping()) autoRepeat = false; - if (InputManager.ButtonDown(iPad, MINECRAFT_ACTION_USE)) { + if (PlatformInput.ButtonDown(iPad, MINECRAFT_ACTION_USE)) { // If the player has just exited a bed, then delay the time // before a repeat key is allowed without releasing if (player->isSleeping()) @@ -3376,7 +3376,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { #if defined(_DEBUG_MENUS_ENABLED) if (gameServices().debugSettingsOn()) { // 4J-PB - debugoverlay for primary player only - if (iPad == InputManager.GetPrimaryPad()) { + if (iPad == PlatformInput.GetPrimaryPad()) { if ((player->ullButtonsPressed & (1LL << MINECRAFT_ACTION_RENDER_DEBUG))) { #if !defined(_CONTENT_PACKAGE) @@ -3498,7 +3498,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { bool selected = false; { - int hotbarSlot = InputManager.GetHotbarSlotPressed(iPad); + int hotbarSlot = PlatformInput.GetHotbarSlotPressed(iPad); if (hotbarSlot >= 0 && hotbarSlot <= 9) { player->inventory->selected = hotbarSlot; selected = true; @@ -3525,7 +3525,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { } } else { // 4J-PB - // if (InputManager.GetValue(iPad, ACTION_MENU_CANCEL) > 0 && + // if (PlatformInput.GetValue(iPad, ACTION_MENU_CANCEL) > 0 && // gameMode->isInputAllowed(ACTION_MENU_CANCEL)) { // setScreen(nullptr); // } @@ -3536,7 +3536,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { // if(!(ui.GetMenuDisplayed(iPad))) // { // wchar_t wchInput; - // if(InputManager.InputDetected(iPad,&wchInput)) + // if(PlatformInput.InputDetected(iPad,&wchInput)) // { // printf("Input Detected!\n"); // @@ -3839,7 +3839,7 @@ void Minecraft::setLevel(MultiPlayerLevel* level, int message /*=-1*/, // If no player has been set, then this is the first level to be set // this game, so set up a primary player & initialise some other things if (player == nullptr) { - int iPrimaryPlayer = InputManager.GetPrimaryPad(); + int iPrimaryPlayer = PlatformInput.GetPrimaryPad(); player = gameMode->createPlayer(level); @@ -4053,11 +4053,11 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) { cameraTargetPlayer = player; // 4J-PB - are we the primary player or a local player? - if (iPad == InputManager.GetPrimaryPad()) { + if (iPad == PlatformInput.GetPrimaryPad()) { createPrimaryLocalPlayer(iPad); // update the debugoptions - gameServices().setGameSettingsDebugMask(InputManager.GetPrimaryPad(), + gameServices().setGameSettingsDebugMask(PlatformInput.GetPrimaryPad(), gameServices().debugGetMask(-1, true)); } else { storeExtraLocalPlayer(iPad); @@ -4498,7 +4498,7 @@ int Minecraft::InGame_SignInReturned(void* pParam, bool bContinue, int iPad) { } } } else if (ProfileManager.IsSignedInLive( - InputManager.GetPrimaryPad()) && + PlatformInput.GetPrimaryPad()) && !ProfileManager.AllowedToPlayMultiplayer(iPad)) { // 4J Stu - Don't allow converting to guests as we don't allow // any guest sign-in while in the game Fix for #66516 - TCR diff --git a/targets/minecraft/client/gui/Gui.cpp b/targets/minecraft/client/gui/Gui.cpp index bf7c23d0a..edd5e9ff7 100644 --- a/targets/minecraft/client/gui/Gui.cpp +++ b/targets/minecraft/client/gui/Gui.cpp @@ -5,7 +5,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "Facing.h" #include "minecraft/GameEnums.h" @@ -335,7 +335,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { // 4J - this is where to set the blend factor for gui things // use the primary player's settings unsigned char ucAlpha = gameServices().getGameSettings( - InputManager.GetPrimaryPad(), eGameSetting_InterfaceOpacity); + PlatformInput.GetPrimaryPad(), eGameSetting_InterfaceOpacity); // If the user has started to navigate their quickselect bar, ignore the // alpha setting, and display at default value diff --git a/targets/minecraft/client/gui/PauseScreen.cpp b/targets/minecraft/client/gui/PauseScreen.cpp index 1f11ea04f..d1d7405a5 100644 --- a/targets/minecraft/client/gui/PauseScreen.cpp +++ b/targets/minecraft/client/gui/PauseScreen.cpp @@ -8,7 +8,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "Button.h" #include "MessageScreen.h" #include "minecraft/GameEnums.h" @@ -33,7 +33,7 @@ void PauseScreen::init() { // 4jcraft: solves the issue of client-side only pausing in the java gui if (g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1) - gameServices().setXuiServerAction(InputManager.GetPrimaryPad(), + gameServices().setXuiServerAction(PlatformInput.GetPrimaryPad(), eXuiServerAction_PauseServer, (void*)true); buttons.push_back(new Button(1, width / 2 - 100, height / 4 + 24 * 5 + yo, I18n::get(L"menu.returnToMenu"))); @@ -91,7 +91,7 @@ void PauseScreen::buttonClicked(Button* button) { exitWorld(minecraft, true); } if (button->id == 4) { - gameServices().setXuiServerAction(InputManager.GetPrimaryPad(), + gameServices().setXuiServerAction(PlatformInput.GetPrimaryPad(), eXuiServerAction_PauseServer, (void*)false); minecraft->setScreen(nullptr); // minecraft->grabMouse(); // 4J - removed diff --git a/targets/minecraft/client/gui/Screen.cpp b/targets/minecraft/client/gui/Screen.cpp index d7095ec8c..dd6c0c685 100644 --- a/targets/minecraft/client/gui/Screen.cpp +++ b/targets/minecraft/client/gui/Screen.cpp @@ -1,8 +1,8 @@ #include "minecraft/IGameServices.h" #include "Screen.h" -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "Button.h" #include "minecraft/GameEnums.h" @@ -44,7 +44,7 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) { // unpausing is done in all scenarios if (g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1) - gameServices().setXuiServerAction(InputManager.GetPrimaryPad(), + gameServices().setXuiServerAction(PlatformInput.GetPrimaryPad(), eXuiServerAction_PauseServer, (void*)false); } } @@ -108,14 +108,14 @@ void Screen::updateEvents() { minecraft->height); int screenWidth = ssc.getWidth(); int screenHeight = ssc.getHeight(); - int xMouse = InputManager.GetMouseX() * screenWidth / fbw; - int yMouse = InputManager.GetMouseY() * screenHeight / fbh - 1; + int xMouse = PlatformInput.GetMouseX() * screenWidth / fbw; + int yMouse = PlatformInput.GetMouseY() * screenHeight / fbh - 1; static bool prevLeftState = false; static bool prevRightState = false; - bool leftState = InputManager.ButtonDown(0, MINECRAFT_ACTION_ACTION); - bool rightState = InputManager.ButtonDown(0, MINECRAFT_ACTION_USE); + bool leftState = PlatformInput.ButtonDown(0, MINECRAFT_ACTION_ACTION); + bool rightState = PlatformInput.ButtonDown(0, MINECRAFT_ACTION_USE); if (leftState && !prevLeftState) { mouseClicked(xMouse, yMouse, 0); diff --git a/targets/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp b/targets/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp index 48d17c954..cf90fe3b4 100644 --- a/targets/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp +++ b/targets/minecraft/client/gui/inventory/CreativeInventoryScreen.cpp @@ -6,8 +6,8 @@ #include #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "AbstractContainerScreen.h" #include "app/common/UI/All Platforms/IUIScene_CreativeMenu.h" @@ -255,11 +255,11 @@ void CreativeInventoryScreen::updateEvents() { int scrollableRows = totalRows - ROWS; if (scrollableRows > 0) { float step = 1.0f / (float)scrollableRows; - if (InputManager.ButtonDown(0, MINECRAFT_ACTION_LEFT_SCROLL)) { + if (PlatformInput.ButtonDown(0, MINECRAFT_ACTION_LEFT_SCROLL)) { currentScroll -= step; currentScroll = std::max(0.0f, std::min(1.0f, currentScroll)); container->scrollTo(currentScroll); - } else if (InputManager.ButtonDown(0, + } else if (PlatformInput.ButtonDown(0, MINECRAFT_ACTION_RIGHT_SCROLL)) { currentScroll += step; currentScroll = std::max(0.0f, std::min(1.0f, currentScroll)); diff --git a/targets/minecraft/client/multiplayer/ClientConnection.cpp b/targets/minecraft/client/multiplayer/ClientConnection.cpp index 5c5531979..d1b8a8405 100644 --- a/targets/minecraft/client/multiplayer/ClientConnection.cpp +++ b/targets/minecraft/client/multiplayer/ClientConnection.cpp @@ -13,7 +13,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "minecraft/GameEnums.h" #include "app/common/App_structs.h" @@ -228,7 +228,7 @@ ClientConnection::ClientConnection(Minecraft* minecraft, Socket* socket, this->minecraft = minecraft; if (iUserIndex < 0) { - m_userIndex = InputManager.GetPrimaryPad(); + m_userIndex = PlatformInput.GetPrimaryPad(); } else { m_userIndex = iUserIndex; } @@ -290,7 +290,7 @@ void ClientConnection::handleLogin(std::shared_ptr packet) { INetworkPlayer* networkPlayer = connection->getSocket()->getPlayer(); int iUserID = -1; - if (m_userIndex == InputManager.GetPrimaryPad()) { + if (m_userIndex == PlatformInput.GetPrimaryPad()) { iUserID = m_userIndex; } else { if (!networkPlayer->IsGuest() && networkPlayer->IsLocal()) { @@ -346,13 +346,13 @@ void ClientConnection::handleLogin(std::shared_ptr packet) { gameServices().setBanListCheck(iUserID, false); } - if (m_userIndex == InputManager.GetPrimaryPad()) { + if (m_userIndex == PlatformInput.GetPrimaryPad()) { if (gameServices().getTutorialMode()) { minecraft->gameMode = new FullTutorialMode( - InputManager.GetPrimaryPad(), minecraft, this); + PlatformInput.GetPrimaryPad(), minecraft, this); } else { minecraft->gameMode = new ConsoleGameMode( - InputManager.GetPrimaryPad(), minecraft, this); + PlatformInput.GetPrimaryPad(), minecraft, this); } Level* dimensionLevel = minecraft->getLevel(packet->dimension); @@ -387,7 +387,7 @@ void ClientConnection::handleLogin(std::shared_ptr packet) { minecraft->player->setCustomSkin(gameServices().getPlayerSkinId(m_userIndex)); minecraft->player->setCustomCape(gameServices().getPlayerCapeId(m_userIndex)); - minecraft->createPrimaryLocalPlayer(InputManager.GetPrimaryPad()); + minecraft->createPrimaryLocalPlayer(PlatformInput.GetPrimaryPad()); minecraft->player->dimension = packet->dimension; minecraft->setScreen(new ReceivingLevelScreen(this)); @@ -412,7 +412,7 @@ void ClientConnection::handleLogin(std::shared_ptr packet) { displayPrivilegeChanges(minecraft->player, startingPrivileges); // update the debugoptions - gameServices().setGameSettingsDebugMask(InputManager.GetPrimaryPad(), + gameServices().setGameSettingsDebugMask(PlatformInput.GetPrimaryPad(), gameServices().debugGetMask(-1, true)); } else { // 4J-PB - this isn't the level we want @@ -1362,12 +1362,12 @@ void ClientConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, if (g_NetworkManager.IsHost() && (reason == DisconnectPacket::eDisconnect_TimeOut || reason == DisconnectPacket::eDisconnect_Overflow) && - m_userIndex == InputManager.GetPrimaryPad() && + m_userIndex == PlatformInput.GetPrimaryPad() && !MinecraftServer::saveOnExitAnswered()) { unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; ui.RequestErrorMessage(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1, - InputManager.GetPrimaryPad(), + PlatformInput.GetPrimaryPad(), &ClientConnection::HostDisconnectReturned, nullptr); } else { @@ -1936,7 +1936,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr packet) { // 4J-PB - if we go straight in from the menus via an invite, we won't // have the DLC info if (gameServices().getTMSGlobalFileListRead() == false) { - gameServices().setTMSAction(InputManager.GetPrimaryPad(), + gameServices().setTMSAction(PlatformInput.GetPrimaryPad(), eTMSAction_TMSPP_RetrieveFiles_RunPlayGame); } } @@ -1951,7 +1951,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr packet) { cantPlayContentRestricted) { DisconnectPacket::eDisconnectReason reason = DisconnectPacket::eDisconnect_NoUGC_Remote; - if (m_userIndex == InputManager.GetPrimaryPad()) { + if (m_userIndex == PlatformInput.GetPrimaryPad()) { if (!isFriendsWithHost) reason = DisconnectPacket::eDisconnect_NotFriendsWithHost; else if (!isAtLeastOneFriend) @@ -1967,7 +1967,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr packet) { "privileges: %d\n", reason); gameServices().setDisconnectReason(reason); - gameServices().setAction(InputManager.GetPrimaryPad(), eAppAction_ExitWorld, + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_ExitWorld, (void*)true); } else { if (!isFriendsWithHost) @@ -2014,7 +2014,7 @@ void ClientConnection::handlePreLogin(std::shared_ptr packet) { // send this before the LoginPacket so that it gets handled first, as // once the LoginPacket is received on the client the game is close to // starting - if (m_userIndex == InputManager.GetPrimaryPad()) { + if (m_userIndex == PlatformInput.GetPrimaryPad()) { Minecraft* pMinecraft = Minecraft::GetInstance(); if (pMinecraft->skins->selectTexturePackById( packet->m_texturePackId)) { @@ -3009,11 +3009,11 @@ void ClientConnection::handleGameEvent( Log::info("handleGameEvent packet for WIN_GAME - %d\n", m_userIndex); // This just allows it to be shown - if (minecraft->localgameModes[InputManager.GetPrimaryPad()] != nullptr) - minecraft->localgameModes[InputManager.GetPrimaryPad()] + if (minecraft->localgameModes[PlatformInput.GetPrimaryPad()] != nullptr) + minecraft->localgameModes[PlatformInput.GetPrimaryPad()] ->getTutorial() ->showTutorialPopup(false); - ui.NavigateToScene(InputManager.GetPrimaryPad(), eUIScene_EndPoem, + ui.NavigateToScene(PlatformInput.GetPrimaryPad(), eUIScene_EndPoem, nullptr, eUILayer_Scene, eUIGroup_Fullscreen); } else if (event == GameEventPacket::START_SAVING) { if (!g_NetworkManager.IsHost()) { @@ -3021,7 +3021,7 @@ void ClientConnection::handleGameEvent( // back-to-back START/STOP packets leave the client stuck in the // loading screen gameServices().setGameStarted(false); - gameServices().setAction(InputManager.GetPrimaryPad(), + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_RemoteServerSave); } } else if (event == GameEventPacket::STOP_SAVING) { @@ -3456,7 +3456,7 @@ int ClientConnection::HostDisconnectReturned( uiIDA[0] = IDS_CONFIRM_CANCEL; uiIDA[1] = IDS_CONFIRM_OK; ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, - uiIDA, 2, InputManager.GetPrimaryPad(), + uiIDA, 2, PlatformInput.GetPrimaryPad(), &ClientConnection::ExitGameAndSaveReturned, nullptr); } else { @@ -3475,7 +3475,7 @@ int ClientConnection::ExitGameAndSaveReturned( // int32_t saveOrCheckpointId = 0; // bool validSave = // StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); - // SentientManager.RecordLevelSaveOrCheckpoint(InputManager.GetPrimaryPad(), + // SentientManager.RecordLevelSaveOrCheckpoint(PlatformInput.GetPrimaryPad(), // saveOrCheckpointId); MinecraftServer::getInstance()->setSaveOnExit(true); } else { diff --git a/targets/minecraft/client/multiplayer/MultiPlayerGameMode.cpp b/targets/minecraft/client/multiplayer/MultiPlayerGameMode.cpp index 906a106d7..274eed236 100644 --- a/targets/minecraft/client/multiplayer/MultiPlayerGameMode.cpp +++ b/targets/minecraft/client/multiplayer/MultiPlayerGameMode.cpp @@ -151,7 +151,7 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) { (Tile::tiles[t]->getDestroyProgress( minecraft->player, minecraft->player->level, x, y, z) >= 1 // ||(gameServices().debugSettingsOn() && - // gameServices().debugGetMask(InputManager.GetPrimaryPad())&(1L< #include "platform/PlatformTypes.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "ClientConnection.h" #include "app/common/Audio/SoundEngine.h" #include "app/common/Console_Debug_enum.h" @@ -123,7 +123,7 @@ void MultiPlayerLevel::tick() { #if !defined(_FINAL_BUILD) bool freezeTime = gameServices().debugSettingsOn() && - gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime); if (!freezeTime) #endif diff --git a/targets/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp b/targets/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp index dcdbfa22d..00df22c57 100644 --- a/targets/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp +++ b/targets/minecraft/client/multiplayer/MultiPlayerLocalPlayer.cpp @@ -72,7 +72,7 @@ void MultiplayerLocalPlayer::tick() { // 4J Added // 4J-PB - changing this to a game host option ot hide gamertags // bool bIsisPrimaryHost=g_NetworkManager.IsHost() && - // (InputManager.GetPrimaryPad()==m_iPad); + // (PlatformInput.GetPrimaryPad()==m_iPad); /*if((gameServices().getGameSettings(m_iPad,eGameSetting_PlayerVisibleInMap)!=0) != m_bShownOnMaps) diff --git a/targets/minecraft/client/player/Input.cpp b/targets/minecraft/client/player/Input.cpp index d41178e7c..c9973d902 100644 --- a/targets/minecraft/client/player/Input.cpp +++ b/targets/minecraft/client/player/Input.cpp @@ -3,8 +3,8 @@ #include -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "LocalPlayer.h" #include "minecraft/GameEnums.h" #include "app/linux/LinuxGame.h" @@ -38,7 +38,7 @@ void Input::tick(LocalPlayer* player) { MINECRAFT_ACTION_LEFT) || pMinecraft->localgameModes[iPad]->isInputAllowed( MINECRAFT_ACTION_RIGHT)) - xa = -InputManager.GetJoypadStick_LX(iPad); + xa = -PlatformInput.GetJoypadStick_LX(iPad); else xa = 0.0f; @@ -46,7 +46,7 @@ void Input::tick(LocalPlayer* player) { MINECRAFT_ACTION_FORWARD) || pMinecraft->localgameModes[iPad]->isInputAllowed( MINECRAFT_ACTION_BACKWARD)) - ya = InputManager.GetJoypadStick_LY(iPad); + ya = PlatformInput.GetJoypadStick_LY(iPad); else ya = 0.0f; @@ -87,7 +87,7 @@ void Input::tick(LocalPlayer* player) { MINECRAFT_ACTION_LOOK_LEFT) || pMinecraft->localgameModes[iPad]->isInputAllowed( MINECRAFT_ACTION_LOOK_RIGHT)) - tx = InputManager.GetJoypadStick_RX(iPad) * + tx = PlatformInput.GetJoypadStick_RX(iPad) * (((float)gameServices().getGameSettings(iPad, eGameSetting_Sensitivity_InGame)) / 100.0f); // apply sensitivity to look @@ -95,7 +95,7 @@ void Input::tick(LocalPlayer* player) { MINECRAFT_ACTION_LOOK_UP) || pMinecraft->localgameModes[iPad]->isInputAllowed( MINECRAFT_ACTION_LOOK_DOWN)) - ty = InputManager.GetJoypadStick_RY(iPad) * + ty = PlatformInput.GetJoypadStick_RY(iPad) * (((float)gameServices().getGameSettings(iPad, eGameSetting_Sensitivity_InGame)) / 100.0f); // apply sensitivity to look @@ -120,11 +120,11 @@ void Input::tick(LocalPlayer* player) { // jumping = controller.isButtonPressed(0); - sprintKey = InputManager.GetValue(iPad, MINECRAFT_ACTION_SPRINT) && + sprintKey = PlatformInput.GetValue(iPad, MINECRAFT_ACTION_SPRINT) && pMinecraft->localgameModes[iPad]->isInputAllowed( MINECRAFT_ACTION_SPRINT); jumping = - InputManager.GetValue(iPad, MINECRAFT_ACTION_JUMP) && + PlatformInput.GetValue(iPad, MINECRAFT_ACTION_JUMP) && pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_JUMP); #ifndef _CONTENT_PACKAGE diff --git a/targets/minecraft/client/player/LocalPlayer.cpp b/targets/minecraft/client/player/LocalPlayer.cpp index ff2fb41d1..9af0f11b3 100644 --- a/targets/minecraft/client/player/LocalPlayer.cpp +++ b/targets/minecraft/client/player/LocalPlayer.cpp @@ -28,8 +28,8 @@ #include "minecraft/world/item/Item.h" #include "minecraft/world/level/tile/Tile.h" // 4J Stu - Added for tutorial callbacks -#include "platform/InputActions.h" -#include "platform/sdl2/Input.h" +#include "platform/input/InputActions.h" +#include "platform/input/input.h" #include "platform/sdl2/Profile.h" #include "platform/sdl2/Render.h" #include "app/common/App_structs.h" @@ -381,7 +381,7 @@ void LocalPlayer::aiStep() { // snap y rotation to nearest 90 degree axis aligned value float yRotSnapped = floorf((yRot / 90.0f) + 0.5f) * 90.0f; - if (InputManager.GetJoypadMapVal(m_iPad) == 0) { + if (PlatformInput.GetJoypadMapVal(m_iPad) == 0) { if (ullDpad_filtered & (1LL << MINECRAFT_ACTION_DPAD_RIGHT)) { xd = -0.15 * cos(yRotSnapped * std::numbers::pi / 180); zd = -0.15 * sin(yRotSnapped * std::numbers::pi / 180); @@ -485,12 +485,12 @@ void LocalPlayer::aiStep() { } // Check if the player is idle and the rich presence needs updated - if (!m_bIsIdle && InputManager.GetIdleSeconds(m_iPad) > PLAYER_IDLE_TIME) { + if (!m_bIsIdle && PlatformInput.GetIdleSeconds(m_iPad) > PLAYER_IDLE_TIME) { ProfileManager.SetCurrentGameActivity(m_iPad, CONTEXT_PRESENCE_IDLE, false); m_bIsIdle = true; } else if (m_bIsIdle && - InputManager.GetIdleSeconds(m_iPad) < PLAYER_IDLE_TIME) { + PlatformInput.GetIdleSeconds(m_iPad) < PLAYER_IDLE_TIME) { // Are we offline or online, and how many players are there if (g_NetworkManager.GetPlayerCount() > 1) { // only do it for this player here - each player will run this code diff --git a/targets/minecraft/client/renderer/GameRenderer.cpp b/targets/minecraft/client/renderer/GameRenderer.cpp index 87228a1eb..461968499 100644 --- a/targets/minecraft/client/renderer/GameRenderer.cpp +++ b/targets/minecraft/client/renderer/GameRenderer.cpp @@ -9,7 +9,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "BossMobGuiInfo.h" #include "Chunk.h" @@ -274,7 +274,7 @@ void GameRenderer::tick(bool first) // 4J - add bFirst 1.0f / ((float)SharedConstants::TICKS_PER_SECOND * 4); } - if (mc->player != mc->localplayers[InputManager.GetPrimaryPad()]) + if (mc->player != mc->localplayers[PlatformInput.GetPrimaryPad()]) return; // 4J added for split screen - only do rest of processing for // once per frame @@ -1047,8 +1047,8 @@ void GameRenderer::render(float a, bool bFirst) { ScreenSizeCalculator ssc(mc->options, mc->width, mc->height); int screenWidth = ssc.getWidth(); int screenHeight = ssc.getHeight(); - int xMouse = InputManager.GetMouseX() * screenWidth / mc->width; - int yMouse = InputManager.GetMouseY() * screenHeight / mc->height - 1; + int xMouse = PlatformInput.GetMouseX() * screenWidth / mc->width; + int yMouse = PlatformInput.GetMouseY() * screenHeight / mc->height - 1; int maxFps = getFpsCap(mc->options->framerateLimit); @@ -1242,7 +1242,7 @@ void GameRenderer::renderLevel(float a, int64_t until) { // view whatever they have loaded in - we're sharing render data between // players. bool updateChunks = - (mc->player == mc->localplayers[InputManager.GetPrimaryPad()]); + (mc->player == mc->localplayers[PlatformInput.GetPrimaryPad()]); // if (mc->cameraTargetPlayer == nullptr) // 4J - removed condition as we // want to update this is mc->player changes for different local players diff --git a/targets/minecraft/client/renderer/LevelRenderer.cpp b/targets/minecraft/client/renderer/LevelRenderer.cpp index 03173d8b2..20adb191f 100644 --- a/targets/minecraft/client/renderer/LevelRenderer.cpp +++ b/targets/minecraft/client/renderer/LevelRenderer.cpp @@ -16,7 +16,7 @@ #include #include "platform/PlatformTypes.h" -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Render.h" #include "Chunk.h" #include "GameRenderer.h" @@ -435,7 +435,7 @@ void LevelRenderer::setLevel(int playerIndex, MultiPlayerLevel* level) { // tile entities in the world dissappear We should only do this when // actually exiting the game, so only when the primary player sets there // level to nullptr - if (playerIndex == InputManager.GetPrimaryPad()) { + if (playerIndex == PlatformInput.GetPrimaryPad()) { RenderManager.CBuffDeleteAll(); { std::lock_guard lock(m_csRenderableTileEntities); @@ -1164,7 +1164,7 @@ void LevelRenderer::renderClouds(float alpha) { int playerIndex = mc->player->GetXboxPad(); // if the primary player has clouds off, so do all players on this machine - if (gameServices().getGameSettings(InputManager.GetPrimaryPad(), + if (gameServices().getGameSettings(PlatformInput.GetPrimaryPad(), eGameSetting_Clouds) == 0) { return; } @@ -1178,7 +1178,7 @@ void LevelRenderer::renderClouds(float alpha) { } if (gameServices().debugSettingsOn()) { - if (gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + if (gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime)) { iTicks = m_freezeticks; } @@ -1256,7 +1256,7 @@ void LevelRenderer::renderClouds(float alpha) { glEnable(GL_CULL_FACE); if (gameServices().debugSettingsOn()) { - if (!(gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + if (!(gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime))) { m_freezeticks = iTicks; } @@ -1442,7 +1442,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) { int iTicks = ticks; if (gameServices().debugSettingsOn()) { - if (gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + if (gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime)) { iTicks = m_freezeticks; } @@ -1689,7 +1689,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) { glEnable(GL_CULL_FACE); if (gameServices().debugSettingsOn()) { - if (!(gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + if (!(gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime))) { m_freezeticks = iTicks; } diff --git a/targets/minecraft/client/skins/DLCTexturePack.cpp b/targets/minecraft/client/skins/DLCTexturePack.cpp index ec7798b92..2d9cb5a6e 100644 --- a/targets/minecraft/client/skins/DLCTexturePack.cpp +++ b/targets/minecraft/client/skins/DLCTexturePack.cpp @@ -7,7 +7,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Storage.h" #include "minecraft/GameEnums.h" #include "app/common/Audio/SoundEngine.h" @@ -239,7 +239,7 @@ void DLCTexturePack::loadData() { if (mountIndex > -1) { if (StorageManager.MountInstalledDLC( - InputManager.GetPrimaryPad(), mountIndex, + PlatformInput.GetPrimaryPad(), mountIndex, [this](int pad, std::uint32_t err, std::uint32_t lic) { return onPackMounted(pad, err, lic); }, @@ -249,7 +249,7 @@ void DLCTexturePack::loadData() { if (gameServices().getLevelGenerationOptions()) gameServices().getLevelGenerationOptions()->setLoadedData(); Log::info("Failed to mount texture pack DLC %d for pad %d\n", - mountIndex, InputManager.GetPrimaryPad()); + mountIndex, PlatformInput.GetPrimaryPad()); } else { m_bLoadingData = true; Log::info("Attempted to mount DLC data for texture pack %d\n", @@ -259,7 +259,7 @@ void DLCTexturePack::loadData() { m_bHasLoadedData = true; if (gameServices().getLevelGenerationOptions()) gameServices().getLevelGenerationOptions()->setLoadedData(); - gameServices().setAction(InputManager.GetPrimaryPad(), + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_ReloadTexturePack); } } @@ -404,7 +404,7 @@ int DLCTexturePack::onPackMounted(int iPad, std::uint32_t dwErr, texturePack->m_bHasLoadedData = true; if (gameServices().getLevelGenerationOptions()) gameServices().getLevelGenerationOptions()->setLoadedData(); - gameServices().setAction(InputManager.GetPrimaryPad(), eAppAction_ReloadTexturePack); + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_ReloadTexturePack); return 0; } diff --git a/targets/minecraft/client/skins/TexturePackRepository.cpp b/targets/minecraft/client/skins/TexturePackRepository.cpp index 7a2afdc2e..5423d434a 100644 --- a/targets/minecraft/client/skins/TexturePackRepository.cpp +++ b/targets/minecraft/client/skins/TexturePackRepository.cpp @@ -7,7 +7,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "DLCTexturePack.h" #include "DefaultTexturePack.h" #include "minecraft/GameEnums.h" @@ -151,7 +151,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) { selectSkin(newPack); if (newPack->hasData()) { - gameServices().setAction(InputManager.GetPrimaryPad(), + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_ReloadTexturePack); } else { newPack->loadData(); @@ -167,7 +167,7 @@ bool TexturePackRepository::selectTexturePackById(std::uint32_t id) { "Failed to select texture pack %d as it is not in the list\n", id); // Fail safely if (selectSkin(DEFAULT_TEXTURE_PACK)) { - gameServices().setAction(InputManager.GetPrimaryPad(), + gameServices().setAction(PlatformInput.GetPrimaryPad(), eAppAction_ReloadTexturePack); } } diff --git a/targets/minecraft/server/MinecraftServer.cpp b/targets/minecraft/server/MinecraftServer.cpp index a58e9a2ef..372a89f1b 100644 --- a/targets/minecraft/server/MinecraftServer.cpp +++ b/targets/minecraft/server/MinecraftServer.cpp @@ -66,7 +66,7 @@ #if defined(SPLIT_SAVES) #include "minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileSplit.h" #endif -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/ShutdownManager.h" #include "app/common/Console_Debug_enum.h" #include "app/common/GameRules/LevelGeneration/ConsoleSchematicFile.h" @@ -832,7 +832,7 @@ void MinecraftServer::saveAllChunks() { void MinecraftServer::saveGameRules() { #if !defined(_CONTENT_PACKAGE) if (gameServices().debugSettingsOn() && - gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_DistributableSave)) { // Do nothing } else @@ -903,7 +903,7 @@ void MinecraftServer::stopServer(bool didInit) { // also need to check for a profile switch here - primary player signs out, // and another player signs in before dismissing the dash if ((m_bPrimaryPlayerSignedOut == false) && - ProfileManager.IsSignedIn(InputManager.GetPrimaryPad())) { + ProfileManager.IsSignedIn(PlatformInput.GetPrimaryPad())) { // if trial version or saving is disabled, then don't save anything. // Also don't save anything if we didn't actually get through the server // initialisation. diff --git a/targets/minecraft/server/level/ServerLevel.cpp b/targets/minecraft/server/level/ServerLevel.cpp index 05136b7f5..86c9be140 100644 --- a/targets/minecraft/server/level/ServerLevel.cpp +++ b/targets/minecraft/server/level/ServerLevel.cpp @@ -7,7 +7,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "platform/sdl2/Storage.h" #include "EntityTracker.h" #include "platform/ShutdownManager.h" @@ -326,7 +326,7 @@ void ServerLevel::tick() { #if !defined(_FINAL_BUILD) bool freezeTime = gameServices().debugSettingsOn() && - gameServices().debugGetMask(InputManager.GetPrimaryPad()) & + gameServices().debugGetMask(PlatformInput.GetPrimaryPad()) & (1L << eDebugSetting_FreezeTime); if (!freezeTime) #endif diff --git a/targets/minecraft/server/level/ServerPlayer.cpp b/targets/minecraft/server/level/ServerPlayer.cpp index 656141a7b..1274c881f 100644 --- a/targets/minecraft/server/level/ServerPlayer.cpp +++ b/targets/minecraft/server/level/ServerPlayer.cpp @@ -10,7 +10,7 @@ #include #include -#include "platform/sdl2/Input.h" +#include "platform/input/input.h" #include "EntityTracker.h" #include "app/common/Console_Debug_enum.h" #include "app/common/GameRules/LevelRules/Rules/GameRulesInstance.h" @@ -585,7 +585,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) { void ServerPlayer::doTickB() { #if !defined(_CONTENT_PACKAGE) // check if there's a debug dimension change requested - // if(gameServices().debugGetMask(InputManager.GetPrimaryPad())&(1L<dimension->id == 0 ) // { @@ -593,11 +593,11 @@ void ServerPlayer::doTickB() { // portalTime=1; // } // unsigned int - // uiVal=gameServices().debugGetMask(InputManager.GetPrimaryPad()); - // gameServices().setGameSettingsDebugMask(InputManager.GetPrimaryPad(),uiVal&~(1L<dimension->id == 0 ) // { @@ -605,20 +605,20 @@ void ServerPlayer::doTickB() { // std::dynamic_pointer_cast( shared_from_this() ), 1 ); // } // unsigned int - // uiVal=gameServices().debugGetMask(InputManager.GetPrimaryPad()); - // gameServices().setGameSettingsDebugMask(InputManager.GetPrimaryPad(),uiVal&~(1L<dimension->id != 0) { isInsidePortal = true; portalTime = 1; } unsigned int uiVal = - gameServices().debugGetMask(InputManager.GetPrimaryPad()); + gameServices().debugGetMask(PlatformInput.GetPrimaryPad()); gameServices().setGameSettingsDebugMask( - InputManager.GetPrimaryPad(), + PlatformInput.GetPrimaryPad(), uiVal & ~(1L << eDebugSetting_GoToOverworld)); } #endif diff --git a/targets/minecraft/world/entity/animal/Ocelot.cpp b/targets/minecraft/world/entity/animal/Ocelot.cpp index 54f8e30c3..59b7d990e 100644 --- a/targets/minecraft/world/entity/animal/Ocelot.cpp +++ b/targets/minecraft/world/entity/animal/Ocelot.cpp @@ -6,7 +6,7 @@ #include #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "app/linux/LinuxGame.h" #include "util/StringHelpers.h" #include "java/Random.h" diff --git a/targets/minecraft/world/level/Level.cpp b/targets/minecraft/world/level/Level.cpp index 73d665229..f81c53971 100644 --- a/targets/minecraft/world/level/Level.cpp +++ b/targets/minecraft/world/level/Level.cpp @@ -15,7 +15,7 @@ #include #include "Explosion.h" -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "LevelListener.h" #include "minecraft/GameEnums.h" #include "app/common/Colours/ColourTable.h" diff --git a/targets/minecraft/world/level/biome/BiomeSource.cpp b/targets/minecraft/world/level/biome/BiomeSource.cpp index 7e9657c44..d4dfd30ac 100644 --- a/targets/minecraft/world/level/biome/BiomeSource.cpp +++ b/targets/minecraft/world/level/biome/BiomeSource.cpp @@ -6,7 +6,7 @@ #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "app/common/Console_Debug_enum.h" #include "app/linux/LinuxGame.h" #include "java/Random.h" diff --git a/targets/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp b/targets/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp index 94a88f486..30178cbb6 100644 --- a/targets/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp +++ b/targets/minecraft/world/level/chunk/storage/McRegionChunkStorage.cpp @@ -10,7 +10,7 @@ #include #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "app/common/Console_Debug_enum.h" #include "app/linux/LinuxGame.h" #include "platform/C4JThread.h" diff --git a/targets/minecraft/world/level/chunk/storage/OldChunkStorage.cpp b/targets/minecraft/world/level/chunk/storage/OldChunkStorage.cpp index 2857ea814..eeb876ec7 100644 --- a/targets/minecraft/world/level/chunk/storage/OldChunkStorage.cpp +++ b/targets/minecraft/world/level/chunk/storage/OldChunkStorage.cpp @@ -12,7 +12,7 @@ #include #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "app/common/Console_Debug_enum.h" #include "app/linux/LinuxGame.h" #include "util/Definitions.h" diff --git a/targets/minecraft/world/level/dimension/Dimension.cpp b/targets/minecraft/world/level/dimension/Dimension.cpp index 3b527b48f..8073dd8dc 100644 --- a/targets/minecraft/world/level/dimension/Dimension.cpp +++ b/targets/minecraft/world/level/dimension/Dimension.cpp @@ -6,7 +6,7 @@ #include #include "HellDimension.h" -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "minecraft/GameEnums.h" #include "app/common/Colours/ColourTable.h" #include "app/common/Console_Debug_enum.h" diff --git a/targets/minecraft/world/level/dimension/HellDimension.cpp b/targets/minecraft/world/level/dimension/HellDimension.cpp index c14f59c6b..48a8da1d8 100644 --- a/targets/minecraft/world/level/dimension/HellDimension.cpp +++ b/targets/minecraft/world/level/dimension/HellDimension.cpp @@ -3,7 +3,7 @@ #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "minecraft/GameEnums.h" #include "app/common/Colours/ColourTable.h" #include "app/common/Console_Debug_enum.h" diff --git a/targets/minecraft/world/level/newbiome/layer/Layer.cpp b/targets/minecraft/world/level/newbiome/layer/Layer.cpp index 8e587c898..53bfde0c9 100644 --- a/targets/minecraft/world/level/newbiome/layer/Layer.cpp +++ b/targets/minecraft/world/level/newbiome/layer/Layer.cpp @@ -7,7 +7,7 @@ #include #include "BiomeOverrideLayer.h" -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "app/common/Console_Debug_enum.h" #include "app/linux/LinuxGame.h" #include "minecraft/world/level/LevelType.h" diff --git a/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp b/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp index a565ba700..0fb639d42 100644 --- a/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp +++ b/targets/minecraft/world/level/storage/DirectoryLevelStorage.cpp @@ -12,7 +12,7 @@ #include #include -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "LevelData.h" #include "app/common/Console_Debug_enum.h" #include "app/common/GameRules/GameRuleManager.h" diff --git a/targets/minecraft/world/level/tile/entity/SignTileEntity.h b/targets/minecraft/world/level/tile/entity/SignTileEntity.h index c85d25896..18dd87d5f 100644 --- a/targets/minecraft/world/level/tile/entity/SignTileEntity.h +++ b/targets/minecraft/world/level/tile/entity/SignTileEntity.h @@ -6,7 +6,6 @@ #include "TileEntity.h" #include "java/Class.h" #include "minecraft/world/entity/player/Player.h" -#include "platform/IPlatformInput.h" struct STRING_VERIFY_RESPONSE; diff --git a/targets/platform/Platform.h b/targets/platform/Platform.h index 911ac4849..07daad766 100644 --- a/targets/platform/Platform.h +++ b/targets/platform/Platform.h @@ -1,7 +1,7 @@ #pragma once #include "IPlatformFileIO.h" -#include "IPlatformInput.h" +#include "platform/input/input.h" #include "IPlatformLeaderboard.h" #include "IPlatformNetwork.h" #include "IPlatformProfile.h" diff --git a/targets/platform/PlatformServices.cpp b/targets/platform/PlatformServices.cpp index 01da05027..675b4e931 100644 --- a/targets/platform/PlatformServices.cpp +++ b/targets/platform/PlatformServices.cpp @@ -1,7 +1,6 @@ #include "PlatformServices.h" #include "StdFileIO.h" -#include "sdl2/Input.h" #include "sdl2/Profile.h" #include "sdl2/Render.h" #include "sdl2/Storage.h" @@ -9,7 +8,6 @@ static StdFileIO s_stdFileIO; IPlatformFileIO& PlatformFileIO = s_stdFileIO; -IPlatformInput& PlatformInput = InputManager; IPlatformProfile& PlatformProfile = ProfileManager; IPlatformRenderer& PlatformRender = RenderManager; IPlatformStorage& PlatformStorage = StorageManager; diff --git a/targets/platform/PlatformServices.h b/targets/platform/PlatformServices.h index 291f77d99..4343ecb7f 100644 --- a/targets/platform/PlatformServices.h +++ b/targets/platform/PlatformServices.h @@ -1,7 +1,6 @@ #pragma once #include "IPlatformFileIO.h" -#include "IPlatformInput.h" #include "IPlatformLeaderboard.h" #include "IPlatformNetwork.h" #include "IPlatformProfile.h" @@ -13,7 +12,6 @@ // by the app layer at startup. extern IPlatformFileIO& PlatformFileIO; -extern IPlatformInput& PlatformInput; extern IPlatformProfile& PlatformProfile; extern IPlatformRenderer& PlatformRender; extern IPlatformStorage& PlatformStorage; diff --git a/targets/platform/IPlatformInput.h b/targets/platform/input/IPlatformInput.h similarity index 76% rename from targets/platform/IPlatformInput.h rename to targets/platform/input/IPlatformInput.h index 8783c2499..8b20b0c15 100644 --- a/targets/platform/IPlatformInput.h +++ b/targets/platform/input/IPlatformInput.h @@ -4,6 +4,51 @@ #include "PlatformTypes.h" +#define MAP_STYLE_0 0 +#define MAP_STYLE_1 1 +#define MAP_STYLE_2 2 + +#define _360_JOY_BUTTON_A 0x00000001 +#define _360_JOY_BUTTON_B 0x00000002 +#define _360_JOY_BUTTON_X 0x00000004 +#define _360_JOY_BUTTON_Y 0x00000008 + +#define _360_JOY_BUTTON_START 0x00000010 +#define _360_JOY_BUTTON_BACK 0x00000020 +#define _360_JOY_BUTTON_RB 0x00000040 +#define _360_JOY_BUTTON_LB 0x00000080 + +#define _360_JOY_BUTTON_RTHUMB 0x00000100 +#define _360_JOY_BUTTON_LTHUMB 0x00000200 +#define _360_JOY_BUTTON_DPAD_UP 0x00000400 +#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800 + +#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000 +#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000 +// fake digital versions of analog values +#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000 +#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000 + +#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000 +#define _360_JOY_BUTTON_RSTICK_UP 0x00020000 +#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000 +#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000 + +#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000 +#define _360_JOY_BUTTON_LSTICK_UP 0x00200000 +#define _360_JOY_BUTTON_RT 0x00400000 +#define _360_JOY_BUTTON_LT 0x00800000 + +// Stick axis maps - to allow changes for SouthPaw in-game axis mapping +#define AXIS_MAP_LX 0 +#define AXIS_MAP_LY 1 +#define AXIS_MAP_RX 2 +#define AXIS_MAP_RY 3 + +// Trigger map - to allow for swap triggers in-game +#define TRIGGER_MAP_0 0 +#define TRIGGER_MAP_1 1 + class IPlatformInput { public: enum EKeyboardMode { diff --git a/targets/platform/InputActions.h b/targets/platform/input/InputActions.h similarity index 100% rename from targets/platform/InputActions.h rename to targets/platform/input/InputActions.h diff --git a/targets/platform/input/input.h b/targets/platform/input/input.h new file mode 100644 index 000000000..436916435 --- /dev/null +++ b/targets/platform/input/input.h @@ -0,0 +1,3 @@ +#include "IPlatformInput.h" + +extern IPlatformInput& PlatformInput; diff --git a/targets/platform/sdl2/Input.cpp b/targets/platform/input/sdl2/SDL2Input.cpp similarity index 92% rename from targets/platform/sdl2/Input.cpp rename to targets/platform/input/sdl2/SDL2Input.cpp index 2715abfcc..4ec3a48dc 100644 --- a/targets/platform/sdl2/Input.cpp +++ b/targets/platform/input/sdl2/SDL2Input.cpp @@ -1,4 +1,4 @@ -#include "Input.h" +#include "SDL2Input.h" #include #include @@ -20,7 +20,8 @@ #include "../InputActions.h" #include "../PlatformTypes.h" -C_4JInput InputManager; +SDL2Input sdl2_input_instance; +IPlatformInput& PlatformInput = sdl2_input_instance; static const int KEY_COUNT = SDL_NUM_SCANCODES; static const int BTN_COUNT = SDL_CONTROLLER_BUTTON_MAX; @@ -229,7 +230,7 @@ static void TakeSnapIfNeeded() { } } // We initialize the SDL input -void C_4JInput::Initialise(int, unsigned char, unsigned char, unsigned char) { +void SDL2Input::Initialise(int, unsigned char, unsigned char, unsigned char) { if (!s_sdlInitialized) { if (SDL_WasInit(SDL_INIT_VIDEO) == 0) { SDL_Init(SDL_INIT_VIDEO); @@ -279,7 +280,7 @@ static void utf8_pop_back(std::string& str) { // Each tick we update the input state by polling SDL, this is where we get the // kbd and mouse state. -void C_4JInput::Tick() { +void SDL2Input::Tick() { if (!s_sdlInitialized) return; memcpy(s_keysPrev, s_keysCurrent, sizeof(s_keysCurrent)); @@ -374,7 +375,7 @@ void C_4JInput::Tick() { } } -int C_4JInput::GetHotbarSlotPressed(int iPad) { +int SDL2Input::GetHotbarSlotPressed(int iPad) { if (iPad != 0) return -1; constexpr size_t NUM_HOTBAR_SLOTS = 9; @@ -460,7 +461,7 @@ int C_4JInput::GetHotbarSlotPressed(int iPad) { default: \ return false; -bool C_4JInput::ButtonDown(int iPad, unsigned char ucAction) { +bool SDL2Input::ButtonDown(int iPad, unsigned char ucAction) { if (iPad != 0) return false; if (s_keyboardActive) return false; if (ucAction == 255) { @@ -490,7 +491,7 @@ bool C_4JInput::ButtonDown(int iPad, unsigned char ucAction) { } } // The part that handles completing the action of pressing a button. -bool C_4JInput::ButtonPressed(int iPad, unsigned char ucAction) { +bool SDL2Input::ButtonPressed(int iPad, unsigned char ucAction) { if (iPad != 0 || ucAction == 255) return false; if (s_keyboardActive) return false; switch (ucAction) { @@ -516,7 +517,7 @@ bool C_4JInput::ButtonPressed(int iPad, unsigned char ucAction) { } } // The part that handles Releasing a button. -bool C_4JInput::ButtonReleased(int iPad, unsigned char ucAction) { +bool SDL2Input::ButtonReleased(int iPad, unsigned char ucAction) { if (iPad != 0 || ucAction == 255) return false; if (s_keyboardActive) return false; switch (ucAction) { @@ -541,7 +542,7 @@ bool C_4JInput::ButtonReleased(int iPad, unsigned char ucAction) { } } -unsigned int C_4JInput::GetValue(int iPad, unsigned char ucAction, bool) { +unsigned int SDL2Input::GetValue(int iPad, unsigned char ucAction, bool) { if (iPad != 0) return 0; if (ucAction == MINECRAFT_ACTION_LEFT_SCROLL) { if (s_scrollTicksForGetValue > 0) { @@ -563,13 +564,13 @@ unsigned int C_4JInput::GetValue(int iPad, unsigned char ucAction, bool) { } // Left stick movement, the one that moves the player around or selects menu // options. (Soon be tested.) -float C_4JInput::GetJoypadStick_LX(int, bool) { +float SDL2Input::GetJoypadStick_LX(int, bool) { if (ADown(SDL_CONTROLLER_AXIS_LEFTX)) return axisVal[SDL_CONTROLLER_AXIS_LEFTX]; return (KDown(SDL_SCANCODE_D) ? 1.f : 0.f) - (KDown(SDL_SCANCODE_A) ? 1.f : 0.f); } -float C_4JInput::GetJoypadStick_LY(int, bool) { +float SDL2Input::GetJoypadStick_LY(int, bool) { if (ADown(SDL_CONTROLLER_AXIS_LEFTY)) return -axisVal[SDL_CONTROLLER_AXIS_LEFTY]; return (KDown(SDL_SCANCODE_W) ? 1.f : 0.f) - @@ -582,7 +583,7 @@ static float MouseAxis(float raw) { return (raw >= 0.f ? 1.f : -1.f) * sqrtf(fabsf(raw)); } // We apply the Stick movement on the R(Right) X(2D Position) -float C_4JInput::GetJoypadStick_RX(int, bool) { +float SDL2Input::GetJoypadStick_RX(int, bool) { if (ADown(SDL_CONTROLLER_AXIS_RIGHTX)) return axisVal[SDL_CONTROLLER_AXIS_RIGHTX]; if (!SDL_GetRelativeMouseMode()) return 0.f; @@ -590,7 +591,7 @@ float C_4JInput::GetJoypadStick_RX(int, bool) { return MouseAxis(s_snapRelX * MOUSE_SCALE); } // Bis. but with Y(2D Position) -float C_4JInput::GetJoypadStick_RY(int, bool) { +float SDL2Input::GetJoypadStick_RY(int, bool) { if (ADown(SDL_CONTROLLER_AXIS_RIGHTY)) return -axisVal[SDL_CONTROLLER_AXIS_RIGHTY]; if (!SDL_GetRelativeMouseMode()) return 0.f; @@ -598,78 +599,78 @@ float C_4JInput::GetJoypadStick_RY(int, bool) { return MouseAxis(-s_snapRelY * MOUSE_SCALE); } -unsigned char C_4JInput::GetJoypadLTrigger(int, bool) { +unsigned char SDL2Input::GetJoypadLTrigger(int, bool) { return (s_mouseRightCurrent || s_axisCurrent[SDL_CONTROLLER_AXIS_TRIGGERLEFT]) ? 255 : 0; } -unsigned char C_4JInput::GetJoypadRTrigger(int, bool) { +unsigned char SDL2Input::GetJoypadRTrigger(int, bool) { return (s_mouseLeftCurrent || s_axisCurrent[SDL_CONTROLLER_AXIS_TRIGGERRIGHT]) ? 255 : 0; } -int C_4JInput::GetMouseX() { return s_mouseX; } -int C_4JInput::GetMouseY() { return s_mouseY; } +int SDL2Input::GetMouseX() { return s_mouseX; } +int SDL2Input::GetMouseY() { return s_mouseY; } // We detect if a Menu is visible on the player's screen to the mouse being // stuck. -void C_4JInput::SetMenuDisplayed(int iPad, bool bVal) { +void SDL2Input::SetMenuDisplayed(int iPad, bool bVal) { if (iPad >= 0 && iPad < 4) s_menuDisplayed[iPad] = bVal; if (!s_sdlInitialized || bVal == s_prevMenuDisplayed) return; SDL_SetRelativeMouseMode(bVal ? SDL_FALSE : SDL_TRUE); s_prevMenuDisplayed = bVal; } -int C_4JInput::GetScrollDelta() { +int SDL2Input::GetScrollDelta() { int v = s_scrollTicksForButtonPressed; s_scrollTicksForButtonPressed = 0; return v; } -void C_4JInput::SetDeadzoneAndMovementRange(unsigned int, unsigned int) {} -void C_4JInput::SetGameJoypadMaps(unsigned char, unsigned char, unsigned int) {} -unsigned int C_4JInput::GetGameJoypadMaps(unsigned char, unsigned char) { +void SDL2Input::SetDeadzoneAndMovementRange(unsigned int, unsigned int) {} +void SDL2Input::SetGameJoypadMaps(unsigned char, unsigned char, unsigned int) {} +unsigned int SDL2Input::GetGameJoypadMaps(unsigned char, unsigned char) { return 0; } -void C_4JInput::SetJoypadMapVal(int, unsigned char) {} -unsigned char C_4JInput::GetJoypadMapVal(int) { return 0; } -void C_4JInput::SetJoypadSensitivity(int, float) {} -void C_4JInput::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {} -void C_4JInput::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {} -void C_4JInput::SetKeyRepeatRate(float, float) {} -void C_4JInput::SetDebugSequence(const char*, std::function) {} -float C_4JInput::GetIdleSeconds(int) { return 0.f; } -bool C_4JInput::IsPadConnected(int iPad) { return iPad == 0; } +void SDL2Input::SetJoypadMapVal(int, unsigned char) {} +unsigned char SDL2Input::GetJoypadMapVal(int) { return 0; } +void SDL2Input::SetJoypadSensitivity(int, float) {} +void SDL2Input::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {} +void SDL2Input::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {} +void SDL2Input::SetKeyRepeatRate(float, float) {} +void SDL2Input::SetDebugSequence(const char*, std::function) {} +float SDL2Input::GetIdleSeconds(int) { return 0.f; } +bool SDL2Input::IsPadConnected(int iPad) { return iPad == 0; } -EKeyboardResult C_4JInput::RequestKeyboard(const wchar_t*, const wchar_t*, int, +EKeyboardResult SDL2Input::RequestKeyboard(const wchar_t*, const wchar_t*, int, unsigned int, std::function callback, - C_4JInput::EKeyboardMode) { + SDL2Input::EKeyboardMode) { s_keyboardActive = true; s_textInputBuf.clear(); s_keyboardCallback = std::move(callback); SDL_StartTextInput(); return EKeyboardResult::Pending; } -bool C_4JInput::GetMenuDisplayed(int iPad) { +bool SDL2Input::GetMenuDisplayed(int iPad) { if (iPad >= 0 && iPad < 4) return s_menuDisplayed[iPad]; return false; } -const char* C_4JInput::GetText() { return s_textInputBuf.c_str(); } -bool C_4JInput::VerifyStrings(wchar_t**, int, +const char* SDL2Input::GetText() { return s_textInputBuf.c_str(); } +bool SDL2Input::VerifyStrings(wchar_t**, int, std::function) { return true; } -void C_4JInput::CancelQueuedVerifyStrings( +void SDL2Input::CancelQueuedVerifyStrings( std::function) {} -void C_4JInput::CancelAllVerifyInProgress() {} +void SDL2Input::CancelAllVerifyInProgress() {} // Primary pad (moved from Profile) namespace { int s_inputPrimaryPad = 0; } -int C_4JInput::GetPrimaryPad() { return s_inputPrimaryPad; } -void C_4JInput::SetPrimaryPad(int iPad) { s_inputPrimaryPad = iPad; } +int SDL2Input::GetPrimaryPad() { return s_inputPrimaryPad; } +void SDL2Input::SetPrimaryPad(int iPad) { s_inputPrimaryPad = iPad; } diff --git a/targets/platform/sdl2/Input.h b/targets/platform/input/sdl2/SDL2Input.h similarity index 73% rename from targets/platform/sdl2/Input.h rename to targets/platform/input/sdl2/SDL2Input.h index 275cc7a6a..d39ef1490 100644 --- a/targets/platform/sdl2/Input.h +++ b/targets/platform/input/sdl2/SDL2Input.h @@ -4,52 +4,7 @@ #include "../IPlatformInput.h" -#define MAP_STYLE_0 0 -#define MAP_STYLE_1 1 -#define MAP_STYLE_2 2 - -#define _360_JOY_BUTTON_A 0x00000001 -#define _360_JOY_BUTTON_B 0x00000002 -#define _360_JOY_BUTTON_X 0x00000004 -#define _360_JOY_BUTTON_Y 0x00000008 - -#define _360_JOY_BUTTON_START 0x00000010 -#define _360_JOY_BUTTON_BACK 0x00000020 -#define _360_JOY_BUTTON_RB 0x00000040 -#define _360_JOY_BUTTON_LB 0x00000080 - -#define _360_JOY_BUTTON_RTHUMB 0x00000100 -#define _360_JOY_BUTTON_LTHUMB 0x00000200 -#define _360_JOY_BUTTON_DPAD_UP 0x00000400 -#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800 - -#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000 -#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000 -// fake digital versions of analog values -#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000 -#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000 - -#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000 -#define _360_JOY_BUTTON_RSTICK_UP 0x00020000 -#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000 -#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000 - -#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000 -#define _360_JOY_BUTTON_LSTICK_UP 0x00200000 -#define _360_JOY_BUTTON_RT 0x00400000 -#define _360_JOY_BUTTON_LT 0x00800000 - -// Stick axis maps - to allow changes for SouthPaw in-game axis mapping -#define AXIS_MAP_LX 0 -#define AXIS_MAP_LY 1 -#define AXIS_MAP_RX 2 -#define AXIS_MAP_RY 3 - -// Trigger map - to allow for swap triggers in-game -#define TRIGGER_MAP_0 0 -#define TRIGGER_MAP_1 1 - -class C_4JInput : public IPlatformInput { +class SDL2Input : public IPlatformInput { public: void Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC); @@ -98,7 +53,7 @@ public: EKeyboardResult RequestKeyboard(const wchar_t* Title, const wchar_t* Text, int iPad, unsigned int uiMaxChars, std::function callback, - C_4JInput::EKeyboardMode eMode); + SDL2Input::EKeyboardMode eMode); bool GetMenuDisplayed(int); const char* GetText(); @@ -140,6 +95,3 @@ public: // bool InputDetected(int userIndex, wchar_t* inputText); }; - -// Singleton -extern C_4JInput InputManager; diff --git a/targets/platform/meson.build b/targets/platform/meson.build index 893bcf60c..c5c5287c3 100644 --- a/targets/platform/meson.build +++ b/targets/platform/meson.build @@ -25,7 +25,7 @@ else endif sdl2_sources = files( - 'sdl2/Input.cpp', + 'input/sdl2/SDL2Input.cpp', 'sdl2/Profile.cpp', 'sdl2/Render.cpp', 'sdl2/render_stubs.cpp', diff --git a/targets/platform/sdl2/Profile.cpp b/targets/platform/sdl2/Profile.cpp index d34b501e8..8802da8d8 100644 --- a/targets/platform/sdl2/Profile.cpp +++ b/targets/platform/sdl2/Profile.cpp @@ -5,7 +5,7 @@ #include #include "../ProfileConstants.h" -#include "../sdl2/Input.h" +#include "input/input.h" C_4JProfile ProfileManager; @@ -186,14 +186,12 @@ bool C_4JProfile::CanViewPlayerCreatedContent(int, bool, PlayerUID*, return true; } -// GetPrimaryPad/SetPrimaryPad — delegates to InputManager. +// GetPrimaryPad/SetPrimaryPad — delegates to PlatformPlatft. // Kept here temporarily for call sites that still use ProfileManager. -// These forward to the canonical copies in C_4JInput. +// These forward to the canonical copies in SDL2Input. int C_4JProfile::GetPrimaryPad() { - extern C_4JInput InputManager; - return InputManager.GetPrimaryPad(); + return PlatformInput.GetPrimaryPad(); } void C_4JProfile::SetPrimaryPad(int iPad) { - extern C_4JInput InputManager; - InputManager.SetPrimaryPad(iPad); + PlatformInput.SetPrimaryPad(iPad); }