{
matrix4x4_t tempmatrix, basematrix;
memset(v, 0, sizeof(*v));
+
+ if(v_flipped.integer)
+ frustumx = -frustumx;
+
v->type = R_VIEWPORTTYPE_PERSPECTIVE;
v->cameramatrix = *cameramatrix;
v->x = x;
Matrix4x4_ConcatRotate(&basematrix, 90, 0, 0, 1);
Matrix4x4_Concat(&v->viewmatrix, &basematrix, &tempmatrix);
- //FIXME v_flipped_state is evil, this probably screws things up somewhere
- if(v_flipped_state)
- {
- Matrix4x4_Transpose(&basematrix, &v->viewmatrix);
- Matrix4x4_ConcatScale3(&basematrix, -1, 1, 1);
- Matrix4x4_Transpose(&v->viewmatrix, &basematrix);
- }
-
Matrix4x4_FromArrayDoubleGL(&v->projectmatrix, v->m);
if (nearplane)
matrix4x4_t tempmatrix, basematrix;
const double nudge = 1.0 - 1.0 / (1<<23);
memset(v, 0, sizeof(*v));
+
+ if(v_flipped.integer)
+ frustumx = -frustumx;
+
v->type = R_VIEWPORTTYPE_PERSPECTIVE_INFINITEFARCLIP;
v->cameramatrix = *cameramatrix;
v->x = x;
Matrix4x4_ConcatRotate(&basematrix, 90, 0, 0, 1);
Matrix4x4_Concat(&v->viewmatrix, &basematrix, &tempmatrix);
- //FIXME v_flipped_state is evil, this probably screws things up somewhere
- if(v_flipped_state)
- {
- Matrix4x4_Transpose(&basematrix, &v->viewmatrix);
- Matrix4x4_ConcatScale3(&basematrix, -1, 1, 1);
- Matrix4x4_Transpose(&v->viewmatrix, &basematrix);
- }
-
Matrix4x4_FromArrayDoubleGL(&v->projectmatrix, v->m);
if (nearplane)
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
// FIXME: v_flipped_state is evil, this probably breaks somewhere
- GL_SetMirrorState(v_flipped.integer && v->type != R_VIEWPORTTYPE_ORTHO);
+ GL_SetMirrorState(v_flipped.integer && (v->type == R_VIEWPORTTYPE_PERSPECTIVE || v->type == R_VIEWPORTTYPE_PERSPECTIVE_INFINITEFARCLIP));
// directly force an update of the modelview matrix
Matrix4x4_Concat(&backend_modelviewmatrix, &backend_viewport.viewmatrix, &backend_modelmatrix);