Fixed bug 3297 - Horizontal and Vertical flip swapped on PSP
authorSam Lantinga <slouken@libsdl.org>
Fri, 11 Aug 2017 20:54:06 -0700
changeset 11229436b07ff41b4
parent 11228 af4c3dc6b97f
child 11230 15b10ad902dd
Fixed bug 3297 - Horizontal and Vertical flip swapped on PSP

Littlefighter19

When trying to mirror something on the PSP, I've stumbled upon the problem,
that using SDL_RenderCopyEx with SDL_FLIP_HORIZONTAL flips the image vertically, vise-versa SDL_FLIP_VERTICAL flips the image horizontally.
Proposed patch would be swapping the check in line 944 with the one in line 948 in SDL_render_psp.c
src/render/psp/SDL_render_psp.c
     1.1 --- a/src/render/psp/SDL_render_psp.c	Fri Aug 11 19:42:39 2017 -0700
     1.2 +++ b/src/render/psp/SDL_render_psp.c	Fri Aug 11 20:54:06 2017 -0700
     1.3 @@ -949,11 +949,11 @@
     1.4      vertices[3].y = y + sw - ch;
     1.5      vertices[3].z = 0;
     1.6  
     1.7 -    if (flip & SDL_FLIP_HORIZONTAL) {
     1.8 +    if (flip & SDL_FLIP_VERTICAL) {
     1.9                  Swap(&vertices[0].v, &vertices[2].v);
    1.10                  Swap(&vertices[1].v, &vertices[3].v);
    1.11      }
    1.12 -    if (flip & SDL_FLIP_VERTICAL) {
    1.13 +    if (flip & SDL_FLIP_HORIZONTAL) {
    1.14                  Swap(&vertices[0].u, &vertices[2].u);
    1.15                  Swap(&vertices[1].u, &vertices[3].u);
    1.16      }