Skip to content

Commit 183a608

Browse files
committed
Replicate in Generals
1 parent 1802f65 commit 183a608

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,19 +399,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
399399

400400
Int spin = msg->getArgument( 1 )->integer;
401401

402-
// TheSuperHackers @tweak The camera zoom is now decoupled from the render update.
403-
const Real fpsRatio = (Real)BaseFps / TheGameEngine->getUpdateFps();
404-
const Real zoomHeight = (Real)View::ZoomHeightPerSecond * fpsRatio;
405-
406402
if (spin > 0)
407403
{
408404
for ( ; spin > 0; spin--)
409-
TheTacticalView->zoom( -zoomHeight );
405+
TheTacticalView->zoom( -View::ZoomHeightPerSecond );
410406
}
411407
else
412408
{
413409
for ( ;spin < 0; spin++ )
414-
TheTacticalView->zoom( +zoomHeight );
410+
TheTacticalView->zoom( +View::ZoomHeightPerSecond );
415411
}
416412

417413
break;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,34 +1195,34 @@ void W3DView::update(void)
11951195
{
11961196
Real desiredHeight = (m_terrainHeightUnderCamera + m_heightAboveGround);
11971197
Real desiredZoom = desiredHeight / m_cameraOffset.z;
1198+
11981199
if (didScriptedMovement || (TheGameLogic->isInReplayGame() && TheGlobalData->m_useCameraInReplay))
11991200
{
12001201
// if we are in a scripted camera movement, take its height above ground as our desired height.
12011202
m_heightAboveGround = m_currentHeightAboveGround;
12021203
//DEBUG_LOG(("Frame %d: height above ground: %g %g %g %g", TheGameLogic->getFrame(), m_heightAboveGround,
12031204
// m_cameraOffset.z, m_zoom, m_terrainHeightUnderCamera));
12041205
}
1206+
12051207
if (TheInGameUI->isScrolling())
12061208
{
12071209
// if scrolling, only adjust if we're too close or too far
12081210
if (m_scrollAmount.length() < m_scrollAmountCutoff || (m_currentHeightAboveGround < m_minHeightAboveGround) || (TheGlobalData->m_enforceMaxCameraHeight && m_currentHeightAboveGround > m_maxHeightAboveGround))
12091211
{
1210-
Real zoomAdj = (desiredZoom - m_zoom)*TheGlobalData->m_cameraAdjustSpeed;
1211-
if (fabs(zoomAdj) >= 0.0001) // only do positive
1212+
Real zoomAdj = (desiredZoom - m_zoom) * TheGlobalData->m_cameraAdjustSpeed * TheGameEngine->getActualLogicTimeScaleOverFpsRatio();
1213+
if (fabs(zoomAdj) >= 0.0001f) // only do positive
12121214
{
12131215
m_zoom += zoomAdj;
12141216
recalcCamera = true;
12151217
}
12161218
}
12171219
}
1218-
else
1220+
else if (!didScriptedMovement)
12191221
{
12201222
// we're not scrolling; settle toward desired height above ground
1221-
Real zoomAdj = (m_zoom - desiredZoom)*TheGlobalData->m_cameraAdjustSpeed;
1222-
Real zoomAdjAbs = fabs(zoomAdj);
1223-
if (zoomAdjAbs >= 0.0001 && !didScriptedMovement)
1223+
Real zoomAdj = (m_zoom - desiredZoom) * TheGlobalData->m_cameraAdjustSpeed * TheGameEngine->getActualLogicTimeScaleOverFpsRatio();
1224+
if (fabs(zoomAdj) >= 0.0001f)
12241225
{
1225-
//DEBUG_LOG(("W3DView::update() - m_zoom=%g, desiredHeight=%g", m_zoom, desiredZoom));
12261226
m_zoom -= zoomAdj;
12271227
recalcCamera = true;
12281228
}

0 commit comments

Comments
 (0)