Skip to content

Commit

Permalink
Sprite/video: remove dead code
Browse files Browse the repository at this point in the history
GetPalette is pure virtual and the video driver code died when we implemented the SDLSurfaceSprite subclass
  • Loading branch information
bradallred committed Jun 16, 2013
1 parent 1c53aee commit 4e89fb6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
7 changes: 0 additions & 7 deletions gemrb/core/Sprite2D.cpp
Expand Up @@ -64,13 +64,6 @@ bool Sprite2D::IsPixelTransparent(unsigned short x, unsigned short y) const
return GetPixel(x, y).a == 0;
}

/** Get the Palette of a Sprite */
Palette* Sprite2D::GetPalette() const
{
if (!vptr) return NULL;
return core->GetVideoDriver()->GetPalette(vptr);
}

Color Sprite2D::GetPixel(unsigned short x, unsigned short y) const
{
Color c = { 0, 0, 0, 0 };
Expand Down
2 changes: 0 additions & 2 deletions gemrb/core/Video.h
Expand Up @@ -181,8 +181,6 @@ class GEM_EXPORT Video : public Plugin {
void BlitTiled(Region rgn, const Sprite2D* img, bool anchor = false);
/** Sets Event Manager */
void SetEventMgr(EventMgr* evnt);
/** Gets the Palette of a surface */
virtual Palette* GetPalette(void* surface) = 0;
/** Flips sprite vertically, returns new sprite */
virtual Sprite2D *MirrorSpriteVertical(const Sprite2D *sprite, bool MirrorAnchor) = 0;
/** Flips sprite horizontally, returns new sprite */
Expand Down
15 changes: 0 additions & 15 deletions gemrb/plugins/SDLVideo/SDLVideo.cpp
Expand Up @@ -1566,21 +1566,6 @@ void SDLVideoDriver::DrawPolyline(Gem_Polygon* poly, const Color& color, bool fi
return;
}

Palette* SDLVideoDriver::GetPalette(void *vptr)
{
SDL_Surface* s = ( SDL_Surface* ) vptr;
if (s->format->BitsPerPixel != 8) {
return NULL;
}
Palette* pal = new Palette();
for (int i = 0; i < s->format->palette->ncolors; i++) {
pal->col[i].r = s->format->palette->colors[i].r;
pal->col[i].g = s->format->palette->colors[i].g;
pal->col[i].b = s->format->palette->colors[i].b;
}
return pal;
}

// Flips given sprite vertically (up-down). If MirrorAnchor=true,
// flips its anchor (i.e. origin//base point) as well
// returns new sprite
Expand Down
2 changes: 0 additions & 2 deletions gemrb/plugins/SDLVideo/SDLVideo.h
Expand Up @@ -128,8 +128,6 @@ class SDLVideoDriver : public Video {
void DrawLine(short x1, short y1, short x2, short y2, const Color& color, bool clipped = false);
/** Blits a Sprite filling the Region */
void BlitTiled(Region rgn, const Sprite2D* img, bool anchor = false);
/** Get the Palette of a surface */
Palette* GetPalette(void *vptr);
/** Flips sprite vertically */
Sprite2D *MirrorSpriteVertical(const Sprite2D *sprite, bool MirrorAnchor);
/** Flips sprite horizontally */
Expand Down

0 comments on commit 4e89fb6

Please sign in to comment.