]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
check the proper texture compression extension for deciding whether to S3TC compress
[xonotic/darkplaces.git] / gl_backend.c
index 72f41165ad7a0ac83c3ce237490da39c7e21a1b6..bd2d422099059861b5d98052afe578e8b31954e3 100644 (file)
@@ -404,9 +404,6 @@ void R_Viewport_InitPerspective(r_viewport_t *v, const matrix4x4_t *cameramatrix
        float m[16];
        memset(v, 0, sizeof(*v));
 
-       if(v_flipped.integer)
-               frustumx = -frustumx;
-
        v->type = R_VIEWPORTTYPE_PERSPECTIVE;
        v->cameramatrix = *cameramatrix;
        v->x = x;
@@ -432,6 +429,14 @@ void R_Viewport_InitPerspective(r_viewport_t *v, const matrix4x4_t *cameramatrix
        if (nearplane)
                R_Viewport_ApplyNearClipPlaneFloatGL(v, m, nearplane[0], nearplane[1], nearplane[2], nearplane[3]);
 
+       if(v_flipped.integer)
+       {
+               m[0] = -m[0];
+               m[4] = -m[4];
+               m[8] = -m[8];
+               m[12] = -m[12];
+       }
+
        Matrix4x4_FromArrayFloatGL(&v->projectmatrix, m);
 }
 
@@ -442,9 +447,6 @@ void R_Viewport_InitPerspectiveInfinite(r_viewport_t *v, const matrix4x4_t *came
        float m[16];
        memset(v, 0, sizeof(*v));
 
-       if(v_flipped.integer)
-               frustumx = -frustumx;
-
        v->type = R_VIEWPORTTYPE_PERSPECTIVE_INFINITEFARCLIP;
        v->cameramatrix = *cameramatrix;
        v->x = x;
@@ -470,6 +472,14 @@ void R_Viewport_InitPerspectiveInfinite(r_viewport_t *v, const matrix4x4_t *came
        if (nearplane)
                R_Viewport_ApplyNearClipPlaneFloatGL(v, m, nearplane[0], nearplane[1], nearplane[2], nearplane[3]);
 
+       if(v_flipped.integer)
+       {
+               m[0] = -m[0];
+               m[4] = -m[4];
+               m[8] = -m[8];
+               m[12] = -m[12];
+       }
+
        Matrix4x4_FromArrayFloatGL(&v->projectmatrix, m);
 }