From 3290eff189b38e2f970a0fc1de37d81f0f0ac218 Mon Sep 17 00:00:00 2001 From: Veka0 <26331365+Veka0@users.noreply.github.com> Date: Thu, 3 Jul 2025 13:33:54 +0200 Subject: [PATCH] Change sceGuViewport params from int to float --- src/gu/pspgu.h | 2 +- src/gu/sceGuViewport.c | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gu/pspgu.h b/src/gu/pspgu.h index 35b274c6f6..01f7ba8fd0 100644 --- a/src/gu/pspgu.h +++ b/src/gu/pspgu.h @@ -1460,7 +1460,7 @@ void sceGuScissor(int x, int y, int w, int h); * @param width - Width of viewport * @param height - Height of viewport **/ -void sceGuViewport(int cx, int cy, int width, int height); +void sceGuViewport(float cx, float cy, float width, float height); /** * Draw bezier surface diff --git a/src/gu/sceGuViewport.c b/src/gu/sceGuViewport.c index bb58292937..25f9d7a356 100644 --- a/src/gu/sceGuViewport.c +++ b/src/gu/sceGuViewport.c @@ -8,16 +8,14 @@ #include "guInternal.h" -void sceGuViewport(int cx, int cy, int width, int height) +void sceGuViewport(float cx, float cy, float width, float height) { - float sx, sy, tx, ty; - sx = (float)(width) * 0.5f; - sy = (float)(height) * -0.5f; - tx = (float)cx; - ty = (float)cy; + float sx, sy; + sx = width * 0.5f; + sy = height * -0.5f; sendCommandf(VIEWPORT_X_SCALE, sx); sendCommandf(VIEWPORT_Y_SCALE, sy); - sendCommandf(VIEWPORT_X_CENTER, tx); - sendCommandf(VIEWPORT_Y_CENTER, ty); + sendCommandf(VIEWPORT_X_CENTER, cx); + sendCommandf(VIEWPORT_Y_CENTER, cy); }