Permalink
Browse files

SDLSurfaceSprite: be compatible with bpps less than 8

  • Loading branch information...
1 parent 16f5f91 commit f1219d6cbb0e69eb54b5930c57d03034ed6d5597 @bradallred bradallred committed Jun 21, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 gemrb/plugins/SDLVideo/SDLSurfaceSprite2D.cpp
@@ -61,9 +61,10 @@ SDLSurfaceSprite2D::~SDLSurfaceSprite2D()
/** Get the Palette of a Sprite */
Palette* SDLSurfaceSprite2D::GetPalette() const
{
- if (surface->format->BitsPerPixel != 8) {
+ if (surface->format->BytesPerPixel != 1) {
return NULL;
}
+ assert(surface->format->palette->ncolors <= 256);
Palette* pal = new Palette();
memcpy(pal->col, surface->format->palette->colors, surface->format->palette->ncolors * 4);
return pal;

0 comments on commit f1219d6

Please sign in to comment.