WiimoteEmu: Replace shinkansen MixedTriggers with Triggers.

This commit is contained in:
Jordan Woyak 2022-10-22 02:42:40 -05:00
parent d705b8d4b8
commit d9d6428189
2 changed files with 5 additions and 10 deletions

View File

@ -13,7 +13,7 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h" #include "Core/HW/WiimoteEmu/WiimoteEmu.h"
#include "InputCommon/ControllerEmu/ControlGroup/Buttons.h" #include "InputCommon/ControllerEmu/ControlGroup/Buttons.h"
#include "InputCommon/ControllerEmu/ControlGroup/MixedTriggers.h" #include "InputCommon/ControllerEmu/ControlGroup/Triggers.h"
namespace WiimoteEmu namespace WiimoteEmu
{ {
@ -42,11 +42,9 @@ Shinkansen::Shinkansen() : Extension3rdParty("Shinkansen", _trans("Shinkansen Co
// For easier axis mapping the right lever is inverted in Dolphin, // For easier axis mapping the right lever is inverted in Dolphin,
// so that the train coasts when no trigger is squeezed. // so that the train coasts when no trigger is squeezed.
groups.emplace_back(m_levers = new ControllerEmu::MixedTriggers(_trans("Levers"))); groups.emplace_back(m_levers = new ControllerEmu::Triggers(_trans("Levers")));
m_levers->AddInput(ControllerEmu::Translate, _trans("L")); m_levers->AddInput(ControllerEmu::Translate, _trans("L"));
m_levers->AddInput(ControllerEmu::Translate, _trans("R")); m_levers->AddInput(ControllerEmu::Translate, _trans("R"));
m_levers->AddInput(ControllerEmu::Translate, _trans("L-Analog"));
m_levers->AddInput(ControllerEmu::Translate, _trans("R-Analog"));
groups.emplace_back(m_led = new ControllerEmu::ControlGroup(_trans("Light"))); groups.emplace_back(m_led = new ControllerEmu::ControlGroup(_trans("Light")));
m_led->AddOutput(ControllerEmu::Translate, _trans("Doors Locked")); m_led->AddOutput(ControllerEmu::Translate, _trans("Doors Locked"));
@ -56,10 +54,7 @@ void Shinkansen::BuildDesiredExtensionState(DesiredExtensionState* target_state)
{ {
DesiredState& state = target_state->data.emplace<DesiredState>(); DesiredState& state = target_state->data.emplace<DesiredState>();
u16 digital = 0; const auto analog = m_levers->GetState().data;
const u16 lever_bitmasks[2] = {};
double analog[2] = {};
m_levers->GetState(&digital, lever_bitmasks, analog);
// The game requires these specific values, all other values are treated like 0/255 (which are // The game requires these specific values, all other values are treated like 0/255 (which are
// guesses). // guesses).
const u8 brake_values[] = {0, 53, 79, 105, 132, 159, 187, 217, 250}; const u8 brake_values[] = {0, 53, 79, 105, 132, 159, 187, 217, 250};

View File

@ -9,7 +9,7 @@ namespace ControllerEmu
{ {
class Buttons; class Buttons;
class ControlGroup; class ControlGroup;
class MixedTriggers; class Triggers;
} // namespace ControllerEmu } // namespace ControllerEmu
namespace WiimoteEmu namespace WiimoteEmu
@ -40,7 +40,7 @@ public:
private: private:
ControllerEmu::Buttons* m_buttons; ControllerEmu::Buttons* m_buttons;
ControllerEmu::MixedTriggers* m_levers; ControllerEmu::Triggers* m_levers;
ControllerEmu::ControlGroup* m_led; ControllerEmu::ControlGroup* m_led;
struct DataFormat struct DataFormat