diff options
| author | Matthew Parlane <parlane@gmail.com> | 2013-01-26 21:46:12 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2013-01-26 21:46:12 +1300 |
| commit | ca4ea817e094c0725b526184f41f41e506a68637 (patch) | |
| tree | 7a93c40339fd30444383ed0984cbfcb061a10bf7 /Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h | |
| parent | 1083884b8b9566a05dd03e03f978ec3ece58f4dd (diff) | |
| parent | 2f28d938cf640390cd8979c6104f3dbe8795e1e6 (diff) | |
Merge branch 'master' into wii-network
Conflicts:
Source/Core/Common/Src/CommonPaths.h
Source/Core/Common/Src/FileUtil.h
Source/Core/Core/Src/HLE/HLE.cpp
Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h index 7c5a236d75..b846bb56e8 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h @@ -87,7 +87,7 @@ public: Input* ToInput() { return this; } }; - + // // Output // @@ -122,6 +122,36 @@ public: protected: void AddInput(Input* const i); void AddOutput(Output* const o); + + class FullAnalogSurface : public Input + { + public: + FullAnalogSurface(Input* low, Input* high) + : m_low(*low), m_high(*high) + {} + + ControlState GetState() const + { + return (1 + m_high.GetState() - m_low.GetState()) / 2; + } + + std::string GetName() const + { + return m_low.GetName() + *m_high.GetName().rbegin(); + } + + private: + Input& m_low; + Input& m_high; + }; + + void AddAnalogInputs(Input* low, Input* high) + { + AddInput(low); + AddInput(high); + AddInput(new FullAnalogSurface(low, high)); + AddInput(new FullAnalogSurface(high, low)); + } private: std::vector<Input*> m_inputs; |
