diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 795a4222c..1e5dc802b 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -3247,8 +3247,7 @@ void GL_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 uint32_t r = rand(); - const float dup = min(scrwf / BASEVIDWIDTH, scrwh / BASEVIDHEIGHT); - const float ystep = 2.f/scrwh * dup/4.f; + const float ystep = 2.f/scrwh * (float)vid.udup/4.f; for (i = 0; i < 1; i += ystep) { diff --git a/src/screen.h b/src/screen.h index fa5e07cd6..3b8f98335 100644 --- a/src/screen.h +++ b/src/screen.h @@ -67,6 +67,7 @@ struct viddef_t INT32 dup; // scale 1, 2, 3 value for menus & overlays INT32 fdup; // same as dup, but exact value when aspect ratio isn't 320/200 + INT32 udup; // same as dup but does not account for highreshudscale UINT8 smalldup; // factor for a little bit of scaling UINT8 meddup; // factor for moderate, but not full, scaling diff --git a/src/v_video.c b/src/v_video.c index 0cf6f5328..9a53799be 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2074,17 +2074,15 @@ void V_DrawVhsEffect(boolean rewind) #endif SINT8 offs; - const INT32 dup = min(vid.width / BASEVIDWIDTH, vid.height / BASEVIDHEIGHT); - - barsize = dup << 5; - updistort = dup << (rewind ? 5 : 3); + barsize = vid.udup << 5; + updistort = vid.udup << (rewind ? 5 : 3); downdistort = updistort >> 1; if (rewind) V_DrawVhsEffect(false); // experimentation - upbary -= renderdeltatics * (fixed_t)(dup * (rewind ? 3 : 1.8f)); - downbary += renderdeltatics * (dup * (rewind ? 2 : 1)); + upbary -= renderdeltatics * (fixed_t)(vid.udup * (rewind ? 3 : 1.8f)); + downbary += renderdeltatics * (vid.udup * (rewind ? 2 : 1)); if (upbary < -barsize*FRACUNIT) upbary = vid.height << FRACBITS; @@ -4133,6 +4131,8 @@ void V_Recalc(void) vid.fdup = (vid.height*FRACUNIT) / BASEVIDHEIGHT; } + vid.udup = vid.dup; + if (loaded_config // this could use a better name, since it is more and indicator that early startup is done and its safe to do sketchy shit now :chaosleep: && (vid.width > 720) && (vid.height > 1280)) // ehhhh well this thing has so many issues, so ill lock it to higher resolutions instead {