diff options
author | Johannes Schickel | 2007-05-22 13:44:41 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-05-22 13:44:41 +0000 |
commit | 91402fda9b1b1bc6447260dc020d84d9edb62249 (patch) | |
tree | 23a21491310694771bfda57e87f01f5090cb594a /engines | |
parent | 06b3206b21cc4e93f0abdbd4d9cfb442e6516269 (diff) | |
download | scummvm-rg350-91402fda9b1b1bc6447260dc020d84d9edb62249.tar.gz scummvm-rg350-91402fda9b1b1bc6447260dc020d84d9edb62249.tar.bz2 scummvm-rg350-91402fda9b1b1bc6447260dc020d84d9edb62249.zip |
Some graphic fixes for FM-Towns version. (Thanks to Florian Kagerer for this).
svn-id: r26915
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/screen.cpp | 41 | ||||
-rw-r--r-- | engines/kyra/screen.h | 1 |
2 files changed, 40 insertions, 2 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 95bd17d557..bde89a6a6b 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -63,10 +63,16 @@ Screen::~Screen() { } delete [] _bitBlitRects; + for (int i = 0; i < ARRAYSIZE(_saveLoadPage); ++i) { delete [] _saveLoadPage[i]; _saveLoadPage[i] = 0; } + + for (int i = 0; i < ARRAYSIZE(_saveLoadPageOvl); ++i) { + delete [] _saveLoadPageOvl[i]; + _saveLoadPageOvl[i] = 0; + } delete [] _unkPtr1; delete [] _unkPtr2; @@ -168,6 +174,7 @@ bool Screen::init() { memset(_bitBlitRects, 0, sizeof(Rect)*BITBLIT_RECTS); _bitBlitNum = 0; memset(_saveLoadPage, 0, sizeof(_saveLoadPage)); + memset(_saveLoadPageOvl, 0, sizeof(_saveLoadPageOvl)); _unkPtr1 = new uint8[getRectSize(1, 144)]; assert(_unkPtr1); @@ -2377,20 +2384,50 @@ void Screen::savePageToDisk(const char *file, int page) { assert(_saveLoadPage[page/2]); } memcpy(_saveLoadPage[page/2], getPagePtr(page), SCREEN_W * SCREEN_H); + + if (_useOverlays) { + if (!_saveLoadPageOvl[page/2]) { + _saveLoadPageOvl[page/2] = new uint8[SCREEN_OVL_SJIS_SIZE]; + assert(_saveLoadPageOvl[page/2]); + } + + uint8 *srcPage = getOverlayPtr(page); + if (!srcPage) { + warning("trying to save unsupported overlay page %d", page); + return; + } + + memcpy(_saveLoadPageOvl[page/2], srcPage, SCREEN_OVL_SJIS_SIZE); + } } void Screen::loadPageFromDisk(const char *file, int page) { debugC(9, kDebugLevelScreen, "Screen::loadPageFromDisk('%s', %d)", file, page); copyBlockToPage(page, 0, 0, SCREEN_W, SCREEN_H, _saveLoadPage[page/2]); - clearOverlayRect(page, 0, 0, SCREEN_W, SCREEN_H); delete [] _saveLoadPage[page/2]; - _saveLoadPage[page/2] = 0; + + if (_saveLoadPageOvl[page/2]) { + uint8 *dstPage = getOverlayPtr(page); + if (!dstPage) { + warning("trying to restore unsupported overlay page %d", page); + return; + } + + memcpy(dstPage, _saveLoadPageOvl[page/2], SCREEN_OVL_SJIS_SIZE); + delete [] _saveLoadPageOvl[page/2]; + _saveLoadPageOvl[page/2] = 0; + } _saveLoadPage[page/2] = 0; } void Screen::deletePageFromDisk(int page) { debugC(9, kDebugLevelScreen, "Screen::deletePageFromDisk(%d)", page); delete [] _saveLoadPage[page/2]; _saveLoadPage[page/2] = 0; + + if (_saveLoadPageOvl[page/2]) { + delete [] _saveLoadPageOvl[page/2]; + _saveLoadPageOvl[page/2] = 0; + } } void Screen::blockInRegion(int x, int y, int width, int height) { diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index a89bd7a047..8f8dd1702d 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -282,6 +282,7 @@ private: uint8 *_sjisSourceChar; uint8 *_saveLoadPage[8]; + uint8 *_saveLoadPageOvl[8]; uint8 *_screenPalette; uint8 *_palettes[6]; |