Skip to content

Commit

Permalink
ACCESS: Dirty rect handling for bubble boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 14, 2014
1 parent 98889ef commit 9314daa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions engines/access/asurface.h
Expand Up @@ -95,6 +95,8 @@ class ASurface : public Graphics::Surface {

virtual void restoreBlock();

virtual void drawRect();

void copyTo(ASurface *dest, const Common::Point &destPos);

void copyTo(ASurface *dest, const Common::Rect &bounds);
Expand All @@ -103,8 +105,6 @@ class ASurface : public Graphics::Surface {

void saveBlock(const Common::Rect &bounds);

void drawRect();

void moveBufferLeft();

void moveBufferRight();
Expand Down
2 changes: 1 addition & 1 deletion engines/access/inventory.cpp
Expand Up @@ -171,7 +171,7 @@ int InventoryManager::newDisplayInv() {
// The original was testing the vesa mode too.
// We removed this check as we don't use pre-rendering
if (!_invRefreshFlag) {
screen.clearBuffer();
screen.clearScreen();
screen.setPalette();
}

Expand Down
8 changes: 7 additions & 1 deletion engines/access/screen.cpp
Expand Up @@ -251,8 +251,13 @@ void Screen::copyBlock(ASurface *src, const Common::Rect &bounds) {
}

void Screen::restoreBlock() {
ASurface::restoreBlock();
addDirtyRect(_savedBounds);
ASurface::restoreBlock();
}

void Screen::drawRect() {
addDirtyRect(Common::Rect(_orgX1, _orgY1, _orgX2, _orgY2));
ASurface::drawRect();
}

void Screen::setPaletteCycle(int startCycle, int endCycle, int timer) {
Expand Down Expand Up @@ -292,6 +297,7 @@ void Screen::cyclePaletteBackwards() {

void Screen::addDirtyRect(const Common::Rect &r) {
_dirtyRects.push_back(r);
assert(r.isValidRect() && r.width() > 0 && r.height() > 0);
}

} // End of namespace Access
2 changes: 2 additions & 0 deletions engines/access/screen.h
Expand Up @@ -86,6 +86,8 @@ class Screen: public ASurface {
virtual void copyBlock(ASurface *src, const Common::Rect &bounds);

virtual void restoreBlock();

virtual void drawRect();
public:
Screen(AccessEngine *vm);

Expand Down

0 comments on commit 9314daa

Please sign in to comment.