From 1902a2278346601fa88ef9cc7768cb4969fab9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 17 Dec 2017 02:58:47 -0300 Subject: [PATCH] Fixed wrong time elapsed in UIManager. Fixed backgorunds drawable alpha. --HG-- branch : dev --- include/eepp/ui/uimanager.hpp | 1 + src/eepp/ui/uibackground.cpp | 1 + src/eepp/ui/uimanager.cpp | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/eepp/ui/uimanager.hpp b/include/eepp/ui/uimanager.hpp index 95ffb0636..c3cd500b0 100644 --- a/include/eepp/ui/uimanager.hpp +++ b/include/eepp/ui/uimanager.hpp @@ -161,6 +161,7 @@ class EE_API UIManager { UIControl * mLossFocusControl; std::list mWindowsList; std::list mCloseList; + Clock mClock; Time mElapsed; Int32 mCbId; diff --git a/src/eepp/ui/uibackground.cpp b/src/eepp/ui/uibackground.cpp index b62fca9b1..4cbaa40d5 100644 --- a/src/eepp/ui/uibackground.cpp +++ b/src/eepp/ui/uibackground.cpp @@ -140,6 +140,7 @@ void UIBackground::draw( Rectf R, const Float& alpha ) { } if ( NULL != mDrawable ) { + mDrawable->setAlpha( alpha ); mDrawable->draw( R.getPosition(), R.getSize() ); } } diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 10fe09975..8e83b0e40 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -83,6 +83,8 @@ void UIManager::init( Uint32 Flags, EE::Window::Window * window ) { mCbId = mKM->pushCallback( cb::Make1( this, &UIManager::inputCallback ) ); mResizeCb = mWindow->pushResizeCallback( cb::Make1( this, &UIManager::resizeControl ) ); + + mClock.restart(); } void UIManager::shutdown() { @@ -203,7 +205,7 @@ void UIManager::sendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flag } void UIManager::update() { - mElapsed = mWindow->getElapsed(); + mElapsed = mClock.getElapsed(); bool wasDraggingControl = isControlDragging();