From f5889ba067f4d377e09b1d1bf2be1a24f90d8a22 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Mon, 29 Sep 2025 14:12:29 +0100 Subject: [PATCH] Tidying based on review 1.1 was changed to 1.f instead of 1.1f, so that's been fixed. Reduce the number of casts in RenderingManager::updateProjectionMatrix() --- apps/openmw/mwrender/renderingmanager.cpp | 8 ++++---- components/sceneutil/mwshadowtechnique.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 09330b4a54..8b62daba4a 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1361,10 +1361,10 @@ namespace MWRender if (mViewDistance < mNearClip) throw std::runtime_error("Viewing distance is less than near clip"); - const double width = Settings::video().mResolutionX; - const double height = Settings::video().mResolutionY; + const int width = Settings::video().mResolutionX; + const int height = Settings::video().mResolutionY; - double aspect = (height == 0.0) ? 1.0 : width / height; + double aspect = (height == 0) ? 1.0 : static_cast(width) / height; float fov = mFieldOfView; if (mFieldOfViewOverridden) fov = mFieldOfViewOverride; @@ -1389,7 +1389,7 @@ namespace MWRender } else { - mSharedUniformStateUpdater->setScreenRes(static_cast(width), static_cast(height)); + setScreenRes(width, height); } // Since our fog is not radial yet, we should take FOV in account, otherwise terrain near viewing distance may diff --git a/components/sceneutil/mwshadowtechnique.hpp b/components/sceneutil/mwshadowtechnique.hpp index 48b487649d..a2e811b95e 100644 --- a/components/sceneutil/mwshadowtechnique.hpp +++ b/components/sceneutil/mwshadowtechnique.hpp @@ -300,7 +300,7 @@ namespace SceneUtil { double _splitPointUniformLogRatio = 0.5; double _splitPointDeltaBias = 0.0; - float _polygonOffsetFactor = 1.f; + float _polygonOffsetFactor = 1.1f; float _polygonOffsetUnits = 4.0f; bool _useFrontFaceCulling = true;