From 71296d6461bd8346793ff939b5d2e84d22c58dfa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Jul 2015 20:26:28 -0400 Subject: SHERLOCK: RT: Split TattooEngine code into separate widget classes --- engines/sherlock/tattoo/tattoo_user_interface.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'engines/sherlock/tattoo/tattoo_user_interface.cpp') 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::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) { -- cgit v1.2.3