Skip to content
Open
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
13 changes: 5 additions & 8 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2082,9 +2082,6 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
// update the loadscreen
updateLoadProgress(LOAD_PROGRESS_POST_PRELOAD_ASSETS);

TheTacticalView->setAngleAndPitchToDefault();
TheTacticalView->setZoomToDefault();

if( TheRecorder )
TheRecorder->initControls();

Expand All @@ -2108,6 +2105,11 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
// update the loadscreen
updateLoadProgress(LOAD_PROGRESS_POST_STARTING_CAMERA);

// Set up the camera height based on the map height & globalData.
TheTacticalView->initHeightForMap();
TheTacticalView->setAngleAndPitchToDefault();
TheTacticalView->setZoomToDefault();

Waypoint *way = findNamedWaypoint(startingCamName);
if (way)
{
Expand All @@ -2126,11 +2128,6 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
DEBUG_LOG(("Failed to find initial camera position waypoint %s", startingCamName.str()));
}

// Set up the camera height based on the map height & globalData.
TheTacticalView->initHeightForMap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initHeightForMap relies on m_pos to calculate the ground height. Since m_pos is only updated after lookAt is called, removing this second initHeightForMap means the height adjustment would be skipped for the initial camera position. That’s why this call seems necessary.

TheTacticalView->setAngleAndPitchToDefault();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both setAngleAndPitchToDefault() and setZoomToDefault() call setCameraTransform() which also relies on m_pos

TheTacticalView->setZoomToDefault();

// update the loadscreen
updateLoadProgress(LOAD_PROGRESS_POST_STARTING_CAMERA_2);

Expand Down
Loading