mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 20:58:54 +00:00
InputCommon: Extract ControlReference from ControllerInterface
Better separation of concerns. Relegates `ControllerInterface` to enumerating input controls, and the new `ControlReference` deals with combining inputs and configuration expression parsing.
This commit is contained in:
parent
f621a6af43
commit
a509f56116
15 changed files with 274 additions and 282 deletions
|
@ -42,8 +42,6 @@ public:
|
|||
public:
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual ~Control() {}
|
||||
bool InputGateOn();
|
||||
|
||||
virtual Input* ToInput() { return nullptr; }
|
||||
virtual Output* ToOutput() { return nullptr; }
|
||||
};
|
||||
|
@ -59,15 +57,6 @@ public:
|
|||
// things like absolute axes/ absolute mouse position will override this
|
||||
virtual bool IsDetectable() { return true; }
|
||||
virtual ControlState GetState() const = 0;
|
||||
|
||||
ControlState GetGatedState()
|
||||
{
|
||||
if (InputGateOn())
|
||||
return GetState();
|
||||
else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
Input* ToInput() override { return this; }
|
||||
};
|
||||
|
||||
|
@ -81,13 +70,6 @@ public:
|
|||
public:
|
||||
virtual ~Output() {}
|
||||
virtual void SetState(ControlState state) = 0;
|
||||
|
||||
void SetGatedState(ControlState state)
|
||||
{
|
||||
if (InputGateOn())
|
||||
SetState(state);
|
||||
}
|
||||
|
||||
Output* ToOutput() override { return this; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue