diff options
author | Florian Kagerer | 2008-04-12 23:55:26 +0000 |
---|---|---|
committer | Florian Kagerer | 2008-04-12 23:55:26 +0000 |
commit | 7d86690b29b1cbe6a2a6df0e3a9b5b2eb681719a (patch) | |
tree | 67d1d507aa20e1c4dab36a892e83dda37436bfe6 /engines | |
parent | e608c10fbb6454a1ca42f71bbafa4feda814d855 (diff) | |
download | scummvm-rg350-7d86690b29b1cbe6a2a6df0e3a9b5b2eb681719a.tar.gz scummvm-rg350-7d86690b29b1cbe6a2a6df0e3a9b5b2eb681719a.tar.bz2 scummvm-rg350-7d86690b29b1cbe6a2a6df0e3a9b5b2eb681719a.zip |
fix crash and graphic glitch in non-playable HOF demo
svn-id: r31494
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/sequences_v2.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index d717da5c21..d779213a7c 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -2557,12 +2557,10 @@ void KyraEngine_v2::seq_scrollPage() { if (dstH > 0) { for (int i = 0; i < 4; i++) { - int p = _screen->setCurPage(4); const ItemAnimData_v1 *def = &_demoAnimData[i]; ActiveItemAnim *a = &_activeItemAnim[i]; - _screen->drawBox(12, def->y - 8, 28, def->y + 8, 0); - _screen->setCurPage(p); + _screen->fillRect(12, def->y - 8, 28, def->y + 8, 0, 4); _screen->drawShape(4, _defaultShapeTable[def->itemIndex + def->frames[a->currentFrame]], 12, def->y - 8, 0, 0); if(_seqFrameCounter % 2 == 0) a->currentFrame = ++a->currentFrame % 20; @@ -2635,16 +2633,17 @@ void KyraEngine_v2::seq_init() { numShp++; _defaultShapeTable[numShp] = _screen->getPtrToShape(_newShapeFiledata, numShp); } while (_defaultShapeTable[numShp]); + _menu = 0; + } else { + MainMenu::StaticData data = { + { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98] }, + { 0x01, 0x04, 0x0C, 0x04, 0x00, 0xd7, 0xd6, 0x00, 0x01, 0x02, 0x03 }, + { 0xd8, 0xda, 0xd9, 0xd8 }, + 0xd7, 0xd6 + }; + _menu = new MainMenu(this); + _menu->init(data, MainMenu::Animation()); } - - MainMenu::StaticData data = { - { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98] }, - { 0x01, 0x04, 0x0C, 0x04, 0x00, 0xd7, 0xd6, 0x00, 0x01, 0x02, 0x03 }, - { 0xd8, 0xda, 0xd9, 0xd8 }, - 0xd7, 0xd6 - }; - _menu = new MainMenu(this); - _menu->init(data, MainMenu::Animation()); } void KyraEngine_v2::seq_uninit() { @@ -2668,8 +2667,10 @@ void KyraEngine_v2::seq_uninit() { memset(&_defaultShapeTable, 0, sizeof(_defaultShapeTable)); - delete _menu; - _menu = 0; + if (_menu) { + delete _menu; + _menu = 0; + } } #pragma mark - |