WINTERMUTE: Handle camera pointer being null
This commit is contained in:
parent
06ea22dfaa
commit
a1371d002f
1 changed files with 11 additions and 8 deletions
|
@ -360,7 +360,7 @@ bool BaseRenderOpenGL3D::setup2D(bool force) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
|
bool BaseRenderOpenGL3D::setup3D(Camera3D *camera, bool force) {
|
||||||
if (!_state3D || force) {
|
if (!_state3D || force) {
|
||||||
_state3D = true;
|
_state3D = true;
|
||||||
|
|
||||||
|
@ -373,8 +373,8 @@ bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
|
||||||
|
|
||||||
glEnable(GL_NORMALIZE);
|
glEnable(GL_NORMALIZE);
|
||||||
|
|
||||||
|
if (camera) {
|
||||||
_fov = camera->_fov;
|
_fov = camera->_fov;
|
||||||
setProjection();
|
|
||||||
|
|
||||||
Math::Matrix4 viewMatrix;
|
Math::Matrix4 viewMatrix;
|
||||||
camera->getViewMatrix(&viewMatrix);
|
camera->getViewMatrix(&viewMatrix);
|
||||||
|
@ -383,6 +383,9 @@ bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
|
||||||
glGetFloatv(GL_MODELVIEW_MATRIX, _lastViewMatrix.getData());
|
glGetFloatv(GL_MODELVIEW_MATRIX, _lastViewMatrix.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProjection();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue