From 87d20cc2a16ee9b4878d28a586bd91d8fe6b73ca Mon Sep 17 00:00:00 2001 From: schellingb <14200249+schellingb@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:07:57 +0900 Subject: [PATCH] Simplify calculation --- dosbox_pure_libretro.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dosbox_pure_libretro.cpp b/dosbox_pure_libretro.cpp index 1efade00..7524255e 100644 --- a/dosbox_pure_libretro.cpp +++ b/dosbox_pure_libretro.cpp @@ -2035,7 +2035,7 @@ void GFX_EndUpdate(const Bit16u *changedLines) else if (!dblh) for (; src != srcEnd; trg -= 2) trg[0] = trg[1] = *(--src); else for (; src != srcEnd; trg -= 2) trg[0] = trg[1] = trg[pitch] = trg[pitch+1] = *(--src); } - buf.ratio = ((float)render.src.width * ((float)render.src.dblw+1.f)) / ((float)render.src.height * ((float)render.src.dblh+1.0f) * (float)render.src.ratio); + buf.ratio = (srcw << dblw) / ((srch << dblh) * (float)render.src.ratio); } else {