Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Date: Sun, 27 Jul 2003 22:37:59 +0200
From: Max Horn
Subject: SDL whitespace patch

this patch is lowest priority: it only contains indention fixes. In
some places, instead of tabs, whitespaces where used for indention. But
of course that only "looks good" if you use the exact same tab width as
the author of those files. I tried to replace such cases with tabs for
a more uniform indention. I only did that for a few files.

So, no code changes in this, only whitespaces transformed.
  • Loading branch information
slouken committed Jul 28, 2003
1 parent 559ec12 commit cd70bf5
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/video/SDL_video.c
Expand Up @@ -260,7 +260,7 @@ int SDL_VideoInit (const char *driver_name, Uint32 flags)
*/
/* If we have a palettized surface, create a default palette */
if ( SDL_VideoSurface->format->palette ) {
SDL_PixelFormat *vf = SDL_VideoSurface->format;
SDL_PixelFormat *vf = SDL_VideoSurface->format;
SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
video->SetColors(video,
0, vf->palette->ncolors, vf->palette->colors);
Expand Down Expand Up @@ -633,7 +633,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
video->physpal = NULL;
}
if( video->gammacols) {
free(video->gammacols);
free(video->gammacols);
video->gammacols = NULL;
}

Expand All @@ -652,7 +652,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
mode = NULL;
}
}
}
/*
* rcg11292000
* If you try to set an SDL_OPENGL surface, and fail to find a
Expand All @@ -675,7 +675,7 @@ SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)

/* If we have a palettized surface, create a default palette */
if ( mode->format->palette ) {
SDL_PixelFormat *vf = mode->format;
SDL_PixelFormat *vf = mode->format;
SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
video->SetColors(this, 0, vf->palette->ncolors,
vf->palette->colors);
Expand Down Expand Up @@ -805,7 +805,7 @@ do { \
/* Free the original video mode surface (is this safe?) */
SDL_FreeSurface(mode);

/* Set the surface completely opaque & white by default */
/* Set the surface completely opaque & white by default */
memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch );
video->glGenTextures( 1, &video->texture );
video->glBindTexture( GL_TEXTURE_2D, video->texture );
Expand Down Expand Up @@ -1093,17 +1093,17 @@ int SDL_Flip(SDL_Surface *screen)
static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors,
int firstcolor, int ncolors)
{
SDL_Palette *pal = screen->format->palette;
SDL_Palette *pal = screen->format->palette;
SDL_Palette *vidpal;

if ( colors != (pal->colors + firstcolor) ) {
memcpy(pal->colors + firstcolor, colors,
memcpy(pal->colors + firstcolor, colors,
ncolors * sizeof(*colors));
}

vidpal = SDL_VideoSurface->format->palette;
if ( (screen == SDL_ShadowSurface) && vidpal ) {
/*
/*
* This is a shadow surface, and the physical
* framebuffer is also indexed. Propagate the
* changes to its logical palette so that
Expand Down Expand Up @@ -1170,8 +1170,8 @@ static int SetPalette_physical(SDL_Surface *screen,
if ( screen == SDL_VideoSurface ) {
SDL_Color gcolors[256];

if ( video->gamma ) {
SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
if ( video->gamma ) {
SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
colors = gcolors;
}
gotall = video->SetColors(video, firstcolor, ncolors, colors);
Expand Down Expand Up @@ -1199,30 +1199,30 @@ static int SetPalette_physical(SDL_Surface *screen,
int SDL_SetPalette(SDL_Surface *screen, int which,
SDL_Color *colors, int firstcolor, int ncolors)
{
SDL_Palette *pal;
SDL_Palette *pal;
int gotall;
int palsize;

if ( ! current_video ) {
return 0;
}
if ( screen != SDL_PublicSurface ) {
/* only screens have physical palettes */
which &= ~SDL_PHYSPAL;
/* only screens have physical palettes */
which &= ~SDL_PHYSPAL;
} else if( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) {
/* hardware palettes required for split colormaps */
which |= SDL_PHYSPAL | SDL_LOGPAL;
/* hardware palettes required for split colormaps */
which |= SDL_PHYSPAL | SDL_LOGPAL;
}

/* Verify the parameters */
pal = screen->format->palette;
if( !pal ) {
return 0; /* not a palettized surface */
return 0; /* not a palettized surface */
}
gotall = 1;
palsize = 1 << screen->format->BitsPerPixel;
if ( ncolors > (palsize - firstcolor) ) {
ncolors = (palsize - firstcolor);
ncolors = (palsize - firstcolor);
gotall = 0;
}

Expand All @@ -1233,20 +1233,20 @@ int SDL_SetPalette(SDL_Surface *screen, int which,
* interpretation of the pixel values (for blits etc) is
* changed.
*/
SetPalette_logical(screen, colors, firstcolor, ncolors);
SetPalette_logical(screen, colors, firstcolor, ncolors);
}
if ( which & SDL_PHYSPAL ) {
SDL_VideoDevice *video = current_video;
/*
/*
* Physical palette change: This doesn't affect the
* program's idea of what the screen looks like, but changes
* its actual appearance.
*/
if(!video)
return gotall; /* video not yet initialized */
if(!video)
return gotall; /* video not yet initialized */
if(!video->physpal && !(which & SDL_LOGPAL) ) {
/* Lazy physical palette allocation */
int size;
int size;
SDL_Palette *pp = malloc(sizeof(*pp));
current_video->physpal = pp;
pp->ncolors = pal->ncolors;
Expand All @@ -1265,7 +1265,7 @@ int SDL_SetPalette(SDL_Surface *screen, int which,
int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor,
int ncolors)
{
return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
colors, firstcolor, ncolors);
}

Expand Down Expand Up @@ -1398,8 +1398,8 @@ int SDL_GL_SetAttribute( SDL_GLattr attr, int value )
case SDL_GL_DOUBLEBUFFER:
video->gl_config.double_buffer = value;
break;
case SDL_GL_BUFFER_SIZE:
video->gl_config.buffer_size = value;
case SDL_GL_BUFFER_SIZE:
video->gl_config.buffer_size = value;
break;
case SDL_GL_DEPTH_SIZE:
video->gl_config.depth_size = value;
Expand Down

0 comments on commit cd70bf5

Please sign in to comment.