]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
Uncomment the texture binding check in R_Mesh_TexBind so that the engine makes less...
[xonotic/darkplaces.git] / gl_backend.c
index 3c497f4887bbcdcc31e3f4bb96c8d1c480cbcc92..fa8fc68a6a451787a93b6dad05bd5306960cc223 100644 (file)
@@ -130,7 +130,7 @@ int gl_maxdrawrangeelementsvertices;
 int gl_maxdrawrangeelementsindices;
 
 #ifdef DEBUGGL
-int errornumber = 0;
+int gl_errornumber = 0;
 
 void GL_PrintError(int errornumber, const char *filename, int linenumber)
 {
@@ -1106,15 +1106,15 @@ void R_Viewport_InitCubeSideView(r_viewport_t *v, const matrix4x4_t *cameramatri
        Matrix4x4_FromArrayFloatGL(&v->projectmatrix, m);
 }
 
-void R_Viewport_InitRectSideView(r_viewport_t *v, const matrix4x4_t *cameramatrix, int side, int size, int border, float nearclip, float farclip, const float *nearplane)
+void R_Viewport_InitRectSideView(r_viewport_t *v, const matrix4x4_t *cameramatrix, int side, int size, int border, float nearclip, float farclip, const float *nearplane, int offsetx, int offsety)
 {
        matrix4x4_t tempmatrix, basematrix;
        float m[16];
        memset(v, 0, sizeof(*v));
        v->type = R_VIEWPORTTYPE_PERSPECTIVECUBESIDE;
        v->cameramatrix = *cameramatrix;
-       v->x = (side & 1) * size;
-       v->y = (side >> 1) * size;
+       v->x = offsetx + (side & 1) * size;
+       v->y = offsety + (side >> 1) * size;
        v->width = size;
        v->height = size;
        v->depth = 1;
@@ -3873,8 +3873,8 @@ void R_Mesh_TexBind(unsigned int unitnum, rtexture_t *tex)
        int tex2d, tex3d, texcubemap, texnum;
        if (unitnum >= vid.teximageunits)
                return;
-//     if (unit->texture == tex)
-//             return;
+       if (unit->texture == tex)
+               return;
        switch(vid.renderpath)
        {
        case RENDERPATH_GL20: