src/video/SDL_video.c
changeset 662 66c02f83f5bf
parent 656 864e2d2a9a55
child 663 8bedd6d61642
     1.1 --- a/src/video/SDL_video.c	Sun Jul 27 17:00:40 2003 +0000
     1.2 +++ b/src/video/SDL_video.c	Mon Jul 28 01:47:55 2003 +0000
     1.3 @@ -260,7 +260,7 @@
     1.4         */
     1.5  	/* If we have a palettized surface, create a default palette */
     1.6  	if ( SDL_VideoSurface->format->palette ) {
     1.7 -	        SDL_PixelFormat *vf = SDL_VideoSurface->format;
     1.8 +		SDL_PixelFormat *vf = SDL_VideoSurface->format;
     1.9  		SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
    1.10  		video->SetColors(video,
    1.11  				 0, vf->palette->ncolors, vf->palette->colors);
    1.12 @@ -633,7 +633,7 @@
    1.13  		video->physpal = NULL;
    1.14  	}
    1.15  	if( video->gammacols) {
    1.16 -	        free(video->gammacols);
    1.17 +		free(video->gammacols);
    1.18  		video->gammacols = NULL;
    1.19  	}
    1.20  
    1.21 @@ -652,7 +652,7 @@
    1.22  	    if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
    1.23  		mode = NULL;
    1.24  	    }
    1.25 -        }
    1.26 +	}
    1.27  	/*
    1.28  	 * rcg11292000
    1.29  	 * If you try to set an SDL_OPENGL surface, and fail to find a
    1.30 @@ -675,7 +675,7 @@
    1.31  
    1.32  		/* If we have a palettized surface, create a default palette */
    1.33  		if ( mode->format->palette ) {
    1.34 -	        	SDL_PixelFormat *vf = mode->format;
    1.35 +			SDL_PixelFormat *vf = mode->format;
    1.36  			SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
    1.37  			video->SetColors(this, 0, vf->palette->ncolors,
    1.38  			                           vf->palette->colors);
    1.39 @@ -805,7 +805,7 @@
    1.40  		/* Free the original video mode surface (is this safe?) */
    1.41  		SDL_FreeSurface(mode);
    1.42  
    1.43 -                /* Set the surface completely opaque & white by default */
    1.44 +		/* Set the surface completely opaque & white by default */
    1.45  		memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch );
    1.46  		video->glGenTextures( 1, &video->texture );
    1.47  		video->glBindTexture( GL_TEXTURE_2D, video->texture );
    1.48 @@ -1093,17 +1093,17 @@
    1.49  static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors,
    1.50  			       int firstcolor, int ncolors)
    1.51  {
    1.52 -        SDL_Palette *pal = screen->format->palette;
    1.53 +	SDL_Palette *pal = screen->format->palette;
    1.54  	SDL_Palette *vidpal;
    1.55  
    1.56  	if ( colors != (pal->colors + firstcolor) ) {
    1.57 -	        memcpy(pal->colors + firstcolor, colors,
    1.58 +		memcpy(pal->colors + firstcolor, colors,
    1.59  		       ncolors * sizeof(*colors));
    1.60  	}
    1.61  
    1.62  	vidpal = SDL_VideoSurface->format->palette;
    1.63  	if ( (screen == SDL_ShadowSurface) && vidpal ) {
    1.64 -	        /*
    1.65 +		/*
    1.66  		 * This is a shadow surface, and the physical
    1.67  		 * framebuffer is also indexed. Propagate the
    1.68  		 * changes to its logical palette so that
    1.69 @@ -1170,8 +1170,8 @@
    1.70  	if ( screen == SDL_VideoSurface ) {
    1.71  		SDL_Color gcolors[256];
    1.72  
    1.73 -	        if ( video->gamma ) {
    1.74 -		        SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
    1.75 +		if ( video->gamma ) {
    1.76 +			SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
    1.77  			colors = gcolors;
    1.78  		}
    1.79  		gotall = video->SetColors(video, firstcolor, ncolors, colors);
    1.80 @@ -1199,7 +1199,7 @@
    1.81  int SDL_SetPalette(SDL_Surface *screen, int which,
    1.82  		   SDL_Color *colors, int firstcolor, int ncolors)
    1.83  {
    1.84 -        SDL_Palette *pal;
    1.85 +	SDL_Palette *pal;
    1.86  	int gotall;
    1.87  	int palsize;
    1.88  
    1.89 @@ -1207,22 +1207,22 @@
    1.90  		return 0;
    1.91  	}
    1.92  	if ( screen != SDL_PublicSurface ) {
    1.93 -	        /* only screens have physical palettes */
    1.94 -	        which &= ~SDL_PHYSPAL;
    1.95 +		/* only screens have physical palettes */
    1.96 +		which &= ~SDL_PHYSPAL;
    1.97  	} else if( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) {
    1.98 -	        /* hardware palettes required for split colormaps */
    1.99 -	        which |= SDL_PHYSPAL | SDL_LOGPAL;
   1.100 +		/* hardware palettes required for split colormaps */
   1.101 +		which |= SDL_PHYSPAL | SDL_LOGPAL;
   1.102  	}
   1.103  
   1.104  	/* Verify the parameters */
   1.105  	pal = screen->format->palette;
   1.106  	if( !pal ) {
   1.107 -	        return 0;	/* not a palettized surface */
   1.108 +		return 0;	/* not a palettized surface */
   1.109  	}
   1.110  	gotall = 1;
   1.111  	palsize = 1 << screen->format->BitsPerPixel;
   1.112  	if ( ncolors > (palsize - firstcolor) ) {
   1.113 -	        ncolors = (palsize - firstcolor);
   1.114 +		ncolors = (palsize - firstcolor);
   1.115  		gotall = 0;
   1.116  	}
   1.117  
   1.118 @@ -1233,20 +1233,20 @@
   1.119  		 * interpretation of the pixel values (for blits etc) is
   1.120  		 * changed.
   1.121  		 */
   1.122 -	        SetPalette_logical(screen, colors, firstcolor, ncolors);
   1.123 +		SetPalette_logical(screen, colors, firstcolor, ncolors);
   1.124  	}
   1.125  	if ( which & SDL_PHYSPAL ) {
   1.126  		SDL_VideoDevice *video = current_video;
   1.127 -	        /*
   1.128 +		/*
   1.129  		 * Physical palette change: This doesn't affect the
   1.130  		 * program's idea of what the screen looks like, but changes
   1.131  		 * its actual appearance.
   1.132  		 */
   1.133 -	        if(!video)
   1.134 -		        return gotall;	/* video not yet initialized */
   1.135 +		if(!video)
   1.136 +			return gotall;	/* video not yet initialized */
   1.137  		if(!video->physpal && !(which & SDL_LOGPAL) ) {
   1.138  			/* Lazy physical palette allocation */
   1.139 -		        int size;
   1.140 +			int size;
   1.141  			SDL_Palette *pp = malloc(sizeof(*pp));
   1.142  			current_video->physpal = pp;
   1.143  			pp->ncolors = pal->ncolors;
   1.144 @@ -1265,7 +1265,7 @@
   1.145  int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor,
   1.146  		  int ncolors)
   1.147  {
   1.148 -        return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
   1.149 +	return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
   1.150  			      colors, firstcolor, ncolors);
   1.151  }
   1.152  
   1.153 @@ -1398,8 +1398,8 @@
   1.154  		case SDL_GL_DOUBLEBUFFER:
   1.155  			video->gl_config.double_buffer = value;
   1.156  			break;
   1.157 -        	case SDL_GL_BUFFER_SIZE:
   1.158 -	        	video->gl_config.buffer_size = value;
   1.159 +		case SDL_GL_BUFFER_SIZE:
   1.160 +			video->gl_config.buffer_size = value;
   1.161  			break;
   1.162  		case SDL_GL_DEPTH_SIZE:
   1.163  			video->gl_config.depth_size = value;