From db9036d584ff61dcb986523e213c291bfd2c5279 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:14:13 +0300 Subject: [PATCH] Recompute camera projection matrix during resize to fix stretching on pause menu. --- UnleashedRecomp/patches/camera_patches.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/UnleashedRecomp/patches/camera_patches.cpp b/UnleashedRecomp/patches/camera_patches.cpp index a3b3cbcc..558c6be0 100644 --- a/UnleashedRecomp/patches/camera_patches.cpp +++ b/UnleashedRecomp/patches/camera_patches.cpp @@ -48,3 +48,20 @@ PPC_FUNC(sub_824697B0) __imp__sub_824697B0(ctx, base); } + +// SWA::CCamera::UpdateSerial +PPC_FUNC_IMPL(__imp__sub_82467890); +PPC_FUNC(sub_82467890) +{ + if (g_needsResize) + { + // Recompute the projection matrix for one frame to fix stretching on pause menu. + auto r3 = ctx.r3; + auto r4 = ctx.r4; + sub_82468E38(ctx, base); + ctx.r3 = r3; + ctx.r4 = r4; + } + + __imp__sub_82467890(ctx, base); +}