mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
Controls: Make the analog/digital mapping clash resolution more gentle.
Now takes the time into account, so clashing digital input will only shrink analog inputs once it's a few seconds old. Also fixes a bug where if there are both inputs, it was hard to reach the limits because the digital input itself ended up getting shrunk. This might help #17860
This commit is contained in:
1 parent
a07079bdf9
commit
be2f81c3eb
5 files changed
+47
-25
No files matched your search
+6
-4
@@ -1117,7 +1117,9 @@ void EmuScreen::update() {
|
||||
if (invalid_)
|
||||
return;
|
||||
|
||||
controlMapper_.Update();
|
||||
double now = time_now_d();
|
||||
|
||||
controlMapper_.Update(now);
|
||||
|
||||
if (pauseTrigger_) {
|
||||
pauseTrigger_ = false;
|
||||
@@ -1137,7 +1139,7 @@ void EmuScreen::update() {
|
||||
saveStatePreview_->SetFilename(fn);
|
||||
if (!fn.empty()) {
|
||||
saveStatePreview_->SetVisibility(UI::V_VISIBLE);
|
||||
saveStatePreviewShownTime_ = time_now_d();
|
||||
saveStatePreviewShownTime_ = now;
|
||||
} else {
|
||||
saveStatePreview_->SetVisibility(UI::V_GONE);
|
||||
}
|
||||
@@ -1145,10 +1147,10 @@ void EmuScreen::update() {
|
||||
|
||||
if (saveStatePreview_->GetVisibility() == UI::V_VISIBLE) {
|
||||
double endTime = saveStatePreviewShownTime_ + 2.0;
|
||||
float alpha = clamp_value((endTime - time_now_d()) * 4.0, 0.0, 1.0);
|
||||
float alpha = clamp_value((endTime - now) * 4.0, 0.0, 1.0);
|
||||
saveStatePreview_->SetColor(colorAlpha(0x00FFFFFF, alpha));
|
||||
|
||||
if (time_now_d() - saveStatePreviewShownTime_ > 2) {
|
||||
if (now - saveStatePreviewShownTime_ > 2) {
|
||||
saveStatePreview_->SetVisibility(UI::V_GONE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user