Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_sysmouse.c @ 527:5c74ac147358
Fixed mouse warp position bug with offset video modes
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 11 Oct 2002 08:09:26 +0000 |
parents | f097dba83975 |
children | 86d0d01290ea |
comparison
equal
deleted
inserted
replaced
526:4314a501d7be | 527:5c74ac147358 |
---|---|
211 return(1); | 211 return(1); |
212 } | 212 } |
213 | 213 |
214 void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y) | 214 void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y) |
215 { | 215 { |
216 POINT pt; | |
217 | |
218 if ( DDRAW_FULLSCREEN() ) { | 216 if ( DDRAW_FULLSCREEN() ) { |
219 x += (this->screen->offset % this->screen->pitch) / | |
220 this->screen->format->BytesPerPixel; | |
221 y += (this->screen->offset / this->screen->pitch); | |
222 SDL_PrivateMouseMotion(0, 0, x, y); | 217 SDL_PrivateMouseMotion(0, 0, x, y); |
223 } else if ( mouse_relative) { | 218 } else if ( mouse_relative) { |
224 /* RJR: March 28, 2000 | 219 /* RJR: March 28, 2000 |
225 leave physical cursor at center of screen if | 220 leave physical cursor at center of screen if |
226 mouse hidden and grabbed */ | 221 mouse hidden and grabbed */ |
227 SDL_PrivateMouseMotion(0, 0, x, y); | 222 SDL_PrivateMouseMotion(0, 0, x, y); |
228 } else { | 223 } else { |
224 POINT pt; | |
229 pt.x = x; | 225 pt.x = x; |
230 pt.y = y; | 226 pt.y = y; |
231 ClientToScreen(SDL_Window, &pt); | 227 ClientToScreen(SDL_Window, &pt); |
232 SetCursorPos(pt.x, pt.y); | 228 SetCursorPos(pt.x, pt.y); |
233 } | 229 } |