comparison src/video/SDL_surface.c @ 1456:84de7511f79f

Fixed a bunch of 64-bit compatibility problems
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Mar 2006 09:43:47 +0000
parents 5f52867ba65c
children 782fd950bd46 c121d94672cb a1b03ba2fcd0
comparison
equal deleted inserted replaced
1455:f487bb150acc 1456:84de7511f79f
602 } 602 }
603 row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+ 603 row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+
604 dstrect->x*dst->format->BytesPerPixel; 604 dstrect->x*dst->format->BytesPerPixel;
605 if ( dst->format->palette || (color == 0) ) { 605 if ( dst->format->palette || (color == 0) ) {
606 x = dstrect->w*dst->format->BytesPerPixel; 606 x = dstrect->w*dst->format->BytesPerPixel;
607 if ( !color && !((long)row&3) && !(x&3) && !(dst->pitch&3) ) { 607 if ( !color && !((uintptr_t)row&3) && !(x&3) && !(dst->pitch&3) ) {
608 int n = x >> 2; 608 int n = x >> 2;
609 for ( y=dstrect->h; y; --y ) { 609 for ( y=dstrect->h; y; --y ) {
610 SDL_memset4(row, 0, n); 610 SDL_memset4(row, 0, n);
611 row += dst->pitch; 611 row += dst->pitch;
612 } 612 }
688 for ( y=dstrect->h; y; --y ) { 688 for ( y=dstrect->h; y; --y ) {
689 Uint16 *pixels = (Uint16 *)row; 689 Uint16 *pixels = (Uint16 *)row;
690 Uint16 c = (Uint16)color; 690 Uint16 c = (Uint16)color;
691 Uint32 cc = (Uint32)c << 16 | c; 691 Uint32 cc = (Uint32)c << 16 | c;
692 int n = dstrect->w; 692 int n = dstrect->w;
693 if((unsigned long)pixels & 3) { 693 if((uintptr_t)pixels & 3) {
694 *pixels++ = c; 694 *pixels++ = c;
695 n--; 695 n--;
696 } 696 }
697 if(n >> 1) 697 if(n >> 1)
698 SDL_memset4(pixels, cc, n >> 1); 698 SDL_memset4(pixels, cc, n >> 1);