mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-10-11 05:16:19 +02:00
InputCommon: Allow controller settings specified with input expresions.
This commit is contained in:
1 parent
6a857df219
commit
e8152b700f
13 files changed
+172
-28
No files matched your search
@@ -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
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user