mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
InputCommon: Allow controller settings specified with input expresions.
This commit is contained in:
@ -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