aboutsummaryrefslogtreecommitdiff
path: root/engines/access
diff options
context:
space:
mode:
authorPaul Gilbert2015-12-10 20:20:51 -0500
committerPaul Gilbert2015-12-10 20:20:51 -0500
commitf857859041e15d36a88e7843d289024962ddb1b1 (patch)
treeef59bde0441758eda1ac43c5d5822b4c756a637f /engines/access
parentc8acaff52146e6b88cd82c344252c14faf985ba9 (diff)
downloadscummvm-rg350-f857859041e15d36a88e7843d289024962ddb1b1.tar.gz
scummvm-rg350-f857859041e15d36a88e7843d289024962ddb1b1.tar.bz2
scummvm-rg350-f857859041e15d36a88e7843d289024962ddb1b1.zip
ACCESS: Fix showing inventory after loading a close-up savegame
Diffstat (limited to 'engines/access')
-rw-r--r--engines/access/asurface.cpp7
-rw-r--r--engines/access/asurface.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp
index abae6bf703..cb51431657 100644
--- a/engines/access/asurface.cpp
+++ b/engines/access/asurface.cpp
@@ -294,6 +294,13 @@ void ASurface::copyBlock(ASurface *src, const Common::Rect &bounds) {
copyRectToSurface(*src, bounds.left, bounds.top, bounds);
}
+void ASurface::copyTo(ASurface *dest) {
+ if (dest->empty())
+ dest->create(this->w, this->h);
+
+ dest->blitFrom(*this);
+}
+
void ASurface::saveBlock(const Common::Rect &bounds) {
_savedBounds = bounds;
_savedBounds.clip(Common::Rect(0, 0, this->w, this->h));
diff --git a/engines/access/asurface.h b/engines/access/asurface.h
index ce9928c00e..dd05c8067b 100644
--- a/engines/access/asurface.h
+++ b/engines/access/asurface.h
@@ -63,6 +63,8 @@ public:
void create(uint16 width, uint16 height);
+ bool empty() const { return w == 0 || h == 0 || pixels == nullptr; }
+
void clearBuffer();
bool clip(Common::Rect &r);
@@ -113,7 +115,7 @@ public:
virtual void addDirtyRect(const Common::Rect &r) {}
- void copyTo(ASurface *dest) { dest->blitFrom(*this); }
+ void copyTo(ASurface *dest);
void saveBlock(const Common::Rect &bounds);