diff --git a/Core/GameEngine/Include/GameClient/GameWindowTransitions.h b/Core/GameEngine/Include/GameClient/GameWindowTransitions.h index a95e4c3603d..5812db830c0 100644 --- a/Core/GameEngine/Include/GameClient/GameWindowTransitions.h +++ b/Core/GameEngine/Include/GameClient/GameWindowTransitions.h @@ -647,7 +647,7 @@ class TransitionGroup typedef std::list TransitionWindowList; TransitionWindowList m_transitionWindowList; Int m_directionMultiplier; - Int m_currentFrame; ///< maintain how long we've spent on this transition; + Real m_currentFrame; ///< maintain how long we've spent on this transition (in 30fps-equivalent frames); AsciiString m_name; }; diff --git a/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp b/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp index cd2205a44a2..9f6d8caae70 100644 --- a/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/GameWindowTransitions.cpp @@ -55,6 +55,7 @@ #include "GameClient/GameWindowTransitions.h" #include "GameClient/GameWindow.h" #include "GameClient/GameWindowManager.h" +#include "Common/FramePacer.h" //----------------------------------------------------------------------------- // DEFINES //////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- @@ -239,7 +240,7 @@ Int TransitionWindow::getTotalFrames( void ) //----------------------------------------------------------------------------- TransitionGroup::TransitionGroup( void ) { - m_currentFrame = 0; + m_currentFrame = 0.0f; m_fireOnce = FALSE; } @@ -256,7 +257,7 @@ TransitionGroup::~TransitionGroup( void ) void TransitionGroup::init( void ) { - m_currentFrame = 0; + m_currentFrame = 0.0f; m_directionMultiplier = 1; TransitionWindowList::iterator it = m_transitionWindowList.begin(); while (it != m_transitionWindowList.end()) @@ -270,7 +271,9 @@ void TransitionGroup::init( void ) void TransitionGroup::update( void ) { - m_currentFrame += m_directionMultiplier; // we go forward or backwards depending. + // TheSuperHackers @tweak bobtista GUI transition timing is now decoupled from the render update. + const Real timeScale = TheFramePacer->getBaseOverUpdateFpsRatio(); + m_currentFrame += m_directionMultiplier * timeScale; // we go forward or backwards depending. TransitionWindowList::iterator it = m_transitionWindowList.begin(); while (it != m_transitionWindowList.end()) { @@ -315,7 +318,7 @@ void TransitionGroup::reverse( void ) tWin->reverse(totalFrames); it++; } - m_currentFrame = totalFrames; + m_currentFrame = (Real)totalFrames; // m_currentFrame ++; } diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 4a90702f645..242fe4669ff 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -5534,8 +5534,12 @@ void InGameUI::updateAndDrawWorldAnimations( void ) } // update the Z value + // TheSuperHackers @tweak bobtista World animation Z-rise is now decoupled from the render update. if( wad->m_zRisePerSecond ) - wad->m_worldPos.z += wad->m_zRisePerSecond / LOGICFRAMES_PER_SECOND; + { + const Real timeScale = TheFramePacer->getBaseOverUpdateFpsRatio(); + wad->m_worldPos.z += wad->m_zRisePerSecond / LOGICFRAMES_PER_SECOND * timeScale; + } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index 4cc38ed6569..f6a5f052998 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -5707,8 +5707,12 @@ void InGameUI::updateAndDrawWorldAnimations( void ) } // update the Z value + // TheSuperHackers @tweak bobtista World animation Z-rise is now decoupled from the render update. if( wad->m_zRisePerSecond ) - wad->m_worldPos.z += wad->m_zRisePerSecond / LOGICFRAMES_PER_SECOND; + { + const Real timeScale = TheFramePacer->getBaseOverUpdateFpsRatio(); + wad->m_worldPos.z += wad->m_zRisePerSecond / LOGICFRAMES_PER_SECOND * timeScale; + } }