Skip to content

Commit

Permalink
SDL_HWPALETTE fix (submitted by tehpola)
Browse files Browse the repository at this point in the history
  • Loading branch information
dborth committed May 13, 2009
1 parent 9b4b52a commit b32c91e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SDL/src/video/wii/SDL_wiivideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ SDL_Surface *WII_SetVideoMode(_THIS, SDL_Surface *current,
return NULL;
}

if(bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
if(bpp != 8 && bpp != 16 && bpp != 24)
{
SDL_SetError("Resolution (%d bpp) is unsupported (8 or 16 bpp only).",
SDL_SetError("Resolution (%d bpp) is unsupported (8/16/24 bpp only).",
bpp);
return NULL;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ SDL_Surface *WII_SetVideoMode(_THIS, SDL_Surface *current,
SDL_memset(this->hidden->buffer, 0, width * height * bytes_per_pixel);

// Set up the new mode framebuffer
current->flags = SDL_DOUBLEBUF |( flags & SDL_FULLSCREEN);
current->flags = SDL_DOUBLEBUF | (flags & SDL_FULLSCREEN) | (flags & SDL_HWPALETTE);
current->w = width;
current->h = height;
current->pitch = current->w * bytes_per_pixel;
Expand Down Expand Up @@ -380,7 +380,7 @@ static void flipHWSurface_8_16(_THIS, SDL_Surface *surface)
for (w = 0; w < this->hidden->width; w++)
{
Uint16 v = palette[*ptr];

*ptr_cv++ = v;
ptr++;
}
Expand Down Expand Up @@ -484,7 +484,7 @@ static void flipHWSurface_24_16(_THIS, SDL_Surface *surface)
r = *ptr++;
g = *ptr++;
b = *ptr++;

*ptr_cv++ = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
}
}
Expand Down

0 comments on commit b32c91e

Please sign in to comment.