Skip to content

Commit

Permalink
ACCESS: Add dirty rect handling for font display
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 14, 2014
1 parent 924f2ab commit fda4ef6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions engines/access/asurface.h
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions engines/access/font.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions engines/access/screen.h
Expand Up @@ -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);

Expand Down Expand Up @@ -170,8 +172,6 @@ class Screen: public ASurface {
void cyclePaletteForward();

void cyclePaletteBackwards();

void addDirtyRect(const Common::Rect &r);
};

} // End of namespace Access
Expand Down

0 comments on commit fda4ef6

Please sign in to comment.