diff options
Diffstat (limited to 'engines/draci')
-rw-r--r-- | engines/draci/sprite.cpp | 10 | ||||
-rw-r--r-- | engines/draci/sprite.h | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index b417afc0ed..4461a743f5 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -152,6 +152,10 @@ void Sprite::draw(Surface *surface, bool markDirty) const { } } +Common::Rect Sprite::getRect() const { + return Common::Rect(_x, _y, _x + _width, _y + _height); +} + Text::Text(const Common::String &str, Font *font, byte fontColour, uint x, uint y, uint z, uint spacing) { uint len = str.size(); @@ -201,7 +205,11 @@ void Text::setSpacing(uint spacing) { void Text::draw(Surface *surface, bool markDirty) const { _font->setColour(_colour); _font->drawString(surface, _text, _length, _x, _y, _spacing); -} +} + +Common::Rect Text::getRect() const { + return Common::Rect(_x, _y, _x + _width, _y + _height); +} } // End of namespace Draci diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index 191d20ca9e..6af4e8ca1e 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -50,6 +50,8 @@ public: virtual void setX(uint x) { _x = x; } virtual void setY(uint y) { _y = y; } virtual void setZ(uint z) { _z = z; } + + virtual Common::Rect getRect() const = 0; private: uint16 _width; //!< Width of the sprite @@ -88,6 +90,8 @@ public: void setMirrorOn(); void setMirrorOff(); + + virtual Common::Rect getRect() const; const byte *getBuffer() const { return _data; } private: @@ -108,6 +112,8 @@ public: void draw(Surface *surface, bool markDirty = true) const; + virtual Common::Rect getRect() const; + private: byte *_text; uint _length; |