mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
ControllerInterface: Gate the input based on our new background input setting
This commit is contained in:
@ -42,6 +42,8 @@ public:
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual ~Control() {}
|
||||
|
||||
bool InputGateOn();
|
||||
|
||||
virtual Input* ToInput() { return nullptr; }
|
||||
virtual Output* ToOutput() { return nullptr; }
|
||||
};
|
||||
@ -59,6 +61,16 @@ public:
|
||||
|
||||
virtual ControlState GetState() const = 0;
|
||||
|
||||
bool ShouldHaveInput();
|
||||
|
||||
ControlState GetGatedState()
|
||||
{
|
||||
if (InputGateOn())
|
||||
return GetState();
|
||||
else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
Input* ToInput() override { return this; }
|
||||
};
|
||||
|
||||
@ -74,6 +86,12 @@ public:
|
||||
|
||||
virtual void SetState(ControlState state) = 0;
|
||||
|
||||
void SetGatedState(ControlState state)
|
||||
{
|
||||
if (InputGateOn())
|
||||
SetState(state);
|
||||
}
|
||||
|
||||
Output* ToOutput() override { return this; }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user