diff options
author | Denis Kasak | 2009-07-26 00:04:12 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-26 00:04:12 +0000 |
commit | 2525ec46de6dc07cb2975d81619bafbc1c135846 (patch) | |
tree | 92ba759916f1ebd7a2dd03d5956b6c9c750543dd | |
parent | 3f571c7eae6ebdce030bf81cb0d7667dfc076bc7 (diff) | |
download | scummvm-rg350-2525ec46de6dc07cb2975d81619bafbc1c135846.tar.gz scummvm-rg350-2525ec46de6dc07cb2975d81619bafbc1c135846.tar.bz2 scummvm-rg350-2525ec46de6dc07cb2975d81619bafbc1c135846.zip |
* Removed friend declarations in Drawable for Sprite and Text, and made Drawable's private members protected so they can access them
* Added Text::drawScaled() and altered Text::getRect() so Text instances can be accessed through a Drawable pointer. Scaling text is planned for later because it's not essential.
svn-id: r42789
-rw-r--r-- | engines/draci/sprite.cpp | 3 | ||||
-rw-r--r-- | engines/draci/sprite.h | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 1b9d0acefb..04308a3eed 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -331,7 +331,8 @@ void Text::draw(Surface *surface, bool markDirty) const { _font->drawString(surface, _text, _length, _x, _y, _spacing); } -Common::Rect Text::getRect() const { +// TODO: Handle scaled parameter properly by implementing Text scaling +Common::Rect Text::getRect(bool scaled) const { return Common::Rect(_x, _y, _x + _width, _y + _height); } diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index e1086cab15..44ae8a202b 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -33,9 +33,6 @@ namespace Draci { class Drawable { -friend class Sprite; -friend class Text; - public: virtual void draw(Surface *surface, bool markDirty = true) const = 0; virtual void drawScaled(Surface *surface, bool markDirty = true) const = 0; @@ -64,7 +61,7 @@ public: virtual Common::Rect getRect(bool scaled = true) const = 0; -private: +protected: uint _width; //!< Width of the sprite uint _height; //!< Height of the sprite uint _scaledWidth; //!< Scaled width of the sprite @@ -124,10 +121,14 @@ public: void setText(const Common::String &str); void setColour(byte fontColour); void setSpacing(uint spacing); - + void draw(Surface *surface, bool markDirty = true) const; - Common::Rect getRect() const; + // TODO: drawScaled just calls draw so Text can be accessed through a Drawable pointer. + // Handle scaling text sometimes (not essential). + + void drawScaled(Surface *surface, bool markDirty = true) const { draw(surface, markDirty); } + Common::Rect getRect(bool) const; private: byte *_text; |