forked from mirror/openmw-tes3mp
Remove redundant update function
This commit is contained in:
parent
e7d2a8a4dc
commit
f67dbc8aa0
6 changed files with 18 additions and 47 deletions
|
@ -161,11 +161,6 @@ void OMW::Engine::frame(float frametime)
|
||||||
|
|
||||||
// update GUI
|
// update GUI
|
||||||
mEnvironment.getWindowManager()->onFrame(frametime);
|
mEnvironment.getWindowManager()->onFrame(frametime);
|
||||||
if (mEnvironment.getStateManager()->getState()!=
|
|
||||||
MWBase::StateManager::State_NoGame)
|
|
||||||
{
|
|
||||||
mEnvironment.getWindowManager()->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int frameNumber = mViewer->getFrameStamp()->getFrameNumber();
|
unsigned int frameNumber = mViewer->getFrameStamp()->getFrameNumber();
|
||||||
osg::Stats* stats = mViewer->getViewerStats();
|
osg::Stats* stats = mViewer->getViewerStats();
|
||||||
|
|
|
@ -102,13 +102,6 @@ namespace MWBase
|
||||||
|
|
||||||
virtual ~WindowManager() {}
|
virtual ~WindowManager() {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Should be called each frame to update windows/gui elements.
|
|
||||||
* This could mean updating sizes of gui elements or opening
|
|
||||||
* new dialogs.
|
|
||||||
*/
|
|
||||||
virtual void update() = 0;
|
|
||||||
|
|
||||||
/// @note This method will block until the video finishes playing
|
/// @note This method will block until the video finishes playing
|
||||||
/// (and will continually update the window while doing so)
|
/// (and will continually update the window while doing so)
|
||||||
virtual void playVideo(const std::string& name, bool allowSkipping) = 0;
|
virtual void playVideo(const std::string& name, bool allowSkipping) = 0;
|
||||||
|
|
|
@ -371,6 +371,20 @@ namespace MWGui
|
||||||
|
|
||||||
if (mIsDrowning)
|
if (mIsDrowning)
|
||||||
mDrowningFlashTheta += dt * osg::PI*2;
|
mDrowningFlashTheta += dt * osg::PI*2;
|
||||||
|
|
||||||
|
mSpellIcons->updateWidgets(mEffectBox, true);
|
||||||
|
|
||||||
|
if (mEnemyActorId != -1 && mEnemyHealth->getVisible())
|
||||||
|
{
|
||||||
|
updateEnemyHealthBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mIsDrowning)
|
||||||
|
{
|
||||||
|
float intensity = (cos(mDrowningFlashTheta) + 2.0f) / 3.0f;
|
||||||
|
|
||||||
|
mDrowningFlash->setAlpha(intensity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
void HUD::setSelectedSpell(const std::string& spellId, int successChancePercent)
|
||||||
|
@ -602,23 +616,6 @@ namespace MWGui
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD::update()
|
|
||||||
{
|
|
||||||
mSpellIcons->updateWidgets(mEffectBox, true);
|
|
||||||
|
|
||||||
if (mEnemyActorId != -1 && mEnemyHealth->getVisible())
|
|
||||||
{
|
|
||||||
updateEnemyHealthBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mIsDrowning)
|
|
||||||
{
|
|
||||||
float intensity = (cos(mDrowningFlashTheta) + 2.0f) / 3.0f;
|
|
||||||
|
|
||||||
mDrowningFlash->setAlpha(intensity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HUD::setEnemy(const MWWorld::Ptr &enemy)
|
void HUD::setEnemy(const MWWorld::Ptr &enemy)
|
||||||
{
|
{
|
||||||
mEnemyActorId = enemy.getClass().getCreatureStats(enemy).getActorId();
|
mEnemyActorId = enemy.getClass().getCreatureStats(enemy).getActorId();
|
||||||
|
|
|
@ -55,8 +55,6 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Widget* getEffectBox() { return mEffectBox; }
|
MyGUI::Widget* getEffectBox() { return mEffectBox; }
|
||||||
|
|
||||||
void update();
|
|
||||||
|
|
||||||
void setEnemy(const MWWorld::Ptr& enemy);
|
void setEnemy(const MWWorld::Ptr& enemy);
|
||||||
void resetEnemy();
|
void resetEnemy();
|
||||||
|
|
||||||
|
|
|
@ -581,15 +581,6 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::update()
|
|
||||||
{
|
|
||||||
cleanupGarbage();
|
|
||||||
|
|
||||||
mHud->update();
|
|
||||||
|
|
||||||
updateActivatedQuickKey ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowManager::updateVisible()
|
void WindowManager::updateVisible()
|
||||||
{
|
{
|
||||||
if (!mMap)
|
if (!mMap)
|
||||||
|
@ -926,6 +917,10 @@ namespace MWGui
|
||||||
|
|
||||||
if (mCharGen)
|
if (mCharGen)
|
||||||
mCharGen->onFrame(frameDuration);
|
mCharGen->onFrame(frameDuration);
|
||||||
|
|
||||||
|
updateActivatedQuickKey ();
|
||||||
|
|
||||||
|
cleanupGarbage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::changeCell(const MWWorld::CellStore* cell)
|
void WindowManager::changeCell(const MWWorld::CellStore* cell)
|
||||||
|
|
|
@ -146,13 +146,6 @@ namespace MWGui
|
||||||
/// (and will continually update the window while doing so)
|
/// (and will continually update the window while doing so)
|
||||||
virtual void playVideo(const std::string& name, bool allowSkipping);
|
virtual void playVideo(const std::string& name, bool allowSkipping);
|
||||||
|
|
||||||
/**
|
|
||||||
* Should be called each frame to update windows/gui elements.
|
|
||||||
* This could mean updating sizes of gui elements or opening
|
|
||||||
* new dialogs.
|
|
||||||
*/
|
|
||||||
virtual void update();
|
|
||||||
|
|
||||||
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
|
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
|
||||||
virtual void setKeyFocusWidget (MyGUI::Widget* widget);
|
virtual void setKeyFocusWidget (MyGUI::Widget* widget);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue