diff options
author | Denis Kasak | 2009-06-30 22:31:29 +0000 |
---|---|---|
committer | Denis Kasak | 2009-06-30 22:31:29 +0000 |
commit | 85a5871873499a2965dd5badffd224a7560f9b60 (patch) | |
tree | 7aa28496618527fcfea89404058088dd5ec8302d /engines/draci/sprite.h | |
parent | 138d17bbabd5e5639b6aab24f1c2a0b75a9384f7 (diff) | |
download | scummvm-rg350-85a5871873499a2965dd5badffd224a7560f9b60.tar.gz scummvm-rg350-85a5871873499a2965dd5badffd224a7560f9b60.tar.bz2 scummvm-rg350-85a5871873499a2965dd5badffd224a7560f9b60.zip |
Added the Drawable abstract base class and made Sprite inherit from it.
svn-id: r41979
Diffstat (limited to 'engines/draci/sprite.h')
-rw-r--r-- | engines/draci/sprite.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index 18ea899641..c9591514e3 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -30,6 +30,17 @@ namespace Draci { +class Drawable { + +public: + virtual void draw(Surface *surface) const = 0; + virtual ~Drawable() {}; + + uint16 _width; //!< Width of the sprite + uint16 _height; //!< Height of the sprite + uint16 _x, _y; //!< Sprite coordinates +}; + /** * Represents a Draci Historie sprite. Supplies two constructors; one for * loading a sprite from a raw data buffer and one for loading a sprite in @@ -43,7 +54,7 @@ namespace Draci { * [height * width bytes] image pixels stored column-wise, one byte per pixel */ -class Sprite { +class Sprite : public Drawable { public: Sprite(byte *raw_data, uint16 width, uint16 height, uint16 x = 0, uint16 y = 0, @@ -57,9 +68,6 @@ public: void draw(Surface *surface) const; byte *_data; //!< Pointer to a buffer containing raw sprite data (row-wise) - uint16 _width; //!< Width of the sprite - uint16 _height; //!< Height of the sprite - uint16 _x, _y; //!< Sprite coordinates }; |