From 72054fb5e226c21e96006024ece34002a101c96a Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 16 Sep 2017 05:26:18 -0400 Subject: [PATCH] - implemented pixelratio for the classic software renderer --- src/swrenderer/things/r_playersprite.cpp | 2 +- src/swrenderer/viewport/r_viewport.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 7df655743..17fa146ed 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -253,7 +253,7 @@ namespace swrenderer auto viewport = Thread->Viewport.get(); double pspritexscale = viewport->viewwindow.centerxwide / 160.0; - double pspriteyscale = pspritexscale * viewport->YaspectMul; + double pspriteyscale = pspritexscale * viewport->BaseYaspectMul; double pspritexiscale = 1 / pspritexscale; int tleft = tex->GetScaledLeftOffset(); diff --git a/src/swrenderer/viewport/r_viewport.cpp b/src/swrenderer/viewport/r_viewport.cpp index 783fc8f0d..b243f2265 100644 --- a/src/swrenderer/viewport/r_viewport.cpp +++ b/src/swrenderer/viewport/r_viewport.cpp @@ -98,12 +98,14 @@ namespace swrenderer virtwidth = virtwidth * AspectMultiplier(viewwindow.WidescreenRatio) / 48; } + double ypixelstretch = (level.info) ? level.info->pixelstretch : 1.2; + BaseYaspectMul = 320.0 * virtheight2 / (r_Yaspect * virtwidth2); - YaspectMul = 320.0 * virtheight / (r_Yaspect * virtwidth); + YaspectMul = 320.0 * virtheight / (r_Yaspect * virtwidth) * ypixelstretch / 1.2; IYaspectMul = (double)virtwidth * r_Yaspect / 320.0 / virtheight; InvZtoScale = YaspectMul * CenterX; - WallTMapScale2 = IYaspectMul / CenterX; + WallTMapScale2 = IYaspectMul / CenterX * 1.2 / ypixelstretch; // thing clipping fillshort(screenheightarray, viewwidth, (short)viewheight);