]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
vid: consolidate mode structures
[xonotic/darkplaces.git] / gl_rmain.c
index a8a92dd1b6fa63ec91ad7491417689ea105b5df3..26c90911d26ba016dd676a6a4ba83fe995ab06cc 100644 (file)
@@ -4411,7 +4411,7 @@ void R_SetupView(qbool allowwaterclippingplane, int viewfbo, rtexture_t *viewdep
 
        // GL is weird because it's bottom to top, r_refdef.view.y is top to bottom.
        // Unless the render target is a FBO...
-       viewy_adjusted = viewfbo ? viewy : vid.height - viewheight - viewy;
+       viewy_adjusted = viewfbo ? viewy : vid.mode.height - viewheight - viewy;
 
        if (!r_refdef.view.useperspective)
                R_Viewport_InitOrtho3D(&r_refdef.view.viewport, &r_refdef.view.matrix, viewx, viewy_adjusted, viewwidth, viewheight, r_refdef.view.ortho_x, r_refdef.view.ortho_y, -r_refdef.farclip, r_refdef.farclip, customclipplane);
@@ -4454,7 +4454,7 @@ void R_ResetViewRendering2D_Common(int viewfbo, rtexture_t *viewdepthtexture, rt
 
        // GL is weird because it's bottom to top, r_refdef.view.y is top to bottom.
        // Unless the render target is a FBO...
-       viewy_adjusted = viewfbo ? viewy : vid.height - viewheight - viewy;
+       viewy_adjusted = viewfbo ? viewy : vid.mode.height - viewheight - viewy;
 
        R_Viewport_InitOrtho(&viewport, &identitymatrix, viewx, viewy_adjusted, viewwidth, viewheight, 0, 0, x2, y2, -10, 100, NULL);
        R_Mesh_SetRenderTargets(viewfbo, viewdepthtexture, viewcolortexture, NULL, NULL, NULL);
@@ -5070,8 +5070,8 @@ static void R_Bloom_StartFrame(void)
                viewscalefpsadjusted = 1.0f;
 
        scale = r_viewscale.value * sqrt(viewscalefpsadjusted);
-       if (vid.samples)
-               scale *= sqrt(vid.samples); // supersampling
+       if (vid.mode.samples)
+               scale *= sqrt(vid.mode.samples); // supersampling
        scale = bound(0.03125f, scale, 4.0f);
        screentexturewidth = (int)ceil(r_refdef.view.width * scale);
        screentextureheight = (int)ceil(r_refdef.view.height * scale);
@@ -10184,10 +10184,10 @@ void R_DebugLine(vec3_t start, vec3_t end)
        Vector4Set(w[1], end[0], end[1], end[2], 1);
        R_Viewport_TransformToScreen(&r_refdef.view.viewport, w[0], s[0]);
        R_Viewport_TransformToScreen(&r_refdef.view.viewport, w[1], s[1]);
-       x1 = s[0][0] * vid_conwidth.value / vid.width;
-       y1 = (vid.height - s[0][1]) * vid_conheight.value / vid.height;
-       x2 = s[1][0] * vid_conwidth.value / vid.width;
-       y2 = (vid.height - s[1][1]) * vid_conheight.value / vid.height;
+       x1 = s[0][0] * vid_conwidth.value / vid.mode.width;
+       y1 = (vid.mode.height - s[0][1]) * vid_conheight.value / vid.mode.height;
+       x2 = s[1][0] * vid_conwidth.value / vid.mode.width;
+       y2 = (vid.mode.height - s[1][1]) * vid_conheight.value / vid.mode.height;
        //Con_DPrintf("R_DebugLine: %.0f,%.0f to %.0f,%.0f\n", x1, y1, x2, y2);
 
        // add the line to the UI mesh for drawing later
@@ -10196,11 +10196,11 @@ void R_DebugLine(vec3_t start, vec3_t end)
        if (fabs(x2 - x1) > fabs(y2 - y1))
        {
                offsetx = 0;
-               offsety = 0.5f * width * vid_conheight.value / vid.height;
+               offsety = 0.5f * width * vid_conheight.value / vid.mode.height;
        }
        else
        {
-               offsetx = 0.5f * width * vid_conwidth.value / vid.width;
+               offsetx = 0.5f * width * vid_conwidth.value / vid.mode.width;
                offsety = 0;
        }
        surf = Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, "white", 0, 0, MATERIALFLAG_WALL | MATERIALFLAG_VERTEXCOLOR | MATERIALFLAG_ALPHAGEN_VERTEX | MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW), true);