From fda4ef620f3eefc76d7362945d514e6c46187073 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 14 Dec 2014 15:22:09 -0500 Subject: [PATCH] ACCESS: Add dirty rect handling for font display --- engines/access/asurface.h | 2 ++ engines/access/font.cpp | 2 ++ engines/access/screen.h | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/access/asurface.h b/engines/access/asurface.h index db17eb208982..139565190b63 100644 --- a/engines/access/asurface.h +++ b/engines/access/asurface.h @@ -105,6 +105,8 @@ class ASurface : public Graphics::Surface { virtual void copyBuffer(Graphics::Surface *src); + virtual void addDirtyRect(const Common::Rect &r) {} + void copyTo(ASurface *dest) { dest->copyFrom(*this); } void saveBlock(const Common::Rect &bounds); diff --git a/engines/access/font.cpp b/engines/access/font.cpp index 51fb9dc1c85f..1aadfb6be2a9 100644 --- a/engines/access/font.cpp +++ b/engines/access/font.cpp @@ -150,6 +150,8 @@ void Font::drawString(ASurface *s, const Common::String &msg, const Common::Poin int Font::drawChar(ASurface *s, char c, Common::Point &pt) { Graphics::Surface &ch = _chars[c - ' ']; + s->addDirtyRect(Common::Rect(pt.x, pt.y, pt.x + ch.w, pt.y + ch.h)); + // Loop through the lines of the character for (int y = 0; y < ch.h; ++y) { byte *pSrc = (byte *)ch.getBasePtr(0, y); diff --git a/engines/access/screen.h b/engines/access/screen.h index 56ee9bed20d5..7134afffebc0 100644 --- a/engines/access/screen.h +++ b/engines/access/screen.h @@ -96,6 +96,8 @@ class Screen: public ASurface { virtual void copyFrom(Graphics::Surface &src); virtual void copyBuffer(Graphics::Surface *src); + + virtual void addDirtyRect(const Common::Rect &r); public: Screen(AccessEngine *vm); @@ -170,8 +172,6 @@ class Screen: public ASurface { void cyclePaletteForward(); void cyclePaletteBackwards(); - - void addDirtyRect(const Common::Rect &r); }; } // End of namespace Access