Fix scissor usage

(cherry picked from commit 36b843828062ee8488320d90591fd7d273f548b8)
This commit is contained in:
Francisco Javier Trujillo Mata 2024-01-28 15:38:30 +01:00 committed by Sam Lantinga
parent 4436c09c9d
commit 80cb52c944

View file

@ -307,7 +307,7 @@ static int PS2_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
const SDL_Rect *viewport = &cmd->data.viewport.rect; const SDL_Rect *viewport = &cmd->data.viewport.rect;
gsKit_set_display_offset(data->gsGlobal, viewport->x, viewport->y); 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; return 0;
} }
@ -319,7 +319,7 @@ static int PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
const SDL_Rect *rect = &cmd->data.cliprect.rect; const SDL_Rect *rect = &cmd->data.cliprect.rect;
if (cmd->data.cliprect.enabled) { 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 { } else {
gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET); gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET);
} }