From 0d38061db8350f5ef412de8d872133a890f7e50f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 13 Nov 2018 18:13:51 +0000 Subject: [PATCH 1/2] Fix V_SNAPTOx code to consider dupx/dupy the same way as Software mode --- src/hardware/hw_draw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index 33f5e031..75523f3d 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -227,14 +227,14 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, Z_Free(realpatch); } // centre screen - if (vid.width != BASEVIDWIDTH * vid.dupx) + if ((float)vid.width != (float)BASEVIDWIDTH * dupx) { if (option & V_SNAPTORIGHT) cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); else if (!(option & V_SNAPTOLEFT)) cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2; } - if (vid.height != BASEVIDHEIGHT * vid.dupy) + if ((float)vid.height != (float)BASEVIDHEIGHT * dupy) { if ((option & (V_SPLITSCREEN|V_SNAPTOBOTTOM)) == (V_SPLITSCREEN|V_SNAPTOBOTTOM)) cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy)); @@ -375,14 +375,14 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal Z_Free(realpatch); } // centre screen - if (vid.width != BASEVIDWIDTH * vid.dupx) + if ((float)vid.width != (float)BASEVIDWIDTH * dupx) { if (option & V_SNAPTORIGHT) cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); else if (!(option & V_SNAPTOLEFT)) cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2; } - if (vid.height != BASEVIDHEIGHT * vid.dupy) + if ((float)vid.height != (float)BASEVIDHEIGHT * dupy) { if ((option & (V_SPLITSCREEN|V_SNAPTOBOTTOM)) == (V_SPLITSCREEN|V_SNAPTOBOTTOM)) cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy)); @@ -846,14 +846,14 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) fw *= dupx; fh *= dupy; - if (vid.width != BASEVIDWIDTH * vid.dupx) + if ((float)vid.width != (float)BASEVIDWIDTH * dupx) { if (color & V_SNAPTORIGHT) fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); else if (!(color & V_SNAPTOLEFT)) fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2; } - if (vid.height != BASEVIDHEIGHT * dupy) + if ((float)vid.height != (float)BASEVIDHEIGHT * dupy) { // same thing here if (color & V_SNAPTOBOTTOM) From e9fe0ebae1d9523364dcf2f9029c2a096dfafc8b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 13 Nov 2018 18:14:59 +0000 Subject: [PATCH 2/2] Fix OpenGL's HUD not being scaled the same way as Software's, by removing an old OpenGL-specific hack for fdupx/fdupy --- src/screen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index fdd8eb7b..ada9af7c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -280,7 +280,10 @@ void SCR_Recalc(void) vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT); #ifdef HWRENDER - if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl + //if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl + // 13/11/18: + // The above is no longer necessary, since we want OpenGL to be just like software now + // -- Monster Iestyn #endif vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);