warp fixes. startup fix

This commit is contained in:
Eric Wasylishen 2017-05-02 14:31:48 -06:00
parent e4adb6f7f2
commit 4b807047ca
3 changed files with 5 additions and 4 deletions

View file

@ -722,7 +722,7 @@ void GL_SetCanvas (canvastype newcanvas)
break; break;
case CANVAS_WARPIMAGE: case CANVAS_WARPIMAGE:
glOrtho (0, 128, 0, 128, -99999, 99999); glOrtho (0, 128, 0, 128, -99999, 99999);
glViewport (glx, gly+glheight-gl_warpimagesize, gl_warpimagesize, gl_warpimagesize); glViewport (glx, 0+vid.unscaled_height-gl_warpimagesize, gl_warpimagesize, gl_warpimagesize);
break; break;
case CANVAS_CROSSHAIR: //0,0 is center of viewport case CANVAS_CROSSHAIR: //0,0 is center of viewport
s = CLAMP (1.0, scr_crosshairscale.value, 10.0); s = CLAMP (1.0, scr_crosshairscale.value, 10.0);

View file

@ -1542,7 +1542,8 @@ void VID_Init (void)
"vid_vsync", "vid_vsync",
"vid_fsaa", "vid_fsaa",
"vid_desktopfullscreen", "vid_desktopfullscreen",
"vid_borderless"}; "vid_borderless",
"vid_scaled"};
#define num_readvars ( sizeof(read_vars)/sizeof(read_vars[0]) ) #define num_readvars ( sizeof(read_vars)/sizeof(read_vars[0]) )
Cvar_RegisterVariable (&vid_fullscreen); //johnfitz Cvar_RegisterVariable (&vid_fullscreen); //johnfitz

View file

@ -255,7 +255,7 @@ void R_UpdateWarpTextures (void)
//copy to texture //copy to texture
GL_Bind (tx->warpimage); GL_Bind (tx->warpimage);
glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, glx, gly+glheight-gl_warpimagesize, gl_warpimagesize, gl_warpimagesize); glCopyTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, 0, vid.unscaled_height-gl_warpimagesize, gl_warpimagesize, gl_warpimagesize);
tx->update_warp = false; tx->update_warp = false;
} }
@ -264,7 +264,7 @@ void R_UpdateWarpTextures (void)
GL_SetCanvas(CANVAS_DEFAULT); GL_SetCanvas(CANVAS_DEFAULT);
//if warp render went down into sbar territory, we need to be sure to refresh it next frame //if warp render went down into sbar territory, we need to be sure to refresh it next frame
if (gl_warpimagesize + sb_lines > glheight) if (gl_warpimagesize + sb_lines > vid.unscaled_height)
Sbar_Changed (); Sbar_Changed ();
//if viewsize is less than 100, we need to redraw the frame around the viewport //if viewsize is less than 100, we need to redraw the frame around the viewport