aboutsummaryrefslogtreecommitdiff
path: root/engines/access/files.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-24 14:42:26 -0400
committerPaul Gilbert2014-08-24 14:42:26 -0400
commite53417f91a1305cfb69ef57dd97a5f8fe5311eee (patch)
treeadeaa6b450a349f4073c61d3f450429fbad397d0 /engines/access/files.cpp
parent6774dd42467265e4083fd7f97447d7ce2f437529 (diff)
downloadscummvm-rg350-e53417f91a1305cfb69ef57dd97a5f8fe5311eee.tar.gz
scummvm-rg350-e53417f91a1305cfb69ef57dd97a5f8fe5311eee.tar.bz2
scummvm-rg350-e53417f91a1305cfb69ef57dd97a5f8fe5311eee.zip
ACCESS: Fix loading of inventory screen background
Diffstat (limited to 'engines/access/files.cpp')
-rw-r--r--engines/access/files.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/access/files.cpp b/engines/access/files.cpp
index 5cf467077d..b1d6140e3e 100644
--- a/engines/access/files.cpp
+++ b/engines/access/files.cpp
@@ -111,7 +111,19 @@ void FileManager::loadScreen(Graphics::Surface *dest, int fileNum, int subfile)
// Get the data for the screen, and copy it over
byte *pSrc = handleFile();
- Common::copy(pSrc, pSrc + _filesize, (byte *)dest->getPixels());
+
+ if (dest != _vm->_screen)
+ dest->w = _vm->_screen->w;
+
+ if (dest->w == dest->pitch) {
+ Common::copy(pSrc, pSrc + _filesize, (byte *)dest->getPixels());
+ } else {
+ byte *pCurr = pSrc;
+ for (int y = 0; y < dest->h; ++y, pCurr += dest->w) {
+ byte *pDest = (byte *)dest->getBasePtr(0, y);
+ Common::copy(pCurr, pCurr + dest->w, pDest);
+ }
+ }
delete[] pSrc;
}