Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1178,14 +1178,18 @@ void W3DView::update(void)
* scrolling), the zoom will move toward matching the desired height.
*/
// TheSuperHackers @tweak Can now also zoom when the game is paused.
// TheSuperHackers @tweak The camera zoom speed is now decoupled from the render update.
// TheSuperHackers @bugfix The camera terrain height adjustment now also works in replay playback.

m_terrainHeightUnderCamera = getHeightAroundPos(m_pos.x, m_pos.y);
m_currentHeightAboveGround = m_cameraOffset.z * m_zoom - m_terrainHeightUnderCamera;

if (TheTerrainLogic && TheGlobalData && TheInGameUI && m_okToAdjustHeight)
{
Real desiredHeight = (m_terrainHeightUnderCamera + m_heightAboveGround);
Real desiredZoom = desiredHeight / m_cameraOffset.z;

if (didScriptedMovement || (TheGameLogic->isInReplayGame() && TheGlobalData->m_useCameraInReplay))
if (didScriptedMovement)
{
// if we are in a scripted camera movement, take its height above ground as our desired height.
m_heightAboveGround = m_currentHeightAboveGround;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,18 @@ void W3DView::update(void)
* scrolling), the zoom will move toward matching the desired height.
*/
// TheSuperHackers @tweak Can now also zoom when the game is paused.
// TheSuperHackers @tweak The camera zoom speed is now decoupled from the render update.
// TheSuperHackers @bugfix The camera terrain height adjustment now also works in replay playback.

m_terrainHeightUnderCamera = getHeightAroundPos(m_pos.x, m_pos.y);
m_currentHeightAboveGround = m_cameraOffset.z * m_zoom - m_terrainHeightUnderCamera;

if (TheTerrainLogic && TheGlobalData && TheInGameUI && m_okToAdjustHeight)
{
Real desiredHeight = (m_terrainHeightUnderCamera + m_heightAboveGround);
Real desiredZoom = desiredHeight / m_cameraOffset.z;

if (didScriptedMovement || (TheGameLogic->isInReplayGame() && TheGlobalData->m_useCameraInReplay))
if (didScriptedMovement)
{
// if we are in a scripted camera movement, take its height above ground as our desired height.
m_heightAboveGround = m_currentHeightAboveGround;
Expand Down
Loading