ControllerEmu: Make BackgroundInput a global setting through the virtualization

This will allow us to simplify the checks for background input and push
them further down into the architecture, into the ControllerEmu layer.

The new setting isn't actually used yet, though.
This commit is contained in:
Jasper St. Pierre
2014-07-11 10:42:44 -04:00
parent 0d49bf65a7
commit 5abc028ace
5 changed files with 43 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#include <vector>
#include "Common/IniFile.h"
#include "Core/ConfigManager.h"
#include "InputCommon/GCPadStatus.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
@ -114,6 +115,25 @@ public:
}
};
class BackgroundInputSetting : public Setting
{
public:
BackgroundInputSetting(const std::string &_name) : Setting(_name, false)
{
is_virtual = true;
}
void SetValue(ControlState new_value) override
{
SConfig::GetInstance().m_BackgroundInput = new_value;
}
ControlState GetValue() override
{
return SConfig::GetInstance().m_BackgroundInput;
}
};
ControlGroup(const std::string& _name, const unsigned int _type = GROUP_TYPE_OTHER) : name(_name), type(_type) {}
virtual ~ControlGroup() {}