WINTERMUTE: Handle camera pointer being null

This commit is contained in:
Gunnar Birke 2020-07-09 21:33:38 +02:00
parent 06ea22dfaa
commit a1371d002f

View file

@ -373,8 +373,8 @@ bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
glEnable(GL_NORMALIZE);
if (camera) {
_fov = camera->_fov;
setProjection();
Math::Matrix4 viewMatrix;
camera->getViewMatrix(&viewMatrix);
@ -383,6 +383,9 @@ bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
glGetFloatv(GL_MODELVIEW_MATRIX, _lastViewMatrix.getData());
}
setProjection();
}
return true;
}