Skip to content
Browse files

Sprite/video: remove dead code

GetPalette is pure virtual and the video driver code died when we implemented the SDLSurfaceSprite subclass
  • Loading branch information...
1 parent 1c53aee commit 4e89fb618a6b620d616ce685db09882b6ec6d896 @bradallred bradallred committed Jun 16, 2013
Showing with 0 additions and 26 deletions.
  1. +0 −7 gemrb/core/Sprite2D.cpp
  2. +0 −2 gemrb/core/Video.h
  3. +0 −15 gemrb/plugins/SDLVideo/SDLVideo.cpp
  4. +0 −2 gemrb/plugins/SDLVideo/SDLVideo.h
View
7 gemrb/core/Sprite2D.cpp
@@ -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 };
View
2 gemrb/core/Video.h
@@ -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 */
View
15 gemrb/plugins/SDLVideo/SDLVideo.cpp
@@ -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
View
2 gemrb/plugins/SDLVideo/SDLVideo.h
@@ -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 */

0 comments on commit 4e89fb6

Please sign in to comment.
Something went wrong with that request. Please try again.