From 446822369b671c96185cd721c972537d31aebf6c Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 1 Dec 2011 23:59:15 +0100 Subject: MOHAWK: Implement LB move/moveTo. --- engines/mohawk/livingbooks.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'engines/mohawk/livingbooks.cpp') diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index f2d66ccf03..f0d918129e 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -2659,6 +2659,14 @@ void LBItem::unload() { // FIXME: stuff } +void LBItem::moveBy(const Common::Point &pos) { + _rect.translate(pos.x, pos.y); +} + +void LBItem::moveTo(const Common::Point &pos) { + _rect.moveTo(pos); +} + void LBItem::runScript(uint event, uint16 data, uint16 from) { for (uint i = 0; i < _scriptEntries.size(); i++) { LBScriptEntry *entry = _scriptEntries[i]; @@ -3179,6 +3187,38 @@ void LBGroupItem::stop() { } } +void LBGroupItem::load() { + for (uint i = 0; i < _groupEntries.size(); i++) { + LBItem *item = _vm->getItemById(_groupEntries[i].entryId); + if (item) + item->load(); + } +} + +void LBGroupItem::unload() { + for (uint i = 0; i < _groupEntries.size(); i++) { + LBItem *item = _vm->getItemById(_groupEntries[i].entryId); + if (item) + item->unload(); + } +} + +void LBGroupItem::moveBy(const Common::Point &pos) { + for (uint i = 0; i < _groupEntries.size(); i++) { + LBItem *item = _vm->getItemById(_groupEntries[i].entryId); + if (item) + item->moveBy(pos); + } +} + +void LBGroupItem::moveTo(const Common::Point &pos) { + for (uint i = 0; i < _groupEntries.size(); i++) { + LBItem *item = _vm->getItemById(_groupEntries[i].entryId); + if (item) + item->moveTo(pos); + } +} + LBPaletteItem::LBPaletteItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) { debug(3, "new LBPaletteItem"); -- cgit v1.2.3