Permalink
Browse files

Sprites: move colorkey ivar to BAM subclass

make colorkey functions pure virtual
  • Loading branch information...
1 parent 86e3ea9 commit 7125ea0094b01b932c5e53f690bd408636f063cd @bradallred bradallred committed Jun 16, 2013
Showing with 5 additions and 15 deletions.
  1. +0 −11 gemrb/core/Sprite2D.cpp
  2. +2 −4 gemrb/core/Sprite2D.h
  3. +3 −0 gemrb/plugins/BAMImporter/BAMSprite2D.h
View
@@ -36,7 +36,6 @@ Sprite2D::Sprite2D(int Width, int Height, int Bpp, void* vptr, const void* pixel
XPos = 0;
YPos = 0;
RefCount = 1;
- colorkey = 0;
renderFlags = 0;
}
@@ -88,14 +87,4 @@ void Sprite2D::release()
core->GetVideoDriver()->FreeSprite(that);
}
-ieDword Sprite2D::GetColorKey() const
-{
- return colorkey;
-}
-
-void Sprite2D::SetColorKey(ieDword ck)
-{
- colorkey = ck;
-}
-
}
View
@@ -49,8 +49,6 @@ class AnimationFactory;
class GEM_EXPORT Sprite2D {
public:
static const TypeID ID;
-protected:
- ieDword colorkey;
public:
int XPos, YPos, Width, Height, Bpp;
/** Pointer to the Driver Video Structure */
@@ -69,8 +67,8 @@ class GEM_EXPORT Sprite2D {
virtual Palette *GetPalette() const = 0;
virtual void SetPalette(Palette *pal) = 0;
virtual Color GetPixel(unsigned short x, unsigned short y) const;
- virtual ieDword GetColorKey() const;
- virtual void SetColorKey(ieDword ck);
+ virtual ieDword GetColorKey() const = 0;
+ virtual void SetColorKey(ieDword ck) = 0;
public: // public only for SDLVideo
int RefCount;
public:
@@ -30,6 +30,7 @@ class AnimationFactory;
class BAMSprite2D : public Sprite2D {
private:
Palette* pal;
+ ieDword colorkey;
// The AnimationFactory in which the data for this sprite is stored.
// (Used for refcounting of the data.)
AnimationFactory* source;
@@ -46,6 +47,8 @@ class BAMSprite2D : public Sprite2D {
Palette *GetPalette() const;
void SetPalette(Palette *pal);
Color GetPixel(unsigned short x, unsigned short y) const;
+ ieDword GetColorKey() const { return colorkey; };
+ void SetColorKey(ieDword ck) { colorkey = ck; };
};
}

0 comments on commit 7125ea0

Please sign in to comment.