@@ -674,7 +674,7 @@ Real W3DView::getCameraOffsetZ() const
674674 }
675675#endif
676676
677- return m_pos.z + TheGlobalData-> m_maxCameraHeight ;
677+ return m_pos.z + m_maxHeightAboveGround ;
678678}
679679
680680// -------------------------------------------------------------------------------------------------
@@ -2233,10 +2233,24 @@ void W3DView::setPitchToDefault()
22332233// -------------------------------------------------------------------------------------------------
22342234void W3DView::setDefaultView (Real pitch, Real angle, Real maxHeight)
22352235{
2236+ // TheSuperHackers @fix Mauller 08/05/2026 Adjust the maximum camera height to compensate for screen aspect ratio
2237+ Real baseAspectRatio = (Real)DEFAULT_DISPLAY_WIDTH / (Real)DEFAULT_DISPLAY_HEIGHT ;
2238+ Real currentAspectRatio = (Real)TheTacticalView->getWidth () / (Real)TheTacticalView->getHeight ();
2239+ Real aspectRatioScale = 1 .0f ;
2240+
2241+ if (currentAspectRatio > baseAspectRatio)
2242+ {
2243+ aspectRatioScale = fabs ((1 .0f + (currentAspectRatio - baseAspectRatio)));
2244+ const float nerf = 1 .0f - (currentAspectRatio - baseAspectRatio) / 12 .0f ;
2245+
2246+ aspectRatioScale *= nerf;
2247+ }
2248+
22362249 // MDC - we no longer want to rotate maps (design made all of them right to begin with)
22372250 // m_defaultAngle = angle * M_PI/180.0f;
22382251 setDefaultPitch (pitch);
2239- m_maxHeightAboveGround = TheGlobalData->m_maxCameraHeight *maxHeight;
2252+ m_maxHeightAboveGround = TheGlobalData->m_maxCameraHeight * aspectRatioScale * maxHeight;
2253+ m_minHeightAboveGround = TheGlobalData->m_minCameraHeight * aspectRatioScale;
22402254 if (m_minHeightAboveGround > m_maxHeightAboveGround)
22412255 m_maxHeightAboveGround = m_minHeightAboveGround;
22422256}
@@ -2278,7 +2292,6 @@ void W3DView::setZoomToDefault()
22782292 m_heightAboveGround = m_maxHeightAboveGround;
22792293 m_zoom = getMaxZoom (m_pos.x , m_pos.y );
22802294
2281- stopDoingScriptedCamera ();
22822295 m_CameraArrivedAtWaypointOnPathFlag = false ;
22832296 m_cameraAreaConstraintsValid = false ;
22842297 m_recalcCamera = true ;
0 commit comments