diff options
author | Paul Gilbert | 2015-07-22 20:26:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-22 20:26:28 -0400 |
commit | 71296d6461bd8346793ff939b5d2e84d22c58dfa (patch) | |
tree | c2615022f05f6b0ffbe4bba30a340eb517ec7fa6 /engines/sherlock/tattoo/tattoo_user_interface.cpp | |
parent | 1a680ddb134a6fe2bb70a07c5bd08d3f833b66e2 (diff) | |
download | scummvm-rg350-71296d6461bd8346793ff939b5d2e84d22c58dfa.tar.gz scummvm-rg350-71296d6461bd8346793ff939b5d2e84d22c58dfa.tar.bz2 scummvm-rg350-71296d6461bd8346793ff939b5d2e84d22c58dfa.zip |
SHERLOCK: RT: Split TattooEngine code into separate widget classes
Diffstat (limited to 'engines/sherlock/tattoo/tattoo_user_interface.cpp')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_user_interface.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index ae09ba5fc7..731c215a27 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -31,7 +31,7 @@ namespace Tattoo { TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm), _inventoryWidget(vm), _messageWidget(vm), _textWidget(vm), _tooltipWidget(vm), _verbsWidget(vm), - _labWidget(vm) { + _labWidget(vm), _creditsWidget(vm) { Common::fill(&_lookupTable[0], &_lookupTable[PALETTE_COUNT], 0); Common::fill(&_lookupTable1[0], &_lookupTable1[PALETTE_COUNT], 0); _scrollSize = 0; @@ -239,8 +239,8 @@ void TattooUserInterface::handleInput() { _keyState.keycode = Common::KEYCODE_INVALID; // Check for credits starting - if (_vm->readFlags(3000) && !vm._creditsActive) - vm.initCredits(); + if (_vm->readFlags(3000) && !_creditsWidget.active()) + _creditsWidget.initCredits(); // Check the mouse positioning if (events.isCursorVisible()) @@ -294,15 +294,14 @@ void TattooUserInterface::handleInput() { void TattooUserInterface::drawInterface(int bufferNum) { Screen &screen = *_vm->_screen; - TattooEngine &vm = *(TattooEngine *)_vm; // Draw any active on-screen widgets for (Common::List<WidgetBase *>::iterator i = _widgets.begin(); i != _widgets.end(); ++i) (*i)->draw(); // Handle drawing credits - if (vm._creditsActive) - vm.drawCredits(); + if (_creditsWidget.active()) + _creditsWidget.drawCredits(); // Bring the widgets to the screen if (_mask != nullptr) @@ -649,7 +648,6 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) { } void TattooUserInterface::doBgAnimEraseBackground() { - TattooEngine &vm = *((TattooEngine *)_vm); People &people = *_vm->_people; Scene &scene = *_vm->_scene; Screen &screen = *_vm->_screen; @@ -714,8 +712,8 @@ void TattooUserInterface::doBgAnimEraseBackground() { } // If credits are active, erase the area they cover - if (vm._creditsActive) - vm.eraseCredits(); + if (_creditsWidget.active()) + _creditsWidget.eraseCredits(); } for (uint idx = 0; idx < scene._bgShapes.size(); ++idx) { |