Skip to content

Commit 389c16e

Browse files
committed
Revert "tweak(scrolling): Use smoothened frame rate to scale movement for scrolling and camera"
This reverts commit c2aaeb9.
1 parent c2aaeb9 commit 389c16e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ void InGameUI::update( void )
19451945
if (m_cameraRotatingLeft || m_cameraRotatingRight || m_cameraZoomingIn || m_cameraZoomingOut)
19461946
{
19471947
// TheSuperHackers @tweak The camera rotation and zoom are now decoupled from the render update.
1948-
const Real fpsRatio = (Real)BaseFps / TheDisplay->getAverageFPS();
1948+
const Real fpsRatio = (Real)BaseFps / TheGameEngine->getUpdateFps();
19491949
const Real rotateAngle = TheGlobalData->m_keyboardCameraRotateSpeed * fpsRatio;
19501950
const Real zoomHeight = (Real)View::ZoomHeightPerSecond * fpsRatio;
19511951

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
3030

3131
#include "Common/GameType.h"
32+
#include "Common/GameEngine.h"
3233
#include "Common/MessageStream.h"
3334
#include "Common/Player.h"
3435
#include "Common/PlayerList.h"
@@ -438,7 +439,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
438439
{
439440

440441
// TheSuperHackers @bugfix Mauller 07/06/2025 The camera scrolling is now decoupled from the render update.
441-
const Real fpsRatio = (Real)BaseFps / TheDisplay->getAverageFPS();
442+
const Real fpsRatio = (Real)BaseFps / TheGameEngine->getUpdateFps();
442443

443444
switch (m_scrollType)
444445
{

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ void W3DView::update(void)
13551355
// if scrolling, only adjust if we're too close or too far
13561356
if (m_scrollAmount.length() < m_scrollAmountCutoff || (m_currentHeightAboveGround < m_minHeightAboveGround) || (TheGlobalData->m_enforceMaxCameraHeight && m_currentHeightAboveGround > m_maxHeightAboveGround))
13571357
{
1358-
const Real fpsRatio = (Real)BaseFps / TheDisplay->getAverageFPS();
1358+
const Real fpsRatio = (Real)BaseFps / TheGameEngine->getUpdateFps();
13591359
const Real zoomAdj = (desiredZoom - m_zoom) * TheGlobalData->m_cameraAdjustSpeed * fpsRatio;
13601360
if (fabs(zoomAdj) >= 0.0001f) // only do positive
13611361
{
@@ -1367,7 +1367,7 @@ void W3DView::update(void)
13671367
else if (!didScriptedMovement)
13681368
{
13691369
// we're not scrolling; settle toward desired height above ground
1370-
const Real fpsRatio = (Real)BaseFps / TheDisplay->getAverageFPS();
1370+
const Real fpsRatio = (Real)BaseFps / TheGameEngine->getUpdateFps();
13711371
const Real zoomAdj = (m_zoom - desiredZoom) * TheGlobalData->m_cameraAdjustSpeed * fpsRatio;
13721372
if (fabs(zoomAdj) >= 0.0001f)
13731373
{

0 commit comments

Comments
 (0)