aboutsummaryrefslogtreecommitdiff
path: root/engines/access/files.cpp
diff options
context:
space:
mode:
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;
}