Skip to content

Commit 22e9495

Browse files
sharkwouterfjtrujy
authored andcommitted
Do less calculations in PSP_LockTexture
1 parent 0aefe48 commit 22e9495

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/render/psp/SDL_render_psp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,9 @@ static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
460460
prepareTextureForDownload(texture);
461461

462462
*pixels =
463-
(void *)((Uint8 *)psp_tex->data + rect->y * psp_tex->width * SDL_BYTESPERPIXEL(texture->format) +
463+
(void *)((Uint8 *)psp_tex->data + rect->y * psp_tex->pitch +
464464
rect->x * SDL_BYTESPERPIXEL(texture->format));
465-
*pitch = psp_tex->width * SDL_BYTESPERPIXEL(texture->format);
465+
*pitch = psp_tex->pitch;
466466

467467
return 0;
468468
}

0 commit comments

Comments
 (0)