From 80cb52c94456a9cd959915bbc5d2e2d8bd54ab20 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Sun, 28 Jan 2024 15:38:30 +0100 Subject: [PATCH] Fix scissor usage (cherry picked from commit 36b843828062ee8488320d90591fd7d273f548b8) --- src/render/ps2/SDL_render_ps2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index 114dc43d4..d0000e915 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -307,7 +307,7 @@ static int PS2_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd) const SDL_Rect *viewport = &cmd->data.viewport.rect; gsKit_set_display_offset(data->gsGlobal, viewport->x, viewport->y); - gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->y, viewport->w, viewport->h)); + gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->x + viewport->w, viewport->y, viewport->y + viewport->h)); return 0; } @@ -319,7 +319,7 @@ static int PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd) const SDL_Rect *rect = &cmd->data.cliprect.rect; if (cmd->data.cliprect.enabled) { - gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(rect->x, rect->y, rect->w, rect->h)); + gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(rect->x, rect->x + rect->w, rect->y, rect->y + rect->h)); } else { gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET); }