Backport review comments from yuzu-emu/yuzu#4382: "yuzu: Add motion and touch configuration from Citra" (#5543)
This commit is contained in:
parent
a93d7a8d3a
commit
14924e9db3
9 changed files with 127 additions and 108 deletions
|
@ -118,8 +118,10 @@ Common::ParamPackage GetControllerAnalogBinds(const Common::ParamPackage& params
|
|||
}
|
||||
|
||||
void ReloadInputDevices() {
|
||||
if (udp)
|
||||
udp->ReloadUDPClient();
|
||||
if (!udp) {
|
||||
return;
|
||||
}
|
||||
udp->ReloadUDPClient();
|
||||
}
|
||||
|
||||
namespace Polling {
|
||||
|
|
|
@ -30,19 +30,19 @@ public:
|
|||
if (state) {
|
||||
const float x = static_cast<float>(std::get<1>(m)) / Core::kScreenBottomWidth;
|
||||
const float y = static_cast<float>(std::get<2>(m)) / Core::kScreenBottomHeight;
|
||||
return std::make_tuple(x, y, true);
|
||||
return {x, y, true};
|
||||
}
|
||||
}
|
||||
return std::make_tuple(0.0f, 0.0f, false);
|
||||
return {};
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map; // button, x, y
|
||||
// A vector of the mapped button, its x and its y-coordinate
|
||||
std::vector<std::tuple<std::unique_ptr<Input::ButtonDevice>, int, int>> map;
|
||||
};
|
||||
|
||||
std::unique_ptr<Input::TouchDevice> TouchFromButtonFactory::Create(
|
||||
const Common::ParamPackage& params) {
|
||||
|
||||
return std::make_unique<TouchFromButtonDevice>();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ class TouchFromButtonFactory final : public Input::Factory<Input::TouchDevice> {
|
|||
public:
|
||||
/**
|
||||
* Creates a touch device from a list of button devices
|
||||
* @param unused
|
||||
*/
|
||||
std::unique_ptr<Input::TouchDevice> Create(const Common::ParamPackage& params) override;
|
||||
};
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <functional>
|
||||
#include <thread>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include "common/logging/log.h"
|
||||
#include "input_common/udp/client.h"
|
||||
#include "input_common/udp/protocol.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue