mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-29 05:18:03 +03:00
InputCommon: Allow controller settings specified with input expresions.
This commit is contained in:
parent
6a857df219
commit
e8152b700f
13 changed files with 172 additions and 28 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include "InputCommon/ControlReference/ExpressionParser.h"
|
||||
#include "InputCommon/ControlReference/FunctionExpression.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
// ControlReference
|
||||
|
@ -30,6 +31,9 @@ public:
|
|||
virtual ControlState State(const ControlState state = 0) = 0;
|
||||
virtual bool IsInput() const = 0;
|
||||
|
||||
template <typename T>
|
||||
T GetState();
|
||||
|
||||
int BoundCount() const;
|
||||
ciface::ExpressionParser::ParseStatus GetParseStatus() const;
|
||||
void UpdateReference(ciface::ExpressionParser::ControlEnvironment& env);
|
||||
|
@ -45,6 +49,18 @@ protected:
|
|||
ciface::ExpressionParser::ParseStatus m_parse_status;
|
||||
};
|
||||
|
||||
template <>
|
||||
inline bool ControlReference::GetState<bool>()
|
||||
{
|
||||
return State() > ciface::ExpressionParser::CONDITION_THRESHOLD;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T ControlReference::GetState()
|
||||
{
|
||||
return State();
|
||||
}
|
||||
|
||||
//
|
||||
// InputReference
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue