diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index c029fa4880a..169dce1bb72 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -2230,10 +2230,25 @@ void W3DView::setPitchToDefault() //------------------------------------------------------------------------------------------------- void W3DView::setDefaultView(Real pitch, Real angle, Real maxHeight) { + // TheSuperHackers @fix Mauller 08/05/2026 Adjust the maximum camera height to compensate for screen aspect ratio + Real baseAspectRatio = (Real)DEFAULT_DISPLAY_WIDTH / (Real)DEFAULT_DISPLAY_HEIGHT; + Real currentAspectRatio = (Real)TheTacticalView->getWidth() / (Real)TheTacticalView->getHeight(); + Real aspectRatioScale = 0.0f; + + if (currentAspectRatio > baseAspectRatio) + { + aspectRatioScale = fabs((1 + (currentAspectRatio - baseAspectRatio))); + } + else + { + aspectRatioScale = fabs((1 - (baseAspectRatio - currentAspectRatio))); + } + // MDC - we no longer want to rotate maps (design made all of them right to begin with) // m_defaultAngle = angle * M_PI/180.0f; setDefaultPitch(pitch); - m_maxHeightAboveGround = TheGlobalData->m_maxCameraHeight*maxHeight; + m_maxHeightAboveGround = TheGlobalData->m_maxCameraHeight * aspectRatioScale * maxHeight; + m_minHeightAboveGround = TheGlobalData->m_minCameraHeight * aspectRatioScale; if (m_minHeightAboveGround > m_maxHeightAboveGround) m_maxHeightAboveGround = m_minHeightAboveGround; } @@ -2275,7 +2290,6 @@ void W3DView::setZoomToDefault() m_heightAboveGround = m_maxHeightAboveGround; m_zoom = getMaxZoom(m_pos.x, m_pos.y); - stopDoingScriptedCamera(); m_CameraArrivedAtWaypointOnPathFlag = false; m_cameraAreaConstraintsValid = false; m_recalcCamera = true; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h index e5133a71386..dd0b1bb81e4 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h @@ -188,8 +188,11 @@ class GlobalData : public SubsystemInterface #if PRESERVE_RETAIL_SCRIPTED_CAMERA Real m_cameraHeight; #endif + + // TheSuperHackers @info Max and Min camera height for the original 4:3 view, these are then scaled for other aspect ratios. Real m_maxCameraHeight; Real m_minCameraHeight; + Real m_terrainHeightAtEdgeOfMap; Real m_unitDamagedThresh; Real m_unitReallyDamagedThresh; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index a6654bea139..2d90bb9473c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -880,6 +880,13 @@ static void saveOptions() TheInGameUI->recreateControlBar(); TheInGameUI->refreshCustomUiResources(); + + // TheSuperHackers @info Update the view so the shellmap looks correct when changing resolution + TheTacticalView->setDefaultView( + DEG_TO_RADF(TheGlobalData->m_cameraPitch), + DEG_TO_RADF(TheGlobalData->m_cameraYaw), + 1.0f); + TheTacticalView->setZoomToDefault(); } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index 622aeb5da10..ce12cc891bf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -2085,6 +2085,10 @@ void GameLogic::tryStartNewGame( Bool loadingSaveGame ) // update the loadscreen updateLoadProgress(LOAD_PROGRESS_POST_PRELOAD_ASSETS); + TheTacticalView->setDefaultView( + DEG_TO_RADF(TheGlobalData->m_cameraPitch), + DEG_TO_RADF(TheGlobalData->m_cameraYaw), + 1.0f); TheTacticalView->setAngleToDefault(); TheTacticalView->setPitchToDefault(); TheTacticalView->setZoomToDefault();