1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 22:23:52 +00:00

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 510eac3fb4)

17c10537 Validate near and far clip distances
This commit is contained in:
psi29a 2022-08-20 18:33:50 +00:00
parent d88b34131a
commit c4dd9d40fe

View file

@ -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");