Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Sep 18, 2025

This change fixes camera terrain height adjustment during camera playback in Replay playback. Originally the saved camera would not raise or lower when scrolling over a mountain or valley. This happened because of the (min) and max zoom clamping. Removing the clamping solves this.

TODO

  • Replicate in Generals

@xezon xezon added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Sep 18, 2025
@xezon xezon force-pushed the xezon/fix-camera-terrain-adjustment-with-camera-playback branch from 5476545 to 7bfca02 Compare September 20, 2025 10:30
@xezon
Copy link
Author

xezon commented Sep 20, 2025

Replicated in Generals with conflicts

D:\Projects\TheSuperHackers\GeneralsGameCode>FOR /F "delims=" %b IN ('git merge-base --fork-point main') DO git diff %b  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git diff b1eac2a5bb23d822ec90b2a8d7feadb74a992a23  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
Checking patch Generals/Code/GameEngine/Include/GameClient/View.h...
Hunk #1 succeeded at 180 (offset -4 lines).
Hunk #2 succeeded at 262 (offset -4 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp...
Hunk #1 succeeded at 5345 (offset -172 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/View.cpp...
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp...
error: while searching for:

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
void W3DView::setZoom(Real z)
{
        m_zoom = z;

        if (m_zoom < m_minZoom)
                m_zoom = m_minZoom;

        if (m_zoom > m_maxZoom)
                m_zoom = m_maxZoom;

        m_doingMoveCameraOnWaypointPath = false;
        m_CameraArrivedAtWaypointOnPathFlag = false;

error: patch failed: Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp:1940
Applied patch Generals/Code/GameEngine/Include/GameClient/View.h cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/View.cpp cleanly.
Applying patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp with 1 reject...
Rejected hunk #1.

@xezon xezon merged commit 1a78051 into TheSuperHackers:main Sep 20, 2025
18 checks passed
@xezon xezon deleted the xezon/fix-camera-terrain-adjustment-with-camera-playback branch September 20, 2025 10:46
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants