mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-04 01:51:38 +00:00
Use MyGUI frame events for ScreenFader
This commit is contained in:
parent
e4f0f7157a
commit
a4737d8417
3 changed files with 11 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <MyGUI_RenderManager.h>
|
#include <MyGUI_RenderManager.h>
|
||||||
#include <MyGUI_ImageBox.h>
|
#include <MyGUI_ImageBox.h>
|
||||||
|
#include <MyGUI_Gui.h>
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
@ -80,6 +81,8 @@ namespace MWGui
|
||||||
, mFactor(1.f)
|
, mFactor(1.f)
|
||||||
, mRepeat(false)
|
, mRepeat(false)
|
||||||
{
|
{
|
||||||
|
MyGUI::Gui::getInstance().eventFrameStart += MyGUI::newDelegate(this, &ScreenFader::onFrameStart);
|
||||||
|
|
||||||
mMainWidget->setSize(MyGUI::RenderManager::getInstance().getViewSize());
|
mMainWidget->setSize(MyGUI::RenderManager::getInstance().getViewSize());
|
||||||
|
|
||||||
MyGUI::ImageBox* imageBox = mMainWidget->castType<MyGUI::ImageBox>(false);
|
MyGUI::ImageBox* imageBox = mMainWidget->castType<MyGUI::ImageBox>(false);
|
||||||
|
@ -94,7 +97,12 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenFader::update(float dt)
|
ScreenFader::~ScreenFader()
|
||||||
|
{
|
||||||
|
MyGUI::Gui::getInstance().eventFrameStart -= MyGUI::newDelegate(this, &ScreenFader::onFrameStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenFader::onFrameStart(float dt)
|
||||||
{
|
{
|
||||||
if (!mQueue.empty())
|
if (!mQueue.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,8 +36,9 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScreenFader(const std::string & texturePath, const std::string& layout = "openmw_screen_fader.layout", const MyGUI::FloatCoord& texCoordOverride = MyGUI::FloatCoord(0,0,1,1));
|
ScreenFader(const std::string & texturePath, const std::string& layout = "openmw_screen_fader.layout", const MyGUI::FloatCoord& texCoordOverride = MyGUI::FloatCoord(0,0,1,1));
|
||||||
|
~ScreenFader();
|
||||||
|
|
||||||
void update(float dt);
|
void onFrameStart(float dt);
|
||||||
|
|
||||||
void fadeIn(const float time, float delay=0);
|
void fadeIn(const float time, float delay=0);
|
||||||
void fadeOut(const float time, float delay=0);
|
void fadeOut(const float time, float delay=0);
|
||||||
|
|
|
@ -894,12 +894,6 @@ namespace MWGui
|
||||||
|
|
||||||
mHud->onFrame(frameDuration);
|
mHud->onFrame(frameDuration);
|
||||||
|
|
||||||
if (mWerewolfFader)
|
|
||||||
mWerewolfFader->update(frameDuration);
|
|
||||||
mBlindnessFader->update(frameDuration);
|
|
||||||
mHitFader->update(frameDuration);
|
|
||||||
mScreenFader->update(frameDuration);
|
|
||||||
|
|
||||||
mDebugWindow->onFrame(frameDuration);
|
mDebugWindow->onFrame(frameDuration);
|
||||||
|
|
||||||
if (mCharGen)
|
if (mCharGen)
|
||||||
|
|
Loading…
Reference in a new issue