diff options
Diffstat (limited to 'engines/mohawk/myst_areas.cpp')
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 009be0feff..5f61201225 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -467,8 +467,6 @@ MystResourceType10::MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableRe _background = 0; _sliderWidth = _rect.right - _rect.left; _sliderHeigth = _rect.bottom - _rect.top; - - warning("TODO: Card contains Type 10 Resource - Function not yet implemented"); } MystResourceType10::~MystResourceType10() { @@ -520,6 +518,10 @@ void MystResourceType10::drawDataToScreen() { memcpy(_background->getBasePtr(0, i), screen->getBasePtr(bb.left, bb.top + i), bb.width() * _background->bytesPerPixel); _vm->_system->unlockScreen(); + } else { + // Restore background + Common::Rect bb = boundingBox(); + _vm->_system->copyRectToScreen((byte *)_background->getBasePtr(0, 0), _background->pitch, bb.left, bb.top, bb.width(), bb.height()); } @@ -532,7 +534,7 @@ void MystResourceType10::handleMouseDown(Common::Point *mouse) { updatePosition(mouse); - MystResourceType8::handleMouseDown(mouse); + MystResourceType11::handleMouseDown(mouse); // Restore background Common::Rect bb = boundingBox(); @@ -545,8 +547,6 @@ void MystResourceType10::handleMouseDown(Common::Point *mouse) { void MystResourceType10::handleMouseUp(Common::Point *mouse) { updatePosition(mouse); - MystResourceType8::handleMouseUp(mouse); - // Restore background Common::Rect bb = boundingBox(); _vm->_system->copyRectToScreen((byte *)_background->getBasePtr(0, 0), _background->pitch, bb.left, bb.top, bb.width(), bb.height()); @@ -571,6 +571,8 @@ void MystResourceType10::handleMouseUp(Common::Point *mouse) { } _vm->_scriptParser->setVarValue(_var8, value); + MystResourceType11::handleMouseUp(mouse); + // No longer in drag mode _vm->_dragResource = 0; } @@ -578,7 +580,7 @@ void MystResourceType10::handleMouseUp(Common::Point *mouse) { void MystResourceType10::handleMouseDrag(Common::Point *mouse) { updatePosition(mouse); - MystResourceType8::handleMouseDrag(mouse); + MystResourceType11::handleMouseDrag(mouse); // Restore background Common::Rect bb = boundingBox(); @@ -695,19 +697,19 @@ MystResourceType11::~MystResourceType11() { void MystResourceType11::handleMouseDown(Common::Point *mouse) { setPositionClipping(mouse, &_pos); - _vm->_scriptParser->runOpcode(_mouseDownOpcode); + _vm->_scriptParser->runOpcode(_mouseDownOpcode, _var8); } void MystResourceType11::handleMouseUp(Common::Point *mouse) { setPositionClipping(mouse, &_pos); - _vm->_scriptParser->runOpcode(_mouseUpOpcode); + _vm->_scriptParser->runOpcode(_mouseUpOpcode, _var8); } void MystResourceType11::handleMouseDrag(Common::Point *mouse) { setPositionClipping(mouse, &_pos); - _vm->_scriptParser->runOpcode(_mouseDragOpcode); + _vm->_scriptParser->runOpcode(_mouseDragOpcode, _var8); } void MystResourceType11::setPositionClipping(Common::Point *mouse, Common::Point *dest) { @@ -719,6 +721,24 @@ void MystResourceType11::setPositionClipping(Common::Point *mouse, Common::Point } } +uint16 MystResourceType11::getList1(uint16 index) { + if (index < _lists[1].listCount) { + return _lists[1].list[index]; + } +} + +uint16 MystResourceType11::getList2(uint16 index) { + if (index < _lists[2].listCount) { + return _lists[2].list[index]; + } +} + +uint16 MystResourceType11::getList3(uint16 index) { + if (index < _lists[3].listCount) { + return _lists[3].list[index]; + } +} + MystResourceType12::MystResourceType12(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) { _numFrames = rlstStream->readUint16LE(); _firstFrame = rlstStream->readUint16LE(); |