mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
ExpressionParser: Renamed ControlFinder to ControlEnvironment. Added support for variables and assignment operator. ControlExpression objects now reference a matching input and output so the two can me mixed in any expression. (you can set rumble directly from inputs)
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "InputCommon/ControlReference/ExpressionParser.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
class ControllerInterface;
|
||||
@ -20,6 +21,8 @@ class ControllerInterface;
|
||||
const char* const named_directions[] = {_trans("Up"), _trans("Down"), _trans("Left"),
|
||||
_trans("Right")};
|
||||
|
||||
class ControlReference;
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
class ControlGroup;
|
||||
@ -43,6 +46,7 @@ public:
|
||||
void SetDefaultDevice(ciface::Core::DeviceQualifier devq);
|
||||
|
||||
void UpdateReferences(const ControllerInterface& devi);
|
||||
void UpdateSingleControlReference(const ControllerInterface& devi, ControlReference* ref);
|
||||
|
||||
// This returns a lock that should be held before calling State() on any control
|
||||
// references and GetState(), by extension. This prevents a race condition
|
||||
@ -75,6 +79,12 @@ public:
|
||||
return T(std::lround((zero_value - neg_1_value) * input_value + zero_value));
|
||||
}
|
||||
|
||||
protected:
|
||||
// TODO: Wiimote attachment has its own member that isn't being used..
|
||||
ciface::ExpressionParser::ControlEnvironment::VariableContainer m_expression_vars;
|
||||
|
||||
void UpdateReferences(ciface::ExpressionParser::ControlEnvironment& env);
|
||||
|
||||
private:
|
||||
ciface::Core::DeviceQualifier m_default_device;
|
||||
bool m_default_device_is_connected{false};
|
||||
|
Reference in New Issue
Block a user