diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index 00d28d9ab8..79e72bcf43 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -34,7 +34,7 @@ public: void Update() override; protected: - float GetButtonOpacity(); + virtual float GetButtonOpacity(); float lastFrameTime_; float secondsWithoutTouch_; diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index 0680dbd218..ca99089358 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -15,6 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include #include #include "base/colorutil.h" @@ -65,6 +66,12 @@ public: virtual float GetSpacing() const { return 1.0f; } virtual void SetSpacing(float s) { } +protected: + float GetButtonOpacity() override { + float opacity = g_Config.iTouchButtonOpacity / 100.0f; + return std::max(0.5f, opacity); + } + private: // convert from screen coordinates (leftColumnWidth to dp_xres) to actual fullscreen coordinates (0 to 1.0) inline float toFullscreenCoord(int screenx) {