diff options
author | Paul Gilbert | 2015-01-28 20:59:36 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-28 20:59:36 -0500 |
commit | 60c462bfdcb9cb342ccb3367b64c599144f70e57 (patch) | |
tree | 69dddd945850d91976ad7b94b3b88d035b3176d5 | |
parent | 1f28332b2053f2dbbe138937f9b0e342774a4cc9 (diff) | |
download | scummvm-rg350-60c462bfdcb9cb342ccb3367b64c599144f70e57.tar.gz scummvm-rg350-60c462bfdcb9cb342ccb3367b64c599144f70e57.tar.bz2 scummvm-rg350-60c462bfdcb9cb342ccb3367b64c599144f70e57.zip |
XEEN: Fixes for tavern options
-rw-r--r-- | engines/xeen/dialogs_yesno.cpp | 10 | ||||
-rw-r--r-- | engines/xeen/dialogs_yesno.h | 4 | ||||
-rw-r--r-- | engines/xeen/interface.h | 1 | ||||
-rw-r--r-- | engines/xeen/scripts.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/town.cpp | 7 | ||||
-rw-r--r-- | engines/xeen/town.h | 2 |
6 files changed, 17 insertions, 9 deletions
diff --git a/engines/xeen/dialogs_yesno.cpp b/engines/xeen/dialogs_yesno.cpp index 1c0c3a7fe2..8ea27ebd6c 100644 --- a/engines/xeen/dialogs_yesno.cpp +++ b/engines/xeen/dialogs_yesno.cpp @@ -33,7 +33,7 @@ bool YesNo::show(XeenEngine *vm, bool type, bool v2) { return result; } -bool YesNo::execute(bool type, int v2) { +bool YesNo::execute(bool type, bool townFlag) { Screen &screen = *_vm->_screen; EventsManager &events = *_vm->_events; Interface &intf = *_vm->_interface; @@ -64,12 +64,12 @@ bool YesNo::execute(bool type, int v2) { while (!_vm->shouldQuit()) { events.updateGameCounter(); - if (intf._townSprites[0].empty()) { + if (town.isActive()) { + town.drawTownAnim(townFlag); + numFrames = 3; + } else { intf.draw3d(true); numFrames = 1; - } else { - town.drawTownAnim(v2); - numFrames = 3; } events.wait(3, true); diff --git a/engines/xeen/dialogs_yesno.h b/engines/xeen/dialogs_yesno.h index d083cd64d4..96c3592d9d 100644 --- a/engines/xeen/dialogs_yesno.h +++ b/engines/xeen/dialogs_yesno.h @@ -33,9 +33,9 @@ private: YesNo(XeenEngine *vm) : ButtonContainer(), _vm(vm) {} - bool execute(bool type, int v2); + bool execute(bool type, bool townFlag); public: - static bool show(XeenEngine *vm, bool type, bool v2); + static bool show(XeenEngine *vm, bool type, bool townFlag = false); }; } // End of namespace Xeen diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 1630e80f69..73cd50977b 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -76,7 +76,6 @@ private: bool checkMoveDirection(int key); public: - SpriteResource _townSprites[8]; int _intrIndex1; Common::String _interfaceText; public: diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 11f88044f5..3ba6329b70 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -1079,7 +1079,7 @@ bool Scripts::ifProc(int action, uint32 mask, int mode, int charIndex) { v = ps._luck._temporary; break; case 44: - v = YesNo::show(_vm, mask, false); + v = YesNo::show(_vm, mask); v = (!v && !mask) ? 2 : mask; break; case 45: diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp index b28300f2a3..303ef50699 100644 --- a/engines/xeen/town.cpp +++ b/engines/xeen/town.cpp @@ -1249,6 +1249,13 @@ void Town::drawTownAnim(bool flag) { screen._windows[3].update(); } +/** + * Returns true if a town location (bank, blacksmith, etc.) is currently active + */ +bool Town::isActive() const { + return _townSprites.size() > 0 && !_townSprites[0].empty(); +} + Character *Town::showItems(Character *c, int v2) { error("TODO: showItems"); } diff --git a/engines/xeen/town.h b/engines/xeen/town.h index af3f4c3a56..f6c67ab102 100644 --- a/engines/xeen/town.h +++ b/engines/xeen/town.h @@ -109,6 +109,8 @@ public: int townAction(int actionId); void drawTownAnim(bool flag); + + bool isActive() const; }; } // End of namespace Xeen |