From c4dd9d40fe17a7e3be85da3b5dad4ebb2bc5597c Mon Sep 17 00:00:00 2001 From: psi29a Date: Sat, 20 Aug 2022 18:33:50 +0000 Subject: [PATCH] Merge branch 'dont-look-back-in-anger-or-look-backwards-at-all-really' into 'master' Validate near and far clip distances See merge request OpenMW/openmw!2311 (cherry picked from commit 510eac3fb427ad1ff4c1201b6b7312b9abb91ad1) 17c10537 Validate near and far clip distances --- apps/openmw/mwrender/renderingmanager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 403c915335..f295318872 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1275,6 +1275,11 @@ namespace MWRender void RenderingManager::updateProjectionMatrix() { + if (mNearClip < 0.0f) + throw std::runtime_error("Near clip is less than zero"); + if (mViewDistance < mNearClip) + throw std::runtime_error("Viewing distance is less than near clip"); + double width = Settings::Manager::getInt("resolution x", "Video"); double height = Settings::Manager::getInt("resolution y", "Video");