diff options
author | Johannes Schickel | 2005-12-10 15:52:38 +0000 |
---|---|---|
committer | Johannes Schickel | 2005-12-10 15:52:38 +0000 |
commit | 7b556aaafe00f294d5c3c042e97ab47d4c6ef661 (patch) | |
tree | aa156c6eaf174da350fb35163bea91d841d22458 /kyra/kyra.cpp | |
parent | fe80cf4f99319322394706d19149e6ce512e13f2 (diff) | |
download | scummvm-rg350-7b556aaafe00f294d5c3c042e97ab47d4c6ef661.tar.gz scummvm-rg350-7b556aaafe00f294d5c3c042e97ab47d4c6ef661.tar.bz2 scummvm-rg350-7b556aaafe00f294d5c3c042e97ab47d4c6ef661.zip |
Implemented cmd_bkgdScrollSceneAndMasksRight.
svn-id: r19772
Diffstat (limited to 'kyra/kyra.cpp')
-rw-r--r-- | kyra/kyra.cpp | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index daa7e28a3d..172c9bd641 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -273,6 +273,7 @@ int KyraEngine::init(GameDetector &detector) { _seq = new SeqPlayer(this, _system); assert(_seq); + _paletteChanged = 1; _currentCharacter = 0; _characterList = new Character[11]; assert(_characterList); @@ -453,13 +454,17 @@ void KyraEngine::startup() { int size = _screen->getRectSize(3, 24); _shapes[365+i] = (byte*)malloc(size); } - _shapes[0] = (byte*)malloc(_screen->getRectSize(3, 24)); + _unkPtr1 = (uint8*)malloc(_screen->getRectSize(1, 144)); + memset(_unkPtr1, 0, _screen->getRectSize(1, 144)); + _unkPtr2 = (uint8*)malloc(_screen->getRectSize(1, 144)); + memset(_unkPtr2, 0, _screen->getRectSize(1, 144)); + _shapes[0] = (uint8*)malloc(_screen->getRectSize(3, 24)); memset(_shapes[0], 0, _screen->getRectSize(3, 24)); - _shapes[1] = (byte*)malloc(_screen->getRectSize(4, 32)); + _shapes[1] = (uint8*)malloc(_screen->getRectSize(4, 32)); memset(_shapes[1], 0, _screen->getRectSize(4, 32)); - _shapes[2] = (byte*)malloc(_screen->getRectSize(8, 69)); + _shapes[2] = (uint8*)malloc(_screen->getRectSize(8, 69)); memset(_shapes[2], 0, _screen->getRectSize(8, 69)); - _shapes[3] = (byte*)malloc(_screen->getRectSize(8, 69)); + _shapes[3] = (uint8*)malloc(_screen->getRectSize(8, 69)); memset(_shapes[3], 0, _screen->getRectSize(8, 69)); for (int i = 0; i < _roomTableSize; ++i) { for (int item = 0; item < 12; ++item) { @@ -3698,6 +3703,51 @@ int KyraEngine::getDrawLayer2(int x, int y, int height) { return layer; } +void KyraEngine::copyBackgroundBlock(int x, int page, int flag) { + debug(9, "copyBackgroundBlock(%d, %d, %d)", x, page, flag); + + if (x < 1) + return; + + int height = 128; + if (flag) + height += 8; + if (!(x & 1)) + ++x; + if (x == 19) + x = 17; + uint8 *ptr1 = _unkPtr1; + uint8 *ptr2 = _unkPtr2; + int oldVideoPage = _screen->_curPage; + _screen->_curPage = page; + + int curX = x; + _screen->hideMouse(); + _screen->copyRegionToBuffer(_screen->_curPage, 8, 8, 8, height, ptr2); + for (int i = 0; i < 19; ++i) { + int tempX = curX + 1; + _screen->copyRegionToBuffer(_screen->_curPage, tempX<<3, 8, 8, height, ptr1); + _screen->copyBlockToPage(_screen->_curPage, tempX<<3, 8, 8, height, ptr2); + int newXPos = curX + x; + if (newXPos > 37) { + newXPos = newXPos % 38; + } + tempX = newXPos + 1; + _screen->copyRegionToBuffer(_screen->_curPage, tempX<<3, 8, 8, height, ptr2); + _screen->copyBlockToPage(_screen->_curPage, tempX<<3, 8, 8, height, ptr1); + curX += x*2; + if (curX > 37) { + curX = curX % 38; + } + } + _screen->showMouse(); + _screen->_curPage = oldVideoPage; +} + +void KyraEngine::copyBackgroundBlock2(int x) { + copyBackgroundBlock(x, 4, 1); +} + #pragma mark - #pragma mark - Pathfinder #pragma mark - |