From 4b807047ca111aa41793b027ec74c440a49e3e48 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 2 May 2017 14:31:48 -0600 Subject: [PATCH] warp fixes. startup fix --- quakespasm/Quake/gl_draw.c | 2 +- quakespasm/Quake/gl_vidsdl.c | 3 ++- quakespasm/Quake/gl_warp.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/quakespasm/Quake/gl_draw.c b/quakespasm/Quake/gl_draw.c index 470c75a6..f3f5fd12 100644 --- a/quakespasm/Quake/gl_draw.c +++ b/quakespasm/Quake/gl_draw.c @@ -722,7 +722,7 @@ void GL_SetCanvas (canvastype newcanvas) break; case CANVAS_WARPIMAGE: 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; case CANVAS_CROSSHAIR: //0,0 is center of viewport s = CLAMP (1.0, scr_crosshairscale.value, 10.0); diff --git a/quakespasm/Quake/gl_vidsdl.c b/quakespasm/Quake/gl_vidsdl.c index 802aca8a..0064f91f 100644 --- a/quakespasm/Quake/gl_vidsdl.c +++ b/quakespasm/Quake/gl_vidsdl.c @@ -1542,7 +1542,8 @@ void VID_Init (void) "vid_vsync", "vid_fsaa", "vid_desktopfullscreen", - "vid_borderless"}; + "vid_borderless", + "vid_scaled"}; #define num_readvars ( sizeof(read_vars)/sizeof(read_vars[0]) ) Cvar_RegisterVariable (&vid_fullscreen); //johnfitz diff --git a/quakespasm/Quake/gl_warp.c b/quakespasm/Quake/gl_warp.c index 0214531f..d4ec4e74 100644 --- a/quakespasm/Quake/gl_warp.c +++ b/quakespasm/Quake/gl_warp.c @@ -255,7 +255,7 @@ void R_UpdateWarpTextures (void) //copy to texture 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; } @@ -264,7 +264,7 @@ void R_UpdateWarpTextures (void) GL_SetCanvas(CANVAS_DEFAULT); //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 (); //if viewsize is less than 100, we need to redraw the frame around the viewport