Mercurial > sdl-ios-xcode
diff src/video/windib/SDL_dibevents.c @ 4286:9ea4413f0a9e SDL-1.2
Fixed bug #831
Andrey 2009-10-09 08:08:04 PDT
gapi_hires_fix
I made a mistake with the conclusions.
And last time I as was mistaken with conclusions.
Now I thought about in more detail the algorithm works.
I have made it that the project fheroes2 well worked.
The result of my work in attachment.
I have a possibility to check up it on different models pocketpc.
I checked various modes screen of 320x320, 320x240, 640x480, 800x400.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 10 Oct 2009 02:03:53 +0000 |
parents | 6b7f9089105e |
children | 6cc2b35ac610 |
line wrap: on
line diff
--- a/src/video/windib/SDL_dibevents.c Thu Oct 08 09:02:03 2009 +0000 +++ b/src/video/windib/SDL_dibevents.c Sat Oct 10 02:03:53 2009 +0000 @@ -88,41 +88,41 @@ return key; } -static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) { - Sint16 rotatedX; - Sint16 rotatedY; - +static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) +{ if(gapiInfo->hiresFix) { *x *= 2; *y *= 2; } - if(gapiInfo->userOrientation == SDL_ORIENTATION_UP && - gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT) + // 0 3 0 + if((!gapiInfo->userOrientation && gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) || + // 3 0 3 + (gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation) || + // 3 0 0 + (gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation)) { - rotatedX = *x; - rotatedY = *y; - *x = rotatedX; - *y = rotatedY; - } - else - if(gapiInfo->userOrientation == SDL_ORIENTATION_RIGHT && - gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT) - { - rotatedX = (2 * ((SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/ - SDL_VideoSurface->format->BytesPerPixel)) - + SDL_VideoSurface->w - *y; - rotatedY = *x; - *x = rotatedX; - *y = rotatedY; + Sint16 temp = *x; + *x = SDL_VideoSurface->w - *y; + *y = temp; } else + // 0 0 0 + if((!gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) || + // 0 0 3 + (!gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation)) { - rotatedX = SDL_VideoSurface->w - *y; - rotatedY = *x; - *y = rotatedY; - *x = rotatedX; + // without changes + // *x = *x; + // *y = *y; + } + // default + else + { + // without changes + // *x = *x; + // *y = *y; } } #endif