aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/sprite.h
diff options
context:
space:
mode:
authorDenis Kasak2009-07-26 00:04:12 +0000
committerDenis Kasak2009-07-26 00:04:12 +0000
commit2525ec46de6dc07cb2975d81619bafbc1c135846 (patch)
tree92ba759916f1ebd7a2dd03d5956b6c9c750543dd /engines/draci/sprite.h
parent3f571c7eae6ebdce030bf81cb0d7667dfc076bc7 (diff)
downloadscummvm-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
Diffstat (limited to 'engines/draci/sprite.h')
-rw-r--r--engines/draci/sprite.h13
1 files changed, 7 insertions, 6 deletions
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;