aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/draci/sprite.cpp3
-rw-r--r--engines/draci/sprite.h13
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;