comparison src/video/SDL_cursor.c @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 5f52867ba65c
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
39 SDL_Cursor *SDL_cursor = NULL; 39 SDL_Cursor *SDL_cursor = NULL;
40 static SDL_Cursor *SDL_defcursor = NULL; 40 static SDL_Cursor *SDL_defcursor = NULL;
41 SDL_mutex *SDL_cursorlock = NULL; 41 SDL_mutex *SDL_cursorlock = NULL;
42 42
43 /* Public functions */ 43 /* Public functions */
44 void SDL_CursorQuit(void) 44 void
45 { 45 SDL_CursorQuit (void)
46 if ( SDL_cursor != NULL ) { 46 {
47 SDL_Cursor *cursor; 47 if (SDL_cursor != NULL) {
48 48 SDL_Cursor *cursor;
49 SDL_cursorstate &= ~CURSOR_VISIBLE; 49
50 if ( SDL_cursor != SDL_defcursor ) { 50 SDL_cursorstate &= ~CURSOR_VISIBLE;
51 SDL_FreeCursor(SDL_cursor); 51 if (SDL_cursor != SDL_defcursor) {
52 } 52 SDL_FreeCursor (SDL_cursor);
53 SDL_cursor = NULL; 53 }
54 if ( SDL_defcursor != NULL ) { 54 SDL_cursor = NULL;
55 cursor = SDL_defcursor; 55 if (SDL_defcursor != NULL) {
56 SDL_defcursor = NULL; 56 cursor = SDL_defcursor;
57 SDL_FreeCursor(cursor); 57 SDL_defcursor = NULL;
58 } 58 SDL_FreeCursor (cursor);
59 } 59 }
60 if ( SDL_cursorlock != NULL ) { 60 }
61 SDL_DestroyMutex(SDL_cursorlock); 61 if (SDL_cursorlock != NULL) {
62 SDL_cursorlock = NULL; 62 SDL_DestroyMutex (SDL_cursorlock);
63 } 63 SDL_cursorlock = NULL;
64 } 64 }
65 int SDL_CursorInit(Uint32 multithreaded) 65 }
66 { 66 int
67 /* We don't have mouse focus, and the cursor isn't drawn yet */ 67 SDL_CursorInit (Uint32 multithreaded)
68 {
69 /* We don't have mouse focus, and the cursor isn't drawn yet */
68 #ifndef IPOD 70 #ifndef IPOD
69 SDL_cursorstate = CURSOR_VISIBLE; 71 SDL_cursorstate = CURSOR_VISIBLE;
70 #endif 72 #endif
71 73
72 /* Create the default cursor */ 74 /* Create the default cursor */
73 if ( SDL_defcursor == NULL ) { 75 if (SDL_defcursor == NULL) {
74 SDL_defcursor = SDL_CreateCursor(default_cdata, default_cmask, 76 SDL_defcursor = SDL_CreateCursor (default_cdata, default_cmask,
75 DEFAULT_CWIDTH, DEFAULT_CHEIGHT, 77 DEFAULT_CWIDTH, DEFAULT_CHEIGHT,
76 DEFAULT_CHOTX, DEFAULT_CHOTY); 78 DEFAULT_CHOTX, DEFAULT_CHOTY);
77 SDL_SetCursor(SDL_defcursor); 79 SDL_SetCursor (SDL_defcursor);
78 } 80 }
79 81
80 /* Create a lock if necessary */ 82 /* Create a lock if necessary */
81 if ( multithreaded ) { 83 if (multithreaded) {
82 SDL_cursorlock = SDL_CreateMutex(); 84 SDL_cursorlock = SDL_CreateMutex ();
83 } 85 }
84 86
85 /* That's it! */ 87 /* That's it! */
86 return(0); 88 return (0);
87 } 89 }
88 90
89 /* Multi-thread support for cursors */ 91 /* Multi-thread support for cursors */
90 #ifndef SDL_LockCursor 92 #ifndef SDL_LockCursor
91 void SDL_LockCursor(void) 93 void
92 { 94 SDL_LockCursor (void)
93 if ( SDL_cursorlock ) { 95 {
94 SDL_mutexP(SDL_cursorlock); 96 if (SDL_cursorlock) {
95 } 97 SDL_mutexP (SDL_cursorlock);
98 }
96 } 99 }
97 #endif 100 #endif
98 #ifndef SDL_UnlockCursor 101 #ifndef SDL_UnlockCursor
99 void SDL_UnlockCursor(void) 102 void
100 { 103 SDL_UnlockCursor (void)
101 if ( SDL_cursorlock ) { 104 {
102 SDL_mutexV(SDL_cursorlock); 105 if (SDL_cursorlock) {
103 } 106 SDL_mutexV (SDL_cursorlock);
107 }
104 } 108 }
105 #endif 109 #endif
106 110
107 /* Software cursor drawing support */ 111 /* Software cursor drawing support */
108 SDL_Cursor * SDL_CreateCursor (Uint8 *data, Uint8 *mask, 112 SDL_Cursor *
109 int w, int h, int hot_x, int hot_y) 113 SDL_CreateCursor (Uint8 * data, Uint8 * mask,
110 { 114 int w, int h, int hot_x, int hot_y)
111 SDL_VideoDevice *video = current_video; 115 {
112 int savelen; 116 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
113 int i; 117 int savelen;
114 SDL_Cursor *cursor; 118 int i;
115 119 SDL_Cursor *cursor;
116 /* Make sure the width is a multiple of 8 */ 120
117 w = ((w+7)&~7); 121 /* Make sure the width is a multiple of 8 */
118 122 w = ((w + 7) & ~7);
119 /* Sanity check the hot spot */ 123
120 if ( (hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h) ) { 124 /* Sanity check the hot spot */
121 SDL_SetError("Cursor hot spot doesn't lie within cursor"); 125 if ((hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h)) {
122 return(NULL); 126 SDL_SetError ("Cursor hot spot doesn't lie within cursor");
123 } 127 return (NULL);
124 128 }
125 /* Allocate memory for the cursor */ 129
126 cursor = (SDL_Cursor *)SDL_malloc(sizeof *cursor); 130 /* Allocate memory for the cursor */
127 if ( cursor == NULL ) { 131 cursor = (SDL_Cursor *) SDL_malloc (sizeof *cursor);
128 SDL_OutOfMemory(); 132 if (cursor == NULL) {
129 return(NULL); 133 SDL_OutOfMemory ();
130 } 134 return (NULL);
131 savelen = (w*4)*h; 135 }
132 cursor->area.x = 0; 136 savelen = (w * 4) * h;
133 cursor->area.y = 0; 137 cursor->area.x = 0;
134 cursor->area.w = w; 138 cursor->area.y = 0;
135 cursor->area.h = h; 139 cursor->area.w = w;
136 cursor->hot_x = hot_x; 140 cursor->area.h = h;
137 cursor->hot_y = hot_y; 141 cursor->hot_x = hot_x;
138 cursor->data = (Uint8 *)SDL_malloc((w/8)*h*2); 142 cursor->hot_y = hot_y;
139 cursor->mask = cursor->data+((w/8)*h); 143 cursor->data = (Uint8 *) SDL_malloc ((w / 8) * h * 2);
140 cursor->save[0] = (Uint8 *)SDL_malloc(savelen*2); 144 cursor->mask = cursor->data + ((w / 8) * h);
141 cursor->save[1] = cursor->save[0] + savelen; 145 cursor->save[0] = (Uint8 *) SDL_malloc (savelen * 2);
142 cursor->wm_cursor = NULL; 146 cursor->save[1] = cursor->save[0] + savelen;
143 if ( ! cursor->data || ! cursor->save[0] ) { 147 cursor->wm_cursor = NULL;
144 SDL_FreeCursor(cursor); 148 if (!cursor->data || !cursor->save[0]) {
145 SDL_OutOfMemory(); 149 SDL_FreeCursor (cursor);
146 return(NULL); 150 SDL_OutOfMemory ();
147 } 151 return (NULL);
148 for ( i=((w/8)*h)-1; i>=0; --i ) { 152 }
149 cursor->data[i] = data[i]; 153 for (i = ((w / 8) * h) - 1; i >= 0; --i) {
150 cursor->mask[i] = mask[i] | data[i]; 154 cursor->data[i] = data[i];
151 } 155 cursor->mask[i] = mask[i] | data[i];
152 SDL_memset(cursor->save[0], 0, savelen*2); 156 }
153 157 SDL_memset (cursor->save[0], 0, savelen * 2);
154 /* If the window manager gives us a good cursor, we're done! */ 158
155 if ( video->CreateWMCursor ) { 159 /* If the window manager gives us a good cursor, we're done! */
156 cursor->wm_cursor = video->CreateWMCursor(video, data, mask, 160 if (_this->CreateWMCursor) {
157 w, h, hot_x, hot_y); 161 cursor->wm_cursor = _this->CreateWMCursor (_this, data, mask,
158 } else { 162 w, h, hot_x, hot_y);
159 cursor->wm_cursor = NULL; 163 } else {
160 } 164 cursor->wm_cursor = NULL;
161 return(cursor); 165 }
166 return (cursor);
162 } 167 }
163 168
164 /* SDL_SetCursor(NULL) can be used to force the cursor redraw, 169 /* SDL_SetCursor(NULL) can be used to force the cursor redraw,
165 if this is desired for any reason. This is used when setting 170 if this is desired for any reason. This is used when setting
166 the video mode and when the SDL window gains the mouse focus. 171 the video mode and when the SDL window gains the mouse focus.
167 */ 172 */
168 void SDL_SetCursor (SDL_Cursor *cursor) 173 void
169 { 174 SDL_SetCursor (SDL_Cursor * cursor)
170 SDL_VideoDevice *video = current_video; 175 {
171 SDL_VideoDevice *this = current_video; 176 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
172 177
173 /* Make sure that the video subsystem has been initialized */ 178 /* Make sure that the video subsystem has been initialized */
174 if ( ! video ) { 179 if (!_this) {
175 return; 180 return;
176 } 181 }
177 182
178 /* Prevent the event thread from moving the mouse */ 183 /* Prevent the event thread from moving the mouse */
179 SDL_LockCursor(); 184 SDL_LockCursor ();
180 185
181 /* Set the new cursor */ 186 /* Set the new cursor */
182 if ( cursor && (cursor != SDL_cursor) ) { 187 if (cursor && (cursor != SDL_cursor)) {
183 /* Erase the current mouse position */ 188 /* Erase the current mouse position */
184 if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { 189 if (SHOULD_DRAWCURSOR (SDL_cursorstate)) {
185 SDL_EraseCursor(SDL_VideoSurface); 190 SDL_EraseCursor (SDL_VideoSurface);
186 } else if ( video->MoveWMCursor ) { 191 } else if (_this->MoveWMCursor) {
187 /* If the video driver is moving the cursor directly, 192 /* If the video driver is moving the cursor directly,
188 it needs to hide the old cursor before (possibly) 193 it needs to hide the old cursor before (possibly)
189 showing the new one. (But don't erase NULL cursor) 194 showing the new one. (But don't erase NULL cursor)
190 */ 195 */
191 if ( SDL_cursor ) { 196 if (SDL_cursor) {
192 video->ShowWMCursor(this, NULL); 197 _this->ShowWMCursor (_this, NULL);
193 } 198 }
194 } 199 }
195 SDL_cursor = cursor; 200 SDL_cursor = cursor;
196 } 201 }
197 202
198 /* Draw the new mouse cursor */ 203 /* Draw the new mouse cursor */
199 if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) { 204 if (SDL_cursor && (SDL_cursorstate & CURSOR_VISIBLE)) {
200 /* Use window manager cursor if possible */ 205 /* Use window manager cursor if possible */
201 if ( SDL_cursor->wm_cursor && 206 if (SDL_cursor->wm_cursor &&
202 video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) { 207 _this->ShowWMCursor (_this, SDL_cursor->wm_cursor)) {
203 SDL_cursorstate &= ~CURSOR_USINGSW; 208 SDL_cursorstate &= ~CURSOR_USINGSW;
204 } else { 209 } else {
205 SDL_cursorstate |= CURSOR_USINGSW; 210 SDL_cursorstate |= CURSOR_USINGSW;
206 if ( video->ShowWMCursor ) { 211 if (_this->ShowWMCursor) {
207 video->ShowWMCursor(this, NULL); 212 _this->ShowWMCursor (_this, NULL);
208 } 213 }
209 { int x, y; 214 {
210 SDL_GetMouseState(&x, &y); 215 int x, y;
211 SDL_cursor->area.x = (x - SDL_cursor->hot_x); 216 SDL_GetMouseState (&x, &y);
212 SDL_cursor->area.y = (y - SDL_cursor->hot_y); 217 SDL_cursor->area.x = (x - SDL_cursor->hot_x);
213 } 218 SDL_cursor->area.y = (y - SDL_cursor->hot_y);
214 SDL_DrawCursor(SDL_VideoSurface); 219 }
215 } 220 SDL_DrawCursor (SDL_VideoSurface);
216 } else { 221 }
217 /* Erase window manager mouse (cursor not visible) */ 222 } else {
218 if ( SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW) ) { 223 /* Erase window manager mouse (cursor not visible) */
219 SDL_EraseCursor(SDL_VideoSurface); 224 if (SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW)) {
220 } else { 225 SDL_EraseCursor (SDL_VideoSurface);
221 if ( video ) { 226 } else {
222 video->ShowWMCursor(this, NULL); 227 if (_this) {
223 } 228 _this->ShowWMCursor (_this, NULL);
224 } 229 }
225 } 230 }
226 SDL_UnlockCursor(); 231 }
227 } 232 SDL_UnlockCursor ();
228 233 }
229 SDL_Cursor * SDL_GetCursor (void) 234
230 { 235 SDL_Cursor *
231 return(SDL_cursor); 236 SDL_GetCursor (void)
232 } 237 {
233 238 return (SDL_cursor);
234 void SDL_FreeCursor (SDL_Cursor *cursor) 239 }
235 { 240
236 if ( cursor ) { 241 void
237 if ( cursor == SDL_cursor ) { 242 SDL_FreeCursor (SDL_Cursor * cursor)
238 SDL_SetCursor(SDL_defcursor); 243 {
239 } 244 if (cursor) {
240 if ( cursor != SDL_defcursor ) { 245 if (cursor == SDL_cursor) {
241 SDL_VideoDevice *video = current_video; 246 SDL_SetCursor (SDL_defcursor);
242 SDL_VideoDevice *this = current_video; 247 }
243 248 if (cursor != SDL_defcursor) {
244 if ( cursor->data ) { 249 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
245 SDL_free(cursor->data); 250
246 } 251 if (cursor->data) {
247 if ( cursor->save[0] ) { 252 SDL_free (cursor->data);
248 SDL_free(cursor->save[0]); 253 }
249 } 254 if (cursor->save[0]) {
250 if ( video && cursor->wm_cursor ) { 255 SDL_free (cursor->save[0]);
251 video->FreeWMCursor(this, cursor->wm_cursor); 256 }
252 } 257 if (_this && cursor->wm_cursor) {
253 SDL_free(cursor); 258 _this->FreeWMCursor (_this, cursor->wm_cursor);
254 } 259 }
255 } 260 SDL_free (cursor);
256 } 261 }
257 262 }
258 int SDL_ShowCursor (int toggle) 263 }
259 { 264
260 int showing; 265 int
261 266 SDL_ShowCursor (int toggle)
262 showing = (SDL_cursorstate & CURSOR_VISIBLE); 267 {
263 if ( toggle >= 0 ) { 268 int showing;
264 SDL_LockCursor(); 269
265 if ( toggle ) { 270 showing = (SDL_cursorstate & CURSOR_VISIBLE);
266 SDL_cursorstate |= CURSOR_VISIBLE; 271 if (toggle >= 0) {
267 } else { 272 SDL_LockCursor ();
268 SDL_cursorstate &= ~CURSOR_VISIBLE; 273 if (toggle) {
269 } 274 SDL_cursorstate |= CURSOR_VISIBLE;
270 SDL_UnlockCursor(); 275 } else {
271 if ( (SDL_cursorstate & CURSOR_VISIBLE) != showing ) { 276 SDL_cursorstate &= ~CURSOR_VISIBLE;
272 SDL_VideoDevice *video = current_video; 277 }
273 SDL_VideoDevice *this = current_video; 278 SDL_UnlockCursor ();
274 279 if ((SDL_cursorstate & CURSOR_VISIBLE) != showing) {
275 SDL_SetCursor(NULL); 280 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
276 if ( video && video->CheckMouseMode ) { 281
277 video->CheckMouseMode(this); 282 SDL_SetCursor (NULL);
278 } 283 if (_this && _this->CheckMouseMode) {
279 } 284 _this->CheckMouseMode (_this);
280 } else { 285 }
281 /* Query current state */ ; 286 }
282 } 287 } else {
283 return(showing ? 1 : 0); 288 /* Query current state */ ;
284 } 289 }
285 290 return (showing ? 1 : 0);
286 void SDL_WarpMouse (Uint16 x, Uint16 y) 291 }
287 { 292
288 SDL_VideoDevice *video = current_video; 293 void
289 SDL_VideoDevice *this = current_video; 294 SDL_WarpMouse (Uint16 x, Uint16 y)
290 295 {
291 if ( !video || !SDL_PublicSurface ) { 296 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
292 SDL_SetError("A video mode must be set before warping mouse"); 297
293 return; 298 if (!_this || !SDL_PublicSurface) {
294 } 299 SDL_SetError ("A video mode must be set before warping mouse");
295 300 return;
296 /* If we have an offset video mode, offset the mouse coordinates */ 301 }
297 if (this->screen->pitch == 0) { 302
298 x += this->screen->offset / this->screen->format->BytesPerPixel; 303 /* If we have an offset video mode, offset the mouse coordinates */
299 y += this->screen->offset; 304 if (SDL_VideoSurface->pitch == 0) {
300 } else { 305 x += SDL_VideoSurface->offset /
301 x += (this->screen->offset % this->screen->pitch) / 306 SDL_VideoSurface->format->BytesPerPixel;
302 this->screen->format->BytesPerPixel; 307 y += SDL_VideoSurface->offset;
303 y += (this->screen->offset / this->screen->pitch); 308 } else {
304 } 309 x += (SDL_VideoSurface->offset % SDL_VideoSurface->pitch) /
305 310 SDL_VideoSurface->format->BytesPerPixel;
306 /* This generates a mouse motion event */ 311 y += (SDL_VideoSurface->offset / SDL_VideoSurface->pitch);
307 if ( video->WarpWMCursor ) { 312 }
308 video->WarpWMCursor(this, x, y); 313
309 } else { 314 /* This generates a mouse motion event */
310 SDL_PrivateMouseMotion(0, 0, x, y); 315 if (_this->WarpWMCursor) {
311 } 316 _this->WarpWMCursor (_this, x, y);
312 } 317 } else {
313 318 SDL_PrivateMouseMotion (0, 0, x, y);
314 void SDL_MoveCursor(int x, int y) 319 }
315 { 320 }
316 SDL_VideoDevice *video = current_video; 321
317 322 void
318 /* Erase and update the current mouse position */ 323 SDL_MoveCursor (int x, int y)
319 if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { 324 {
320 /* Erase and redraw mouse cursor in new position */ 325 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
321 SDL_LockCursor(); 326
322 SDL_EraseCursor(SDL_VideoSurface); 327 /* Erase and update the current mouse position */
323 SDL_cursor->area.x = (x - SDL_cursor->hot_x); 328 if (SHOULD_DRAWCURSOR (SDL_cursorstate)) {
324 SDL_cursor->area.y = (y - SDL_cursor->hot_y); 329 /* Erase and redraw mouse cursor in new position */
325 SDL_DrawCursor(SDL_VideoSurface); 330 SDL_LockCursor ();
326 SDL_UnlockCursor(); 331 SDL_EraseCursor (SDL_VideoSurface);
327 } else if ( video->MoveWMCursor ) { 332 SDL_cursor->area.x = (x - SDL_cursor->hot_x);
328 video->MoveWMCursor(video, x, y); 333 SDL_cursor->area.y = (y - SDL_cursor->hot_y);
329 } 334 SDL_DrawCursor (SDL_VideoSurface);
335 SDL_UnlockCursor ();
336 } else if (_this->MoveWMCursor) {
337 _this->MoveWMCursor (_this, x, y);
338 }
330 } 339 }
331 340
332 /* Keep track of the current cursor colors */ 341 /* Keep track of the current cursor colors */
333 static int palette_changed = 1; 342 static int palette_changed = 1;
334 static Uint8 pixels8[2]; 343 static Uint8 pixels8[2];
335 344
336 void SDL_CursorPaletteChanged(void) 345 void
337 { 346 SDL_CursorPaletteChanged (void)
338 palette_changed = 1; 347 {
339 } 348 palette_changed = 1;
340 349 }
341 void SDL_MouseRect(SDL_Rect *area) 350
342 { 351 void
343 int clip_diff; 352 SDL_MouseRect (SDL_Rect * area)
344 353 {
345 *area = SDL_cursor->area; 354 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
346 if ( area->x < 0 ) { 355 int clip_diff;
347 area->w += area->x; 356
348 area->x = 0; 357 *area = SDL_cursor->area;
349 } 358 if (area->x < 0) {
350 if ( area->y < 0 ) { 359 area->w += area->x;
351 area->h += area->y; 360 area->x = 0;
352 area->y = 0; 361 }
353 } 362 if (area->y < 0) {
354 clip_diff = (area->x+area->w)-SDL_VideoSurface->w; 363 area->h += area->y;
355 if ( clip_diff > 0 ) { 364 area->y = 0;
356 area->w = area->w < clip_diff ? 0 : area->w-clip_diff; 365 }
357 } 366 clip_diff = (area->x + area->w) - SDL_VideoSurface->w;
358 clip_diff = (area->y+area->h)-SDL_VideoSurface->h; 367 if (clip_diff > 0) {
359 if ( clip_diff > 0 ) { 368 area->w = area->w < clip_diff ? 0 : area->w - clip_diff;
360 area->h = area->h < clip_diff ? 0 : area->h-clip_diff; 369 }
361 } 370 clip_diff = (area->y + area->h) - SDL_VideoSurface->h;
362 } 371 if (clip_diff > 0) {
363 372 area->h = area->h < clip_diff ? 0 : area->h - clip_diff;
364 static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) 373 }
365 { 374 }
366 const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 }; 375
367 int i, w, h; 376 static void
368 Uint8 *data, datab; 377 SDL_DrawCursorFast (SDL_Surface * screen, SDL_Rect * area)
369 Uint8 *mask, maskb; 378 {
370 379 const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 };
371 data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; 380 int i, w, h;
372 mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; 381 Uint8 *data, datab;
373 switch (screen->format->BytesPerPixel) { 382 Uint8 *mask, maskb;
374 383
375 case 1: { 384 data = SDL_cursor->data + area->y * SDL_cursor->area.w / 8;
376 Uint8 *dst; 385 mask = SDL_cursor->mask + area->y * SDL_cursor->area.w / 8;
377 int dstskip; 386 switch (screen->format->BytesPerPixel) {
378 387
379 if ( palette_changed ) { 388 case 1:
380 pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255); 389 {
381 pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0); 390 Uint8 *dst;
382 palette_changed = 0; 391 int dstskip;
383 } 392
384 dst = (Uint8 *)screen->pixels + 393 if (palette_changed) {
385 (SDL_cursor->area.y+area->y)*screen->pitch + 394 pixels8[0] =
386 SDL_cursor->area.x; 395 (Uint8) SDL_MapRGB (screen->format, 255, 255, 255);
387 dstskip = screen->pitch-area->w; 396 pixels8[1] = (Uint8) SDL_MapRGB (screen->format, 0, 0, 0);
388 397 palette_changed = 0;
389 for ( h=area->h; h; h-- ) { 398 }
390 for ( w=area->w/8; w; w-- ) { 399 dst = (Uint8 *) screen->pixels +
391 maskb = *mask++; 400 (SDL_cursor->area.y + area->y) * screen->pitch +
392 datab = *data++; 401 SDL_cursor->area.x;
393 for ( i=0; i<8; ++i ) { 402 dstskip = screen->pitch - area->w;
394 if ( maskb & 0x80 ) { 403
395 *dst = pixels8[datab>>7]; 404 for (h = area->h; h; h--) {
396 } 405 for (w = area->w / 8; w; w--) {
397 maskb <<= 1; 406 maskb = *mask++;
398 datab <<= 1; 407 datab = *data++;
399 dst++; 408 for (i = 0; i < 8; ++i) {
400 } 409 if (maskb & 0x80) {
401 } 410 *dst = pixels8[datab >> 7];
402 dst += dstskip; 411 }
403 } 412 maskb <<= 1;
404 } 413 datab <<= 1;
405 break; 414 dst++;
406 415 }
407 case 2: { 416 }
408 Uint16 *dst; 417 dst += dstskip;
409 int dstskip; 418 }
410 419 }
411 dst = (Uint16 *)screen->pixels + 420 break;
412 (SDL_cursor->area.y+area->y)*screen->pitch/2 + 421
413 SDL_cursor->area.x; 422 case 2:
414 dstskip = (screen->pitch/2)-area->w; 423 {
415 424 Uint16 *dst;
416 for ( h=area->h; h; h-- ) { 425 int dstskip;
417 for ( w=area->w/8; w; w-- ) { 426
418 maskb = *mask++; 427 dst = (Uint16 *) screen->pixels +
419 datab = *data++; 428 (SDL_cursor->area.y + area->y) * screen->pitch / 2 +
420 for ( i=0; i<8; ++i ) { 429 SDL_cursor->area.x;
421 if ( maskb & 0x80 ) { 430 dstskip = (screen->pitch / 2) - area->w;
422 *dst = (Uint16)pixels[datab>>7]; 431
423 } 432 for (h = area->h; h; h--) {
424 maskb <<= 1; 433 for (w = area->w / 8; w; w--) {
425 datab <<= 1; 434 maskb = *mask++;
426 dst++; 435 datab = *data++;
427 } 436 for (i = 0; i < 8; ++i) {
428 } 437 if (maskb & 0x80) {
429 dst += dstskip; 438 *dst = (Uint16) pixels[datab >> 7];
430 } 439 }
431 } 440 maskb <<= 1;
432 break; 441 datab <<= 1;
433 442 dst++;
434 case 3: { 443 }
435 Uint8 *dst; 444 }
436 int dstskip; 445 dst += dstskip;
437 446 }
438 dst = (Uint8 *)screen->pixels + 447 }
439 (SDL_cursor->area.y+area->y)*screen->pitch + 448 break;
440 SDL_cursor->area.x*3; 449
441 dstskip = screen->pitch-area->w*3; 450 case 3:
442 451 {
443 for ( h=area->h; h; h-- ) { 452 Uint8 *dst;
444 for ( w=area->w/8; w; w-- ) { 453 int dstskip;
445 maskb = *mask++; 454
446 datab = *data++; 455 dst = (Uint8 *) screen->pixels +
447 for ( i=0; i<8; ++i ) { 456 (SDL_cursor->area.y + area->y) * screen->pitch +
448 if ( maskb & 0x80 ) { 457 SDL_cursor->area.x * 3;
449 SDL_memset(dst,pixels[datab>>7],3); 458 dstskip = screen->pitch - area->w * 3;
450 } 459
451 maskb <<= 1; 460 for (h = area->h; h; h--) {
452 datab <<= 1; 461 for (w = area->w / 8; w; w--) {
453 dst += 3; 462 maskb = *mask++;
454 } 463 datab = *data++;
455 } 464 for (i = 0; i < 8; ++i) {
456 dst += dstskip; 465 if (maskb & 0x80) {
457 } 466 SDL_memset (dst, pixels[datab >> 7], 3);
458 } 467 }
459 break; 468 maskb <<= 1;
460 469 datab <<= 1;
461 case 4: { 470 dst += 3;
462 Uint32 *dst; 471 }
463 int dstskip; 472 }
464 473 dst += dstskip;
465 dst = (Uint32 *)screen->pixels + 474 }
466 (SDL_cursor->area.y+area->y)*screen->pitch/4 + 475 }
467 SDL_cursor->area.x; 476 break;
468 dstskip = (screen->pitch/4)-area->w; 477
469 478 case 4:
470 for ( h=area->h; h; h-- ) { 479 {
471 for ( w=area->w/8; w; w-- ) { 480 Uint32 *dst;
472 maskb = *mask++; 481 int dstskip;
473 datab = *data++; 482
474 for ( i=0; i<8; ++i ) { 483 dst = (Uint32 *) screen->pixels +
475 if ( maskb & 0x80 ) { 484 (SDL_cursor->area.y + area->y) * screen->pitch / 4 +
476 *dst = pixels[datab>>7]; 485 SDL_cursor->area.x;
477 } 486 dstskip = (screen->pitch / 4) - area->w;
478 maskb <<= 1; 487
479 datab <<= 1; 488 for (h = area->h; h; h--) {
480 dst++; 489 for (w = area->w / 8; w; w--) {
481 } 490 maskb = *mask++;
482 } 491 datab = *data++;
483 dst += dstskip; 492 for (i = 0; i < 8; ++i) {
484 } 493 if (maskb & 0x80) {
485 } 494 *dst = pixels[datab >> 7];
486 break; 495 }
487 } 496 maskb <<= 1;
488 } 497 datab <<= 1;
489 498 dst++;
490 static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area) 499 }
491 { 500 }
492 const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 }; 501 dst += dstskip;
493 int h; 502 }
494 int x, minx, maxx; 503 }
495 Uint8 *data, datab = 0; 504 break;
496 Uint8 *mask, maskb = 0; 505 }
497 Uint8 *dst; 506 }
498 int dstbpp, dstskip; 507
499 508 static void
500 data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; 509 SDL_DrawCursorSlow (SDL_Surface * screen, SDL_Rect * area)
501 mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; 510 {
502 dstbpp = screen->format->BytesPerPixel; 511 const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 };
503 dst = (Uint8 *)screen->pixels + 512 int h;
504 (SDL_cursor->area.y+area->y)*screen->pitch + 513 int x, minx, maxx;
505 SDL_cursor->area.x*dstbpp; 514 Uint8 *data, datab = 0;
506 dstskip = screen->pitch-SDL_cursor->area.w*dstbpp; 515 Uint8 *mask, maskb = 0;
507 516 Uint8 *dst;
508 minx = area->x; 517 int dstbpp, dstskip;
509 maxx = area->x+area->w; 518
510 if ( screen->format->BytesPerPixel == 1 ) { 519 data = SDL_cursor->data + area->y * SDL_cursor->area.w / 8;
511 if ( palette_changed ) { 520 mask = SDL_cursor->mask + area->y * SDL_cursor->area.w / 8;
512 pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255); 521 dstbpp = screen->format->BytesPerPixel;
513 pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0); 522 dst = (Uint8 *) screen->pixels +
514 palette_changed = 0; 523 (SDL_cursor->area.y + area->y) * screen->pitch +
515 } 524 SDL_cursor->area.x * dstbpp;
516 for ( h=area->h; h; h-- ) { 525 dstskip = screen->pitch - SDL_cursor->area.w * dstbpp;
517 for ( x=0; x<SDL_cursor->area.w; ++x ) { 526
518 if ( (x%8) == 0 ) { 527 minx = area->x;
519 maskb = *mask++; 528 maxx = area->x + area->w;
520 datab = *data++; 529 if (screen->format->BytesPerPixel == 1) {
521 } 530 if (palette_changed) {
522 if ( (x >= minx) && (x < maxx) ) { 531 pixels8[0] = (Uint8) SDL_MapRGB (screen->format, 255, 255, 255);
523 if ( maskb & 0x80 ) { 532 pixels8[1] = (Uint8) SDL_MapRGB (screen->format, 0, 0, 0);
524 SDL_memset(dst, pixels8[datab>>7], dstbpp); 533 palette_changed = 0;
525 } 534 }
526 } 535 for (h = area->h; h; h--) {
527 maskb <<= 1; 536 for (x = 0; x < SDL_cursor->area.w; ++x) {
528 datab <<= 1; 537 if ((x % 8) == 0) {
529 dst += dstbpp; 538 maskb = *mask++;
530 } 539 datab = *data++;
531 dst += dstskip; 540 }
532 } 541 if ((x >= minx) && (x < maxx)) {
533 } else { 542 if (maskb & 0x80) {
534 for ( h=area->h; h; h-- ) { 543 SDL_memset (dst, pixels8[datab >> 7], dstbpp);
535 for ( x=0; x<SDL_cursor->area.w; ++x ) { 544 }
536 if ( (x%8) == 0 ) { 545 }
537 maskb = *mask++; 546 maskb <<= 1;
538 datab = *data++; 547 datab <<= 1;
539 } 548 dst += dstbpp;
540 if ( (x >= minx) && (x < maxx) ) { 549 }
541 if ( maskb & 0x80 ) { 550 dst += dstskip;
542 SDL_memset(dst, pixels[datab>>7], dstbpp); 551 }
543 } 552 } else {
544 } 553 for (h = area->h; h; h--) {
545 maskb <<= 1; 554 for (x = 0; x < SDL_cursor->area.w; ++x) {
546 datab <<= 1; 555 if ((x % 8) == 0) {
547 dst += dstbpp; 556 maskb = *mask++;
548 } 557 datab = *data++;
549 dst += dstskip; 558 }
550 } 559 if ((x >= minx) && (x < maxx)) {
551 } 560 if (maskb & 0x80) {
561 SDL_memset (dst, pixels[datab >> 7], dstbpp);
562 }
563 }
564 maskb <<= 1;
565 datab <<= 1;
566 dst += dstbpp;
567 }
568 dst += dstskip;
569 }
570 }
552 } 571 }
553 572
554 /* This handles the ugly work of converting the saved cursor background from 573 /* This handles the ugly work of converting the saved cursor background from
555 the pixel format of the shadow surface to that of the video surface. 574 the pixel format of the shadow surface to that of the video surface.
556 This is only necessary when blitting from a shadow surface of a different 575 This is only necessary when blitting from a shadow surface of a different
557 pixel format than the video surface, and using a software rendered cursor. 576 pixel format than the video surface, and using a software rendered cursor.
558 */ 577 */
559 static void SDL_ConvertCursorSave(SDL_Surface *screen, int w, int h) 578 static void
560 { 579 SDL_ConvertCursorSave (SDL_Surface * screen, int w, int h)
561 SDL_BlitInfo info; 580 {
562 SDL_loblit RunBlit; 581 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
563 582 SDL_BlitInfo info;
564 /* Make sure we can steal the blit mapping */ 583 SDL_loblit RunBlit;
565 if ( screen->map->dst != SDL_VideoSurface ) { 584
566 return; 585 /* Make sure we can steal the blit mapping */
567 } 586 if (screen->map->dst != SDL_VideoSurface) {
568 587 return;
569 /* Set up the blit information */ 588 }
570 info.s_pixels = SDL_cursor->save[1]; 589
571 info.s_width = w; 590 /* Set up the blit information */
572 info.s_height = h; 591 info.s_pixels = SDL_cursor->save[1];
573 info.s_skip = 0; 592 info.s_width = w;
574 info.d_pixels = SDL_cursor->save[0]; 593 info.s_height = h;
575 info.d_width = w; 594 info.s_skip = 0;
576 info.d_height = h; 595 info.d_pixels = SDL_cursor->save[0];
577 info.d_skip = 0; 596 info.d_width = w;
578 info.aux_data = screen->map->sw_data->aux_data; 597 info.d_height = h;
579 info.src = screen->format; 598 info.d_skip = 0;
580 info.table = screen->map->table; 599 info.aux_data = screen->map->sw_data->aux_data;
581 info.dst = SDL_VideoSurface->format; 600 info.src = screen->format;
582 RunBlit = screen->map->sw_data->blit; 601 info.table = screen->map->table;
583 602 info.dst = SDL_VideoSurface->format;
584 /* Run the actual software blit */ 603 RunBlit = screen->map->sw_data->blit;
585 RunBlit(&info); 604
586 } 605 /* Run the actual software blit */
587 606 RunBlit (&info);
588 void SDL_DrawCursorNoLock(SDL_Surface *screen) 607 }
589 { 608
590 SDL_Rect area; 609 void
591 610 SDL_DrawCursorNoLock (SDL_Surface * screen)
592 /* Get the mouse rectangle, clipped to the screen */ 611 {
593 SDL_MouseRect(&area); 612 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
594 if ( (area.w == 0) || (area.h == 0) ) { 613 SDL_Rect area;
595 return; 614
596 } 615 /* Get the mouse rectangle, clipped to the screen */
597 616 SDL_MouseRect (&area);
598 /* Copy mouse background */ 617 if ((area.w == 0) || (area.h == 0)) {
599 { int w, h, screenbpp; 618 return;
600 Uint8 *src, *dst; 619 }
601 620
602 /* Set up the copy pointers */ 621 /* Copy mouse background */
603 screenbpp = screen->format->BytesPerPixel; 622 {
604 if ( (screen == SDL_VideoSurface) || 623 int w, h, screenbpp;
605 FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { 624 Uint8 *src, *dst;
606 dst = SDL_cursor->save[0]; 625
607 } else { 626 /* Set up the copy pointers */
608 dst = SDL_cursor->save[1]; 627 screenbpp = screen->format->BytesPerPixel;
609 } 628 if ((screen == SDL_VideoSurface) ||
610 src = (Uint8 *)screen->pixels + area.y * screen->pitch + 629 FORMAT_EQUAL (screen->format, SDL_VideoSurface->format)) {
611 area.x * screenbpp; 630 dst = SDL_cursor->save[0];
612 631 } else {
613 /* Perform the copy */ 632 dst = SDL_cursor->save[1];
614 w = area.w*screenbpp; 633 }
615 h = area.h; 634 src = (Uint8 *) screen->pixels + area.y * screen->pitch +
616 while ( h-- ) { 635 area.x * screenbpp;
617 SDL_memcpy(dst, src, w); 636
618 dst += w; 637 /* Perform the copy */
619 src += screen->pitch; 638 w = area.w * screenbpp;
620 } 639 h = area.h;
621 } 640 while (h--) {
622 641 SDL_memcpy (dst, src, w);
623 /* Draw the mouse cursor */ 642 dst += w;
624 area.x -= SDL_cursor->area.x; 643 src += screen->pitch;
625 area.y -= SDL_cursor->area.y; 644 }
626 if ( (area.x == 0) && (area.w == SDL_cursor->area.w) ) { 645 }
627 SDL_DrawCursorFast(screen, &area); 646
628 } else { 647 /* Draw the mouse cursor */
629 SDL_DrawCursorSlow(screen, &area); 648 area.x -= SDL_cursor->area.x;
630 } 649 area.y -= SDL_cursor->area.y;
631 } 650 if ((area.x == 0) && (area.w == SDL_cursor->area.w)) {
632 651 SDL_DrawCursorFast (screen, &area);
633 void SDL_DrawCursor(SDL_Surface *screen) 652 } else {
634 { 653 SDL_DrawCursorSlow (screen, &area);
635 /* Lock the screen if necessary */ 654 }
636 if ( screen == NULL ) { 655 }
637 return; 656
638 } 657 void
639 if ( SDL_MUSTLOCK(screen) ) { 658 SDL_DrawCursor (SDL_Surface * screen)
640 if ( SDL_LockSurface(screen) < 0 ) { 659 {
641 return; 660 /* Lock the screen if necessary */
642 } 661 if (screen == NULL) {
643 } 662 return;
644 663 }
645 SDL_DrawCursorNoLock(screen); 664 if (SDL_MUSTLOCK (screen)) {
646 665 if (SDL_LockSurface (screen) < 0) {
647 /* Unlock the screen and update if necessary */ 666 return;
648 if ( SDL_MUSTLOCK(screen) ) { 667 }
649 SDL_UnlockSurface(screen); 668 }
650 } 669
651 if ( (screen == SDL_VideoSurface) && 670 SDL_DrawCursorNoLock (screen);
652 ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { 671
653 SDL_VideoDevice *video = current_video; 672 /* Unlock the screen and update if necessary */
654 SDL_VideoDevice *this = current_video; 673 if (SDL_MUSTLOCK (screen)) {
655 SDL_Rect area; 674 SDL_UnlockSurface (screen);
656 675 }
657 SDL_MouseRect(&area); 676 if ((screen->flags & SDL_SCREEN_SURFACE) &&
658 677 !(screen->flags & SDL_HWSURFACE)) {
659 /* This can be called before a video mode is set */ 678 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
660 if ( video->UpdateRects ) { 679 SDL_Window *window;
661 video->UpdateRects(this, 1, &area); 680 SDL_Rect area;
662 } 681
663 } 682 window = SDL_GetWindowFromSurface (screen);
664 } 683 if (!window) {
665 684 return;
666 void SDL_EraseCursorNoLock(SDL_Surface *screen) 685 }
667 { 686
668 SDL_Rect area; 687 SDL_MouseRect (&area);
669 688
670 /* Get the mouse rectangle, clipped to the screen */ 689 if (_this->UpdateWindowSurface) {
671 SDL_MouseRect(&area); 690 _this->UpdateWindowSurface (_this, window, 1, &area);
672 if ( (area.w == 0) || (area.h == 0) ) { 691 }
673 return; 692 }
674 } 693 }
675 694
676 /* Copy mouse background */ 695 void
677 { int w, h, screenbpp; 696 SDL_EraseCursorNoLock (SDL_Surface * screen)
678 Uint8 *src, *dst; 697 {
679 698 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
680 /* Set up the copy pointers */ 699 SDL_Window *window;
681 screenbpp = screen->format->BytesPerPixel; 700 SDL_Rect area;
682 if ( (screen == SDL_VideoSurface) || 701
683 FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { 702 /* Get the window associated with the surface */
684 src = SDL_cursor->save[0]; 703 window = SDL_GetWindowFromSurface (screen);
685 } else { 704 if (!window || !window->surface) {
686 src = SDL_cursor->save[1]; 705 return;
687 } 706 }
688 dst = (Uint8 *)screen->pixels + area.y * screen->pitch + 707
689 area.x * screenbpp; 708 /* Get the mouse rectangle, clipped to the screen */
690 709 SDL_MouseRect (&area);
691 /* Perform the copy */ 710 if ((area.w == 0) || (area.h == 0)) {
692 w = area.w*screenbpp; 711 return;
693 h = area.h; 712 }
694 while ( h-- ) { 713
695 SDL_memcpy(dst, src, w); 714 /* Copy mouse background */
696 src += w; 715 {
697 dst += screen->pitch; 716 int w, h, screenbpp;
698 } 717 Uint8 *src, *dst;
699 718
700 /* Perform pixel conversion on cursor background */ 719 /* Set up the copy pointers */
701 if ( src > SDL_cursor->save[1] ) { 720 screenbpp = screen->format->BytesPerPixel;
702 SDL_ConvertCursorSave(screen, area.w, area.h); 721 if ((screen->flags & SDL_SCREEN_SURFACE) ||
703 } 722 FORMAT_EQUAL (screen->format, window->surface->format)) {
704 } 723 src = SDL_cursor->save[0];
705 } 724 } else {
706 725 src = SDL_cursor->save[1];
707 void SDL_EraseCursor(SDL_Surface *screen) 726 }
708 { 727 dst = (Uint8 *) screen->pixels + area.y * screen->pitch +
709 /* Lock the screen if necessary */ 728 area.x * screenbpp;
710 if ( screen == NULL ) { 729
711 return; 730 /* Perform the copy */
712 } 731 w = area.w * screenbpp;
713 if ( SDL_MUSTLOCK(screen) ) { 732 h = area.h;
714 if ( SDL_LockSurface(screen) < 0 ) { 733 while (h--) {
715 return; 734 SDL_memcpy (dst, src, w);
716 } 735 src += w;
717 } 736 dst += screen->pitch;
718 737 }
719 SDL_EraseCursorNoLock(screen); 738
720 739 /* Perform pixel conversion on cursor background */
721 /* Unlock the screen and update if necessary */ 740 if (src > SDL_cursor->save[1]) {
722 if ( SDL_MUSTLOCK(screen) ) { 741 SDL_ConvertCursorSave (screen, area.w, area.h);
723 SDL_UnlockSurface(screen); 742 }
724 } 743 }
725 if ( (screen == SDL_VideoSurface) && 744 }
726 ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { 745
727 SDL_VideoDevice *video = current_video; 746 void
728 SDL_VideoDevice *this = current_video; 747 SDL_EraseCursor (SDL_Surface * screen)
729 SDL_Rect area; 748 {
730 749 /* Lock the screen if necessary */
731 SDL_MouseRect(&area); 750 if (screen == NULL) {
732 if ( video->UpdateRects ) { 751 return;
733 video->UpdateRects(this, 1, &area); 752 }
734 } 753 if (SDL_MUSTLOCK (screen)) {
735 } 754 if (SDL_LockSurface (screen) < 0) {
755 return;
756 }
757 }
758
759 SDL_EraseCursorNoLock (screen);
760
761 /* Unlock the screen and update if necessary */
762 if (SDL_MUSTLOCK (screen)) {
763 SDL_UnlockSurface (screen);
764 }
765 if ((screen->flags & SDL_SCREEN_SURFACE) &&
766 !(screen->flags & SDL_HWSURFACE)) {
767 SDL_VideoDevice *_this = SDL_GetVideoDevice ();
768 SDL_Window *window;
769 SDL_Rect area;
770
771 window = SDL_GetWindowFromSurface (screen);
772 if (!window) {
773 return;
774 }
775
776 SDL_MouseRect (&area);
777
778 if (_this->UpdateWindowSurface) {
779 _this->UpdateWindowSurface (_this, window, 1, &area);
780 }
781 }
736 } 782 }
737 783
738 /* Reset the cursor on video mode change 784 /* Reset the cursor on video mode change
739 FIXME: Keep track of all cursors, and reset them all. 785 FIXME: Keep track of all cursors, and reset them all.
740 */ 786 */
741 void SDL_ResetCursor(void) 787 void
742 { 788 SDL_ResetCursor (void)
743 int savelen; 789 {
744 790 int savelen;
745 if ( SDL_cursor ) { 791
746 savelen = SDL_cursor->area.w*4*SDL_cursor->area.h; 792 if (SDL_cursor) {
747 SDL_cursor->area.x = 0; 793 savelen = SDL_cursor->area.w * 4 * SDL_cursor->area.h;
748 SDL_cursor->area.y = 0; 794 SDL_cursor->area.x = 0;
749 SDL_memset(SDL_cursor->save[0], 0, savelen); 795 SDL_cursor->area.y = 0;
750 } 796 SDL_memset (SDL_cursor->save[0], 0, savelen);
751 } 797 }
798 }
799
800 /* vi: set ts=4 sw=4 expandtab: */