From a53d31a8d76d97aa1ea6ddb43f1bd412457350d7 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 17 Jan 2016 19:23:28 +0100 Subject: [PATCH] Make virtual gamepad visible from the start if button fading is on. They'll fade out after a while. --- UI/GamepadEmu.cpp | 4 ++++ UI/GamepadEmu.h | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 6b39123bfb..7b355040bd 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -34,6 +34,10 @@ static u32 GetButtonColor() { return g_Config.iTouchButtonStyle == 1 ? 0xFFFFFF : 0xc0b080; } +GamepadView::GamepadView(UI::LayoutParams *layoutParams) : UI::View(layoutParams), secondsWithoutTouch_(0) { + lastFrameTime_ = time_now_d(); +} + void GamepadView::Touch(const TouchInput &input) { secondsWithoutTouch_ = 0.0f; } diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index fb600fc8fa..eaebd5e9c8 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -25,8 +25,7 @@ class GamepadView : public UI::View { public: - GamepadView(UI::LayoutParams *layoutParams) : UI::View(layoutParams), lastFrameTime_(0.0f), secondsWithoutTouch_(0) { - } + GamepadView(UI::LayoutParams *layoutParams); void Touch(const TouchInput &input) override; bool Key(const KeyInput &input) override {