comparison src/video/SDL_cursor.c @ 1428:5f52867ba65c

Update for Visual C++ 6.0
author Sam Lantinga <slouken@libsdl.org>
date Fri, 24 Feb 2006 18:24:57 +0000
parents d910939febfa
children 782fd950bd46 37dab4a917c4
comparison
equal deleted inserted replaced
1427:5f5a74d29d18 1428:5f52867ba65c
329 } 329 }
330 } 330 }
331 331
332 /* Keep track of the current cursor colors */ 332 /* Keep track of the current cursor colors */
333 static int palette_changed = 1; 333 static int palette_changed = 1;
334 static Uint32 pixels8[2]; 334 static Uint8 pixels8[2];
335 335
336 void SDL_CursorPaletteChanged(void) 336 void SDL_CursorPaletteChanged(void)
337 { 337 {
338 palette_changed = 1; 338 palette_changed = 1;
339 } 339 }
375 case 1: { 375 case 1: {
376 Uint8 *dst; 376 Uint8 *dst;
377 int dstskip; 377 int dstskip;
378 378
379 if ( palette_changed ) { 379 if ( palette_changed ) {
380 pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); 380 pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
381 pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); 381 pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
382 palette_changed = 0; 382 palette_changed = 0;
383 } 383 }
384 dst = (Uint8 *)screen->pixels + 384 dst = (Uint8 *)screen->pixels +
385 (SDL_cursor->area.y+area->y)*screen->pitch + 385 (SDL_cursor->area.y+area->y)*screen->pitch +
386 SDL_cursor->area.x; 386 SDL_cursor->area.x;
417 for ( w=area->w/8; w; w-- ) { 417 for ( w=area->w/8; w; w-- ) {
418 maskb = *mask++; 418 maskb = *mask++;
419 datab = *data++; 419 datab = *data++;
420 for ( i=0; i<8; ++i ) { 420 for ( i=0; i<8; ++i ) {
421 if ( maskb & 0x80 ) { 421 if ( maskb & 0x80 ) {
422 *dst = pixels[datab>>7]; 422 *dst = (Uint16)pixels[datab>>7];
423 } 423 }
424 maskb <<= 1; 424 maskb <<= 1;
425 datab <<= 1; 425 datab <<= 1;
426 dst++; 426 dst++;
427 } 427 }
507 507
508 minx = area->x; 508 minx = area->x;
509 maxx = area->x+area->w; 509 maxx = area->x+area->w;
510 if ( screen->format->BytesPerPixel == 1 ) { 510 if ( screen->format->BytesPerPixel == 1 ) {
511 if ( palette_changed ) { 511 if ( palette_changed ) {
512 pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); 512 pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
513 pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); 513 pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
514 palette_changed = 0; 514 palette_changed = 0;
515 } 515 }
516 for ( h=area->h; h; h-- ) { 516 for ( h=area->h; h; h-- ) {
517 for ( x=0; x<SDL_cursor->area.w; ++x ) { 517 for ( x=0; x<SDL_cursor->area.w; ++x ) {
518 if ( (x%8) == 0 ) { 518 if ( (x%8) == 0 ) {