mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Add some paranoid checks around touch IDs that probably won't help #9647
Also adds LunaMoo to credits list.
This commit is contained in:
1 parent
4f6b9c1fd2
commit
9a1cd5a5e8
6 files changed
+9
-6
No files matched your search
@@ -644,6 +644,7 @@ void CreditsScreen::render() {
|
||||
"Coldbird",
|
||||
"Kyhel",
|
||||
"xebra",
|
||||
"LunaMoo",
|
||||
"",
|
||||
cr->T("specialthanks", "Special thanks to:"),
|
||||
"Maxim for his amazing Atrac3+ decoder work",
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ static int ScreenDPI() {
|
||||
HDC screenDC = GetDC(nullptr);
|
||||
int dotsPerInch = GetDeviceCaps(screenDC, LOGPIXELSY);
|
||||
ReleaseDC(nullptr, screenDC);
|
||||
return dotsPerInch;
|
||||
return dotsPerInch ? dotsPerInch : 96;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Submodule
+1
Submodule ext/freetype added at 3e79254ae7.
@@ -10,6 +10,9 @@
|
||||
const float estimatedInertiaDamping = 0.75f;
|
||||
|
||||
TouchInput GestureDetector::Update(const TouchInput &touch, const Bounds &bounds) {
|
||||
if (touch.id < 0 || touch.id >= MAX_PTRS) {
|
||||
return touch;
|
||||
}
|
||||
// Mouse / 1-finger-touch control.
|
||||
Pointer &p = pointers[touch.id];
|
||||
if ((touch.flags & TOUCH_DOWN) && bounds.Contains(touch.x, touch.y)) {
|
||||
@@ -79,13 +82,13 @@ void GestureDetector::UpdateFrame() {
|
||||
}
|
||||
|
||||
bool GestureDetector::IsGestureActive(Gesture gesture, int touchId) const {
|
||||
if (touchId < 0)
|
||||
if (touchId < 0 || touchId >= MAX_PTRS)
|
||||
return false;
|
||||
return (pointers[touchId].active & gesture) != 0;
|
||||
}
|
||||
|
||||
bool GestureDetector::GetGestureInfo(Gesture gesture, int touchId, float info[4]) const {
|
||||
if (touchId < 0)
|
||||
if (touchId < 0 || touchId >= MAX_PTRS)
|
||||
return false;
|
||||
memset(info, 0, sizeof(float) * 4);
|
||||
if (!(pointers[touchId].active & gesture)) {
|
||||
|
||||
@@ -438,8 +438,6 @@ protected:
|
||||
// Outputs of layout. X/Y are absolute screen coordinates, hierarchy is "gone" here.
|
||||
Bounds bounds_;
|
||||
|
||||
std::unique_ptr<Matrix4x4> transform_;
|
||||
|
||||
private:
|
||||
bool *enabledPtr_;
|
||||
bool enabled_;
|
||||
|
||||
@@ -890,7 +890,7 @@ float ScrollView::ClampedScrollPos(float pos) {
|
||||
|
||||
Gesture gesture = orientation_ == ORIENT_VERTICAL ? GESTURE_DRAG_VERTICAL : GESTURE_DRAG_HORIZONTAL;
|
||||
|
||||
if (scrollTouchId_ != -1 && gesture_.IsGestureActive(gesture, scrollTouchId_)) {
|
||||
if (scrollTouchId_ >= 0 && gesture_.IsGestureActive(gesture, scrollTouchId_) && bounds_.h > 0) {
|
||||
float maxPull = bounds_.h * 0.1f;
|
||||
if (pos < 0.0f) {
|
||||
float dist = std::min(-pos * (1.0f / bounds_.h), 1.0f);
|
||||
|
||||
Reference in new issue
Block a user