Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
4285:f63ca354c35e | 4286:9ea4413f0a9e |
---|---|
86 } | 86 } |
87 | 87 |
88 return key; | 88 return key; |
89 } | 89 } |
90 | 90 |
91 static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) { | 91 static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) |
92 Sint16 rotatedX; | 92 { |
93 Sint16 rotatedY; | |
94 | |
95 if(gapiInfo->hiresFix) | 93 if(gapiInfo->hiresFix) |
96 { | 94 { |
97 *x *= 2; | 95 *x *= 2; |
98 *y *= 2; | 96 *y *= 2; |
99 } | 97 } |
100 | 98 |
101 if(gapiInfo->userOrientation == SDL_ORIENTATION_UP && | 99 // 0 3 0 |
102 gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT) | 100 if((!gapiInfo->userOrientation && gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) || |
101 // 3 0 3 | |
102 (gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation) || | |
103 // 3 0 0 | |
104 (gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation)) | |
103 { | 105 { |
104 rotatedX = *x; | 106 Sint16 temp = *x; |
105 rotatedY = *y; | 107 *x = SDL_VideoSurface->w - *y; |
106 *x = rotatedX; | 108 *y = temp; |
107 *y = rotatedY; | |
108 } | |
109 else | |
110 if(gapiInfo->userOrientation == SDL_ORIENTATION_RIGHT && | |
111 gapiInfo->gapiOrientation == SDL_ORIENTATION_RIGHT) | |
112 { | |
113 rotatedX = (2 * ((SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/ | |
114 SDL_VideoSurface->format->BytesPerPixel)) | |
115 + SDL_VideoSurface->w - *y; | |
116 rotatedY = *x; | |
117 *x = rotatedX; | |
118 *y = rotatedY; | |
119 } | 109 } |
120 else | 110 else |
111 // 0 0 0 | |
112 if((!gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) || | |
113 // 0 0 3 | |
114 (!gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation)) | |
121 { | 115 { |
122 rotatedX = SDL_VideoSurface->w - *y; | 116 // without changes |
123 rotatedY = *x; | 117 // *x = *x; |
124 *y = rotatedY; | 118 // *y = *y; |
125 *x = rotatedX; | 119 } |
120 // default | |
121 else | |
122 { | |
123 // without changes | |
124 // *x = *x; | |
125 // *y = *y; | |
126 } | 126 } |
127 } | 127 } |
128 #endif | 128 #endif |
129 | 129 |
130 | 130 |