mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Input system refactor: Replace 5 callbacks with an interface
This commit is contained in:
1 parent
dc554e27eb
commit
a6ac956884
7 files changed
+71
-72
No files matched your search
+15
-12
@@ -480,18 +480,21 @@ void KeyMappingNewMouseKeyDialog::axis(const AxisInput &axis) {
|
||||
}
|
||||
|
||||
AnalogCalibrationScreen::AnalogCalibrationScreen(const Path &gamePath) : UITwoPaneBaseDialogScreen(gamePath, TwoPaneFlags::SettingsCanScroll) {
|
||||
mapper_.SetCallbacks(
|
||||
[](int vkey, bool down) {},
|
||||
[](int vkey, float analogValue) {},
|
||||
[&](uint32_t bitsToSet, uint32_t bitsToClear) {},
|
||||
[&](int iInternalRotation, int stick, float x, float y) {
|
||||
analogX_[stick] = x;
|
||||
analogY_[stick] = y;
|
||||
},
|
||||
[&](int stick, float x, float y) {
|
||||
rawX_[stick] = x;
|
||||
rawY_[stick] = y;
|
||||
});
|
||||
mapper_.SetListener(this);
|
||||
}
|
||||
|
||||
AnalogCalibrationScreen::~AnalogCalibrationScreen() {
|
||||
mapper_.SetListener(nullptr);
|
||||
}
|
||||
|
||||
void AnalogCalibrationScreen::SetPSPAnalog(int rotation, int stick, float x, float y) {
|
||||
analogX_[stick] = x;
|
||||
analogY_[stick] = y;
|
||||
}
|
||||
|
||||
void AnalogCalibrationScreen::SetRawAnalog(int stick, float x, float y) {
|
||||
rawX_[stick] = x;
|
||||
rawY_[stick] = y;
|
||||
}
|
||||
|
||||
void AnalogCalibrationScreen::update() {
|
||||
|
||||
Reference in new issue
Block a user