From e265be07bfb03ee9686ea27b2e12bf4d61ad3732 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sun, 8 Jul 2012 09:54:09 +0200 Subject: MOHAWK: Run animations attached to LiveText items. Should fix bug #3541294. --- engines/mohawk/livingbooks.cpp | 14 +++++++++----- engines/mohawk/livingbooks.h | 3 +++ 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 708478a6d8..f5e5e7d7b4 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -3378,11 +3378,10 @@ void LBLiveTextItem::readData(uint16 type, uint16 size, Common::MemoryReadStream LiveTextWord word; word.bounds = _vm->readRect(stream); word.soundId = stream->readUint16(); - // TODO: unknowns - uint16 unknown1 = stream->readUint16(); - uint16 unknown2 = stream->readUint16(); - debug(4, "Word: (%d, %d) to (%d, %d), sound %d, unknowns %04x, %04x", - word.bounds.left, word.bounds.top, word.bounds.right, word.bounds.bottom, word.soundId, unknown1, unknown2); + word.itemType = stream->readUint16(); + word.itemId = stream->readUint16(); + debug(4, "Word: (%d, %d) to (%d, %d), sound %d, item %d (type %d)", + word.bounds.left, word.bounds.top, word.bounds.right, word.bounds.bottom, word.soundId, word.itemId, word.itemType); _words.push_back(word); } @@ -3531,6 +3530,11 @@ void LBLiveTextItem::handleMouseDown(Common::Point pos) { _currentWord = i; _vm->playSound(this, soundId); paletteUpdate(_currentWord, true); + + // TODO: check this in RE + LBItem *item = _vm->getItemById(_words[i].itemId); + if (item) + item->togglePlaying(false); return; } } diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 91d6a8cd30..76da7d8219 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -537,6 +537,9 @@ protected: struct LiveTextWord { Common::Rect bounds; uint16 soundId; + + uint16 itemType; + uint16 itemId; }; struct LiveTextPhrase { -- cgit v1.2.3