]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
Replaced all calls to str[n]cat and strncpy by calls to strlcat and strlcpy respectively
[xonotic/darkplaces.git] / gl_backend.c
index 414911f0de255ed613bb69946862b3347914a8a5..348dd65567082291e4f82062f34d1f69d81dc30c 100644 (file)
@@ -263,9 +263,6 @@ void GL_SetupView_Mode_Perspective (double frustumx, double frustumy, double zNe
 {
        double m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
@@ -298,9 +295,6 @@ void GL_SetupView_Mode_PerspectiveInfiniteFarClip (double frustumx, double frust
 {
        double nudge, m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
@@ -349,9 +343,6 @@ void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double
 {
        double m[16];
 
-       if (!r_render.integer)
-               return;
-
        // set up viewpoint
        CHECKGLERROR
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
@@ -735,9 +726,9 @@ void GL_TransformToScreen(const vec4_t in, vec4_t out)
        Matrix4x4_Transform4 (&backend_viewmatrix, in, temp);
        Matrix4x4_Transform4 (&backend_projectmatrix, temp, out);
        iw = 1.0f / out[3];
-       out[0] = r_view_x + (out[0] * iw + 1.0f) * r_view_width * 0.5f;
-       out[1] = r_view_y + (out[1] * iw + 1.0f) * r_view_height * 0.5f;
-       out[2] = r_view_z + (out[2] * iw + 1.0f) * r_view_depth * 0.5f;
+       out[0] = r_view.x + (out[0] * iw + 1.0f) * r_view.width * 0.5f;
+       out[1] = r_view.y + r_view.height - (out[1] * iw + 1.0f) * r_view.height * 0.5f;
+       out[2] = r_view.z + (out[2] * iw + 1.0f) * r_view.depth * 0.5f;
 }
 
 // called at beginning of frame
@@ -889,8 +880,8 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *
                return;
        }
        CHECKGLERROR
-       renderstats.meshes++;
-       renderstats.meshes_elements += numelements;
+       r_refdef.stats.meshes++;
+       r_refdef.stats.meshes_elements += numelements;
        if (gl_paranoid.integer)
        {
                unsigned int i, j, size;