diff options
author | Paul Gilbert | 2015-01-28 19:22:54 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-28 19:22:54 -0500 |
commit | 5228879a1dfa2684ee71fe0577eb98dbbc92d55a (patch) | |
tree | 9c3c32626f3057b906609383b84faae3863333ab /engines/xeen | |
parent | 8a324eb755cfa07cccfe2c1513522801863643c8 (diff) | |
download | scummvm-rg350-5228879a1dfa2684ee71fe0577eb98dbbc92d55a.tar.gz scummvm-rg350-5228879a1dfa2684ee71fe0577eb98dbbc92d55a.tar.bz2 scummvm-rg350-5228879a1dfa2684ee71fe0577eb98dbbc92d55a.zip |
XEEN: Fix for entering/exiting tavern display
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/scripts.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/town.cpp | 40 | ||||
-rw-r--r-- | engines/xeen/town.h | 2 |
3 files changed, 24 insertions, 22 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index c84ec91d11..11f88044f5 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -158,6 +158,7 @@ bool Scripts::checkEvents() { (_currentPos.x | _currentPos.y) && event._line == _lineNum) { if (event._direction == party._mazeDirection || event._direction == DIR_ALL) { _vm->_mode = MODE_9; + _scriptExecuted = true; doOpcode(event); break; } else { @@ -517,7 +518,8 @@ void Scripts::cmdSpawn(Common::Array<byte> ¶ms) { void Scripts::cmdDoTownEvent(Common::Array<byte> ¶ms) { _scriptResult = _vm->_town->townAction(params[0]); _vm->_party->_stepped = true; - + _refreshIcons = true; + cmdExit(params); } diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp index 328301a73b..a1b09712c5 100644 --- a/engines/xeen/town.cpp +++ b/engines/xeen/town.cpp @@ -32,7 +32,7 @@ Town::Town(XeenEngine *vm) : _vm(vm) { Common::fill(&_arr1[0], &_arr1[6], 0); _townMaxId = 0; _townActionId = 0; - _townCurrent = 0; + _drawFrameIndex = 0; _currentCharLevel = 0; _v1 = 0; _v2 = 0; @@ -77,7 +77,7 @@ int Town::townAction(int actionId) { _townMaxId = TOWN_MAXES[_vm->_files->_isDarkCc][actionId]; _townActionId = actionId; - _townCurrent = 0; + _drawFrameIndex = 0; _v1 = 0; _townPos = Common::Point(8, 8); intf._overallFrame = 0; @@ -217,7 +217,7 @@ int Town::townAction(int actionId) { intf._spotDoorsUIFrame = 0; intf._batUIFrame = 0; - _townSprites[_townCurrent / 8].draw(screen, _townCurrent % 8, _townPos); + _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); if (actionId == 0 && isDarkCc) { _townSprites[4].draw(screen, _vm->getRandomNumber(13, 18), Common::Point(8, 30)); @@ -907,7 +907,7 @@ Character *Town::doTrainingOptions(Character *c) { case Common::KEYCODE_t: if (_nextExperienceLevel) { sound.playSample(nullptr, 0); - _townCurrent = 0; + _drawFrameIndex = 0; Common::String name; if (c->_level._permanent >= _v20) { @@ -921,7 +921,7 @@ Character *Town::doTrainingOptions(Character *c) { } else if (!c->noActions()) { if (subtract(0, (c->_level._permanent * c->_level._permanent) * 10, 0, WT_2)) { - _townCurrent = 0; + _drawFrameIndex = 0; sound.playSample(nullptr, 0); File f(isDarkCc ? "prtygd.voc" : "trainin2.voc"); sound.playSample(&f, 1); @@ -1127,14 +1127,14 @@ void Town::drawTownAnim(bool flag) { if (_townActionId == 1) { if (sound.playSample(1, 0)) { if (isDarkCc) { - _townSprites[_townCurrent / 8].draw(screen, _townCurrent % 8, _townPos); + _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); _townSprites[2].draw(screen, _vm->getRandomNumber(11) == 1 ? 9 : 10, Common::Point(34, 33)); _townSprites[2].draw(screen, _vm->getRandomNumber(5) + 3, Common::Point(34, 54)); } } else { - _townSprites[_townCurrent / 8].draw(screen, _townCurrent % 8, _townPos); + _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); if (isDarkCc) { _townSprites[2].draw(screen, _vm->getRandomNumber(11) == 1 ? 9 : 10, Common::Point(34, 33)); @@ -1142,8 +1142,8 @@ void Town::drawTownAnim(bool flag) { } } else { if (!isDarkCc || _townActionId != 5) { - if (!_townSprites[_townCurrent / 8].empty()) - _townSprites[_townCurrent / 8].draw(screen, _townCurrent % 8, _townPos); + if (!_townSprites[_drawFrameIndex / 8].empty()) + _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); } } @@ -1194,7 +1194,7 @@ void Town::drawTownAnim(bool flag) { case 5: if (sound.playSample(1, 0)) { if (isDarkCc) { - _townSprites[_townCurrent / 8].draw(screen, _townCurrent % 8, _townPos); + _townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos); } } else { if (isDarkCc) { @@ -1219,29 +1219,29 @@ void Town::drawTownAnim(bool flag) { if (screen._windows[11]._enabled) { _drawCtr1 = (_drawCtr1 + 1) % 2; if (!_drawCtr1 || !_drawCtr2) { - _townCurrent = 0; + _drawFrameIndex = 0; _drawCtr2 = 0; } else { - _townCurrent = _vm->getRandomNumber(3); + _drawFrameIndex = _vm->getRandomNumber(3); } } else { - _townCurrent = (_townCurrent + 1) % _townMaxId; + _drawFrameIndex = (_drawFrameIndex + 1) % _townMaxId; } if (isDarkCc) { - if (_townActionId == 1 && (_townCurrent == 4 || _townCurrent == 13)) + if (_townActionId == 1 && (_drawFrameIndex == 4 || _drawFrameIndex == 13)) sound.playFX(45); - if (_townActionId == 5 && _townCurrent == 23) { + if (_townActionId == 5 && _drawFrameIndex == 23) { File f("spit1.voc"); sound.playSample(&f, 0); } } else { - if (_townMaxId == 32 || _townCurrent == 0) - _townCurrent = 17; - if (_townMaxId == 26 || _townCurrent == 0) - _townCurrent = 20; - if (_townActionId == 1 && (_townCurrent == 3 || _townCurrent == 9)) + if (_townMaxId == 32 && _drawFrameIndex == 0) + _drawFrameIndex = 17; + if (_townMaxId == 26 && _drawFrameIndex == 0) + _drawFrameIndex = 20; + if (_townActionId == 1 && (_drawFrameIndex == 3 || _drawFrameIndex == 9)) sound.playFX(45); } diff --git a/engines/xeen/town.h b/engines/xeen/town.h index e28d03cf5c..af3f4c3a56 100644 --- a/engines/xeen/town.h +++ b/engines/xeen/town.h @@ -41,7 +41,6 @@ private: Common::Array<SpriteResource> _townSprites; int _townMaxId; int _townActionId; - int _townCurrent; int _v1, _v2; int _donation; int _healCost; @@ -60,6 +59,7 @@ private: int _currentCharLevel; bool _flag1; uint _nextExperienceLevel; + int _drawFrameIndex; int _drawCtr1, _drawCtr2; void loadStrings(const Common::String &name); |