diff options
author | Bastien Bouclet | 2016-02-06 13:54:02 +0100 |
---|---|---|
committer | Bastien Bouclet | 2016-02-07 15:27:03 +0100 |
commit | cddb5cd53a8fb5bb64c15a02950b05f5898f7e34 (patch) | |
tree | dfe77ab01f1c0a5a66dd5f9f4bfb49312d71ceff | |
parent | 085f3700f7cd6ddb23abe3719ca21b7025695da4 (diff) | |
download | scummvm-rg350-cddb5cd53a8fb5bb64c15a02950b05f5898f7e34.tar.gz scummvm-rg350-cddb5cd53a8fb5bb64c15a02950b05f5898f7e34.tar.bz2 scummvm-rg350-cddb5cd53a8fb5bb64c15a02950b05f5898f7e34.zip |
MOHAWK: Rename Myst's Area classes
-rw-r--r-- | engines/mohawk/myst.cpp | 50 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 20 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 206 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.h | 109 | ||||
-rw-r--r-- | engines/mohawk/myst_scripts.cpp | 12 | ||||
-rw-r--r-- | engines/mohawk/myst_scripts.h | 8 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.cpp | 34 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/intro.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/intro.h | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.cpp | 48 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.h | 10 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/myst.cpp | 108 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/myst.h | 40 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/preview.cpp | 6 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/preview.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.cpp | 64 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.h | 48 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/stoneship.cpp | 34 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/stoneship.h | 8 |
20 files changed, 414 insertions, 401 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 8df6b01507..3b132cf97f 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -674,8 +674,8 @@ void MohawkEngine_Myst::checkCurrentResource() { for (uint16 i = 0; i < _resources.size(); i++) if (_resources[i]->contains(mouse)) { - if (_hoverResource != _resources[i] && _resources[i]->type == kMystHoverArea) { - _hoverResource = static_cast<MystResourceType13 *>(_resources[i]); + if (_hoverResource != _resources[i] && _resources[i]->type == kMystAreaHover) { + _hoverResource = static_cast<MystAreaHover *>(_resources[i]); _hoverResource->handleMouseEnter(); } @@ -692,7 +692,7 @@ void MohawkEngine_Myst::checkCurrentResource() { checkCursorHints(); } -MystResource *MohawkEngine_Myst::updateCurrentResource() { +MystArea *MohawkEngine_Myst::updateCurrentResource() { checkCurrentResource(); if (_curResource >= 0) @@ -1074,50 +1074,50 @@ void MohawkEngine_Myst::drawResourceImages() { _resources[i]->drawDataToScreen(); } -void MohawkEngine_Myst::redrawResource(MystResourceType8 *resource, bool update) { - resource->drawConditionalDataToScreen(_scriptParser->getVar(resource->getType8Var()), update); +void MohawkEngine_Myst::redrawResource(MystAreaImageSwitch *resource, bool update) { + resource->drawConditionalDataToScreen(_scriptParser->getVar(resource->getImageSwitchVar()), update); } void MohawkEngine_Myst::redrawArea(uint16 var, bool update) { for (uint16 i = 0; i < _resources.size(); i++) - if (_resources[i]->type == kMystConditionalImage && _resources[i]->getType8Var() == var) - redrawResource(static_cast<MystResourceType8 *>(_resources[i]), update); + if (_resources[i]->type == kMystAreaImageSwitch && _resources[i]->getImageSwitchVar() == var) + redrawResource(static_cast<MystAreaImageSwitch *>(_resources[i]), update); } -MystResource *MohawkEngine_Myst::loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent) { - MystResource *resource = nullptr; +MystArea *MohawkEngine_Myst::loadResource(Common::SeekableReadStream *rlstStream, MystArea *parent) { + MystArea *resource = nullptr; ResourceType type = static_cast<ResourceType>(rlstStream->readUint16LE()); debugC(kDebugResource, "\tType: %d", type); debugC(kDebugResource, "\tSub_Record: %d", (parent == nullptr) ? 0 : 1); switch (type) { - case kMystAction: - resource = new MystResourceType5(this, rlstStream, parent); + case kMystAreaAction: + resource = new MystAreaAction(this, rlstStream, parent); break; - case kMystVideo: - resource = new MystResourceType6(this, rlstStream, parent); + case kMystAreaVideo: + resource = new MystAreaVideo(this, rlstStream, parent); break; - case kMystSwitch: - resource = new MystResourceType7(this, rlstStream, parent); + case kMystAreaActionSwitch: + resource = new MystAreaActionSwitch(this, rlstStream, parent); break; - case kMystConditionalImage: - resource = new MystResourceType8(this, rlstStream, parent); + case kMystAreaImageSwitch: + resource = new MystAreaImageSwitch(this, rlstStream, parent); break; - case kMystSlider: - resource = new MystResourceType10(this, rlstStream, parent); + case kMystAreaSlider: + resource = new MystAreaSlider(this, rlstStream, parent); break; - case kMystDragArea: - resource = new MystResourceType11(this, rlstStream, parent); + case kMystAreaDrag: + resource = new MystAreaDrag(this, rlstStream, parent); break; case kMystVideoInfo: - resource = new MystResourceType12(this, rlstStream, parent); + resource = new MystVideoInfo(this, rlstStream, parent); break; - case kMystHoverArea: - resource = new MystResourceType13(this, rlstStream, parent); + case kMystAreaHover: + resource = new MystAreaHover(this, rlstStream, parent); break; default: - resource = new MystResource(this, rlstStream, parent); + resource = new MystArea(this, rlstStream, parent); break; } diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 0e0755bcca..1cf5858b0a 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -41,9 +41,9 @@ class MystScriptParser; class MystConsole; class MystGameState; class MystOptionsDialog; -class MystResource; -class MystResourceType8; -class MystResourceType13; +class MystArea; +class MystAreaImageSwitch; +class MystAreaHover; // Engine Debug Flags enum { @@ -175,7 +175,7 @@ public: void setMainCursor(uint16 cursor); uint16 getMainCursor() { return _mainCursor; } void checkCursorHints(); - MystResource *updateCurrentResource(); + MystArea *updateCurrentResource(); bool skippableWait(uint32 duration); bool _tweaksEnabled; @@ -184,18 +184,16 @@ public: bool _needsShowMap; bool _needsShowDemoMenu; - MystView _view; MystGraphics *_gfx; MystGameState *_gameState; MystScriptParser *_scriptParser; - Common::Array<MystResource *> _resources; + Common::Array<MystArea *> _resources; Common::RandomSource *_rnd; - bool _showResourceRects; - MystResource *loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent); + MystArea *loadResource(Common::SeekableReadStream *rlstStream, MystArea *parent); void setResourceEnabled(uint16 resourceId, bool enable); void redrawArea(uint16 var, bool update = true); - void redrawResource(MystResourceType8 *resource, bool update = true); + void redrawResource(MystAreaImageSwitch *resource, bool update = true); void drawResourceImages(); void drawCardBackground(); uint16 getCardBackgroundId(); @@ -221,7 +219,9 @@ private: uint16 _curStack; uint16 _curCard; + MystView _view; + bool _showResourceRects; bool _runExitScript; void dropPage(); @@ -237,7 +237,7 @@ private: void drawResourceRects(); void checkCurrentResource(); int16 _curResource; - MystResourceType13 *_hoverResource; + MystAreaHover *_hoverResource; uint16 _cursorHintCount; MystCursorHint *_cursorHints; diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 45840bc4ed..298fc56cdb 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -32,7 +32,7 @@ namespace Mohawk { -MystResource::MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) { +MystArea::MystArea(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) { _vm = vm; _parent = parent; @@ -66,10 +66,10 @@ MystResource::MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rl debugC(kDebugResource, "\tdest: %d", _dest); } -MystResource::~MystResource() { +MystArea::~MystArea() { } -void MystResource::handleMouseUp() { +void MystArea::handleMouseUp() { if (_dest == 0) { warning("Movement type resource with null destination at position (%d, %d), (%d, %d)", _rect.left, _rect.top, _rect.right, _rect.bottom); return; @@ -78,13 +78,13 @@ void MystResource::handleMouseUp() { uint16 opcode; switch (type) { - case kMystForwardArea: + case kMystAreaForward: opcode = 6; break; - case kMystLeftArea: + case kMystAreaLeft: opcode = 8; break; - case kMystRightArea: + case kMystAreaRight: opcode = 7; break; default: @@ -96,27 +96,27 @@ void MystResource::handleMouseUp() { _vm->_scriptParser->runOpcode(opcode, 0); } -bool MystResource::canBecomeActive() { +bool MystArea::canBecomeActive() { return !unreachableZipDest() && (isEnabled() || (_flags & kMystUnknownFlag)); } -bool MystResource::unreachableZipDest() { +bool MystArea::unreachableZipDest() { return (_flags & kMystZipModeEnableFlag) && !_vm->_gameState->isReachableZipDest(_vm->getCurStack() , _dest); } -bool MystResource::isEnabled() { +bool MystArea::isEnabled() { return _flags & kMystHotspotEnableFlag; } -void MystResource::setEnabled(bool enabled) { +void MystArea::setEnabled(bool enabled) { if (enabled) _flags |= kMystHotspotEnableFlag; else _flags &= ~kMystHotspotEnableFlag; } -const Common::String MystResource::describe() { +const Common::String MystArea::describe() { Common::String desc = Common::String::format("type: %2d rect: (%3d %3d %3d %3d)", type, _rect.left, _rect.top, _rect.width(), _rect.height()); @@ -126,7 +126,7 @@ const Common::String MystResource::describe() { return desc; } -void MystResource::drawBoundingRect() { +void MystArea::drawBoundingRect() { if (_rect.isValidRect()) { if (!canBecomeActive()) _vm->_gfx->drawRect(_rect, kRectUnreachable); @@ -137,18 +137,19 @@ void MystResource::drawBoundingRect() { } } -MystResourceType5::MystResourceType5(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResource(vm, rlstStream, parent) { +MystAreaAction::MystAreaAction(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystArea(vm, rlstStream, parent) { debugC(kDebugResource, "\tResource Type 5 Script:"); _script = vm->_scriptParser->readScript(rlstStream, kMystScriptNormal); } -void MystResourceType5::handleMouseUp() { +void MystAreaAction::handleMouseUp() { _vm->_scriptParser->runScript(_script, this); } -const Common::String MystResourceType5::describe() { - Common::String desc = MystResource::describe(); +const Common::String MystAreaAction::describe() { + Common::String desc = MystArea::describe(); if (_script->size() != 0) { desc += " ops:"; @@ -161,7 +162,7 @@ const Common::String MystResourceType5::describe() { } // In Myst/Making of Myst, the paths are hardcoded ala Windows style without extension. Convert them. -Common::String MystResourceType6::convertMystVideoName(Common::String name) { +Common::String MystAreaVideo::convertMystVideoName(Common::String name) { Common::String temp; for (uint32 i = 1; i < name.size(); i++) { @@ -174,7 +175,8 @@ Common::String MystResourceType6::convertMystVideoName(Common::String name) { return temp + ".mov"; } -MystResourceType6::MystResourceType6(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType5(vm, rlstStream, parent) { +MystAreaVideo::MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystAreaAction(vm, rlstStream, parent) { char c = 0; do { @@ -218,7 +220,7 @@ MystResourceType6::MystResourceType6(MohawkEngine_Myst *vm, Common::SeekableRead debugC(kDebugResource, "\tu3: %d", _u3); } -VideoHandle MystResourceType6::playMovie() { +VideoHandle MystAreaVideo::playMovie() { // Check if the video is already running VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); @@ -248,33 +250,34 @@ VideoHandle MystResourceType6::playMovie() { return handle; } -void MystResourceType6::handleCardChange() { +void MystAreaVideo::handleCardChange() { if (_playOnCardChange) playMovie(); } -bool MystResourceType6::isPlaying() { +bool MystAreaVideo::isPlaying() { VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); return handle && !handle->endOfVideo(); } -void MystResourceType6::pauseMovie(bool pause) { +void MystAreaVideo::pauseMovie(bool pause) { VideoHandle handle = _vm->_video->findVideoHandle(_videoFile); if (handle && !handle->endOfVideo()) handle->pause(pause); } -MystResourceType7::MystResourceType7(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResource(vm, rlstStream, parent) { - _var7 = rlstStream->readUint16LE(); +MystAreaActionSwitch::MystAreaActionSwitch(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystArea(vm, rlstStream, parent) { + _actionSwitchVar = rlstStream->readUint16LE(); _numSubResources = rlstStream->readUint16LE(); - debugC(kDebugResource, "\tvar7: %d", _var7); + debugC(kDebugResource, "\tvar7: %d", _actionSwitchVar); debugC(kDebugResource, "\tnumSubResources: %d", _numSubResources); for (uint16 i = 0; i < _numSubResources; i++) _subResources.push_back(vm->loadResource(rlstStream, this)); } -MystResourceType7::~MystResourceType7() { +MystAreaActionSwitch::~MystAreaActionSwitch() { for (uint32 i = 0; i < _subResources.size(); i++) delete _subResources[i]; @@ -283,14 +286,14 @@ MystResourceType7::~MystResourceType7() { // TODO: All these functions to switch subresource are very similar. // Find way to share code (function pointer pass?) -void MystResourceType7::drawDataToScreen() { - if (_var7 == 0xFFFF) { +void MystAreaActionSwitch::drawDataToScreen() { + if (_actionSwitchVar == 0xFFFF) { if (_numSubResources == 1) _subResources[0]->drawDataToScreen(); else if (_numSubResources != 0) warning("Type 7 Resource with _numSubResources of %d, but no control variable", _numSubResources); } else { - uint16 varValue = _vm->_scriptParser->getVar(_var7); + uint16 varValue = _vm->_scriptParser->getVar(_actionSwitchVar); if (_numSubResources == 1 && varValue != 0) _subResources[0]->drawDataToScreen(); @@ -298,19 +301,19 @@ void MystResourceType7::drawDataToScreen() { if (varValue < _numSubResources) _subResources[varValue]->drawDataToScreen(); else - warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _var7, varValue, _numSubResources); + warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _actionSwitchVar, varValue, _numSubResources); } } } -void MystResourceType7::handleCardChange() { - if (_var7 == 0xFFFF) { +void MystAreaActionSwitch::handleCardChange() { + if (_actionSwitchVar == 0xFFFF) { if (_numSubResources == 1) _subResources[0]->handleCardChange(); else if (_numSubResources != 0) warning("Type 7 Resource with _numSubResources of %d, but no control variable", _numSubResources); } else { - uint16 varValue = _vm->_scriptParser->getVar(_var7); + uint16 varValue = _vm->_scriptParser->getVar(_actionSwitchVar); if (_numSubResources == 1 && varValue != 0) _subResources[0]->handleCardChange(); @@ -318,19 +321,19 @@ void MystResourceType7::handleCardChange() { if (varValue < _numSubResources) _subResources[varValue]->handleCardChange(); else - warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _var7, varValue, _numSubResources); + warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _actionSwitchVar, varValue, _numSubResources); } } } -void MystResourceType7::handleMouseUp() { - if (_var7 == 0xFFFF) { +void MystAreaActionSwitch::handleMouseUp() { + if (_actionSwitchVar == 0xFFFF) { if (_numSubResources == 1) _subResources[0]->handleMouseUp(); else if (_numSubResources != 0) warning("Type 7 Resource with _numSubResources of %d, but no control variable", _numSubResources); } else { - uint16 varValue = _vm->_scriptParser->getVar(_var7); + uint16 varValue = _vm->_scriptParser->getVar(_actionSwitchVar); if (_numSubResources == 1 && varValue != 0) _subResources[0]->handleMouseUp(); @@ -338,19 +341,19 @@ void MystResourceType7::handleMouseUp() { if (varValue < _numSubResources) _subResources[varValue]->handleMouseUp(); else - warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _var7, varValue, _numSubResources); + warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _actionSwitchVar, varValue, _numSubResources); } } } -void MystResourceType7::handleMouseDown() { - if (_var7 == 0xFFFF) { +void MystAreaActionSwitch::handleMouseDown() { + if (_actionSwitchVar == 0xFFFF) { if (_numSubResources == 1) _subResources[0]->handleMouseDown(); else if (_numSubResources != 0) warning("Type 7 Resource with _numSubResources of %d, but no control variable", _numSubResources); } else { - uint16 varValue = _vm->_scriptParser->getVar(_var7); + uint16 varValue = _vm->_scriptParser->getVar(_actionSwitchVar); if (_numSubResources == 1 && varValue != 0) _subResources[0]->handleMouseDown(); @@ -358,15 +361,16 @@ void MystResourceType7::handleMouseDown() { if (varValue < _numSubResources) _subResources[varValue]->handleMouseDown(); else - warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _var7, varValue, _numSubResources); + warning("Type 7 Resource Var %d: %d exceeds number of sub resources %d", _actionSwitchVar, varValue, _numSubResources); } } } -MystResourceType8::MystResourceType8(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType7(vm, rlstStream, parent) { - _var8 = rlstStream->readUint16LE(); +MystAreaImageSwitch::MystAreaImageSwitch(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystAreaActionSwitch(vm, rlstStream, parent) { + _imageSwitchVar = rlstStream->readUint16LE(); _numSubImages = rlstStream->readUint16LE(); - debugC(kDebugResource, "\tvar8: %d", _var8); + debugC(kDebugResource, "\tvar8: %d", _imageSwitchVar); debugC(kDebugResource, "\tnumSubImages: %d", _numSubImages); for (uint16 i = 0; i < _numSubImages; i++) { @@ -399,25 +403,25 @@ MystResourceType8::MystResourceType8(MohawkEngine_Myst *vm, Common::SeekableRead } } -MystResourceType8::~MystResourceType8() { +MystAreaImageSwitch::~MystAreaImageSwitch() { } -void MystResourceType8::drawDataToScreen() { +void MystAreaImageSwitch::drawDataToScreen() { // Need to call overidden Type 7 function to ensure // switch section is processed correctly. - MystResourceType7::drawDataToScreen(); + MystAreaActionSwitch::drawDataToScreen(); bool drawSubImage = false; int16 subImageId = 0; - if (_var8 == 0xFFFF) { + if (_imageSwitchVar == 0xFFFF) { if (_numSubImages == 1) { subImageId = 0; drawSubImage = true; } else if (_numSubImages != 0) warning("Type 8 Resource with _numSubImages of %d, but no control variable", _numSubImages); } else { - uint16 varValue = _vm->_scriptParser->getVar(_var8); + uint16 varValue = _vm->_scriptParser->getVar(_imageSwitchVar); if (_numSubImages == 1 && varValue != 0) { subImageId = 0; @@ -427,7 +431,7 @@ void MystResourceType8::drawDataToScreen() { subImageId = varValue; drawSubImage = true; } else - warning("Type 8 Image Var %d: %d exceeds number of subImages %d", _var8, varValue, _numSubImages); + warning("Type 8 Image Var %d: %d exceeds number of subImages %d", _imageSwitchVar, varValue, _numSubImages); } } @@ -442,7 +446,7 @@ void MystResourceType8::drawDataToScreen() { } } -void MystResourceType8::drawConditionalDataToScreen(uint16 state, bool update) { +void MystAreaImageSwitch::drawConditionalDataToScreen(uint16 state, bool update) { bool drawSubImage = false; int16 subImageId = 0; @@ -455,7 +459,7 @@ void MystResourceType8::drawConditionalDataToScreen(uint16 state, bool update) { subImageId = state; drawSubImage = true; } else - warning("Type 8 Image Var %d: %d exceeds number of subImages %d", _var8, state, _numSubImages); + warning("Type 8 Image Var %d: %d exceeds number of subImages %d", _imageSwitchVar, state, _numSubImages); } @@ -476,21 +480,21 @@ void MystResourceType8::drawConditionalDataToScreen(uint16 state, bool update) { } } -uint16 MystResourceType8::getType8Var() { - return _var8; +uint16 MystAreaImageSwitch::getImageSwitchVar() { + return _imageSwitchVar; } -MystResourceType8::SubImage MystResourceType8::getSubImage(uint index) const { +MystAreaImageSwitch::SubImage MystAreaImageSwitch::getSubImage(uint index) const { return _subImages[index]; } -void MystResourceType8::setSubImageRect(uint index, const Common::Rect &rect) { +void MystAreaImageSwitch::setSubImageRect(uint index, const Common::Rect &rect) { _subImages[index].rect = rect; } -const Common::String MystResourceType8::describe() { +const Common::String MystAreaImageSwitch::describe() { Common::String desc = Common::String::format("%s var: %2d", - MystResourceType7::describe().c_str(), _var8); + MystAreaActionSwitch::describe().c_str(), _imageSwitchVar); if (_numSubImages > 0) { desc += " subImgs:"; @@ -504,7 +508,8 @@ const Common::String MystResourceType8::describe() { // No MystResourceType9! -MystResourceType10::MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) { +MystAreaSlider::MystAreaSlider(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystAreaDrag(vm, rlstStream, parent) { _dragSound = rlstStream->readUint16LE(); debugC(kDebugResource, "\tdrag sound : %d", _dragSound); @@ -513,23 +518,23 @@ MystResourceType10::MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableRe _sliderHeight = _rect.bottom - _rect.top; } -MystResourceType10::~MystResourceType10() { +MystAreaSlider::~MystAreaSlider() { } -void MystResourceType10::setStep(uint16 step) { +void MystAreaSlider::setStep(uint16 step) { _rect.top = _minV + _stepV * step - _sliderHeight / 2; _rect.bottom = _rect.top + _sliderHeight; _subImages[0].rect.top = 333 - _rect.bottom - 1; _subImages[0].rect.bottom = 333 - _rect.top - 1; } -void MystResourceType10::setPosition(uint16 pos) { +void MystAreaSlider::setPosition(uint16 pos) { Common::Point mouse; mouse.y = pos; updatePosition(mouse); } -Common::Rect MystResourceType10::boundingBox() { +Common::Rect MystAreaSlider::boundingBox() { Common::Rect bb; bb.top = _rect.top; @@ -552,7 +557,7 @@ Common::Rect MystResourceType10::boundingBox() { return bb; } -void MystResourceType10::restoreBackground() { +void MystAreaSlider::restoreBackground() { // Restore background Common::Rect src = boundingBox(); Common::Rect dest = boundingBox(); @@ -561,11 +566,11 @@ void MystResourceType10::restoreBackground() { _vm->_gfx->copyImageSectionToScreen(_vm->getCardBackgroundId(), src, dest); } -void MystResourceType10::handleMouseDown() { +void MystAreaSlider::handleMouseDown() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); updatePosition(mouse); - MystResourceType11::handleMouseDown(); + MystAreaDrag::handleMouseDown(); // Restore background restoreBackground(); @@ -574,7 +579,7 @@ void MystResourceType10::handleMouseDown() { drawConditionalDataToScreen(2); } -void MystResourceType10::handleMouseUp() { +void MystAreaSlider::handleMouseUp() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); updatePosition(mouse); @@ -598,16 +603,16 @@ void MystResourceType10::handleMouseUp() { value = _pos.x; } - _vm->_scriptParser->setVarValue(_var8, value); + _vm->_scriptParser->setVarValue(_imageSwitchVar, value); - MystResourceType11::handleMouseUp(); + MystAreaDrag::handleMouseUp(); } -void MystResourceType10::handleMouseDrag() { +void MystAreaSlider::handleMouseDrag() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); updatePosition(mouse); - MystResourceType11::handleMouseDrag(); + MystAreaDrag::handleMouseDrag(); // Restore background restoreBackground(); @@ -616,7 +621,7 @@ void MystResourceType10::handleMouseDrag() { drawConditionalDataToScreen(2); } -void MystResourceType10::updatePosition(const Common::Point &mouse) { +void MystAreaSlider::updatePosition(const Common::Point &mouse) { bool positionChanged = false; Common::Point mouseClipped; @@ -669,7 +674,8 @@ void MystResourceType10::updatePosition(const Common::Point &mouse) { _vm->_sound->replaceSoundMyst(_dragSound); } -MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType8(vm, rlstStream, parent) { +MystAreaDrag::MystAreaDrag(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystAreaImageSwitch(vm, rlstStream, parent) { _flagHV = rlstStream->readUint16LE(); _minH = rlstStream->readUint16LE(); _maxH = rlstStream->readUint16LE(); @@ -719,44 +725,44 @@ MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableRe _stepV = (_maxV - _minV) / (_stepsV - 1); } -MystResourceType11::~MystResourceType11() { +MystAreaDrag::~MystAreaDrag() { for (byte i = 0; i < 3; i++) delete[] _lists[i].list; } -void MystResourceType11::handleMouseDown() { +void MystAreaDrag::handleMouseDown() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); setPositionClipping(mouse, _pos); _vm->_scriptParser->setInvokingResource(this); - _vm->_scriptParser->runOpcode(_mouseDownOpcode, _var8); + _vm->_scriptParser->runOpcode(_mouseDownOpcode, _imageSwitchVar); } -void MystResourceType11::handleMouseUp() { +void MystAreaDrag::handleMouseUp() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); setPositionClipping(mouse, _pos); _vm->_scriptParser->setInvokingResource(this); - _vm->_scriptParser->runOpcode(_mouseUpOpcode, _var8); + _vm->_scriptParser->runOpcode(_mouseUpOpcode, _imageSwitchVar); } -void MystResourceType11::handleMouseDrag() { +void MystAreaDrag::handleMouseDrag() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); setPositionClipping(mouse, _pos); _vm->_scriptParser->setInvokingResource(this); - _vm->_scriptParser->runOpcode(_mouseDragOpcode, _var8); + _vm->_scriptParser->runOpcode(_mouseDragOpcode, _imageSwitchVar); } -const Common::String MystResourceType11::describe() { +const Common::String MystAreaDrag::describe() { return Common::String::format("%s down: %s drag: %s up: %s", - MystResourceType8::describe().c_str(), + MystAreaImageSwitch::describe().c_str(), _vm->_scriptParser->getOpcodeDesc(_mouseDownOpcode).c_str(), _vm->_scriptParser->getOpcodeDesc(_mouseDragOpcode).c_str(), _vm->_scriptParser->getOpcodeDesc(_mouseUpOpcode).c_str()); } -void MystResourceType11::setPositionClipping(const Common::Point &mouse, Common::Point &dest) { +void MystAreaDrag::setPositionClipping(const Common::Point &mouse, Common::Point &dest) { if (_flagHV & 2) dest.y = CLIP<uint16>(mouse.y, _minV, _maxV); @@ -764,19 +770,20 @@ void MystResourceType11::setPositionClipping(const Common::Point &mouse, Common: dest.x = CLIP<uint16>(mouse.x, _minH, _maxH); } -uint16 MystResourceType11::getList1(uint16 index) { +uint16 MystAreaDrag::getList1(uint16 index) { return (index < _lists[0].listCount) ? _lists[0].list[index] : 0; } -uint16 MystResourceType11::getList2(uint16 index) { +uint16 MystAreaDrag::getList2(uint16 index) { return (index < _lists[1].listCount) ? _lists[1].list[index] : 0; } -uint16 MystResourceType11::getList3(uint16 index) { +uint16 MystAreaDrag::getList3(uint16 index) { return (index < _lists[2].listCount) ? _lists[2].list[index] : 0; } -MystResourceType12::MystResourceType12(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) { +MystVideoInfo::MystVideoInfo(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystAreaDrag(vm, rlstStream, parent) { _numFrames = rlstStream->readUint16LE(); _firstFrame = rlstStream->readUint16LE(); uint16 frameWidth = rlstStream->readUint16LE(); @@ -797,16 +804,16 @@ MystResourceType12::MystResourceType12(MohawkEngine_Myst *vm, Common::SeekableRe debugC(kDebugResource, "\t_frameRect.bottom: %d", _frameRect.bottom); } -MystResourceType12::~MystResourceType12() { +MystVideoInfo::~MystVideoInfo() { } -void MystResourceType12::drawFrame(uint16 frame) { +void MystVideoInfo::drawFrame(uint16 frame) { _currentFrame = _firstFrame + frame; _vm->_gfx->copyImageToScreen(_currentFrame, _frameRect); _vm->_system->updateScreen(); } -bool MystResourceType12::pullLeverV() { +bool MystVideoInfo::pullLeverV() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); // Make the handle follow the mouse @@ -822,7 +829,7 @@ bool MystResourceType12::pullLeverV() { return step == maxStep; } -void MystResourceType12::releaseLeverV() { +void MystVideoInfo::releaseLeverV() { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); // Get current lever frame @@ -838,7 +845,8 @@ void MystResourceType12::releaseLeverV() { } } -MystResourceType13::MystResourceType13(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResource(vm, rlstStream, parent) { +MystAreaHover::MystAreaHover(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent) : + MystArea(vm, rlstStream, parent) { _enterOpcode = rlstStream->readUint16LE(); _leaveOpcode = rlstStream->readUint16LE(); @@ -846,27 +854,27 @@ MystResourceType13::MystResourceType13(MohawkEngine_Myst *vm, Common::SeekableRe debugC(kDebugResource, "\t_leaveOpcode: %d", _leaveOpcode); } -void MystResourceType13::handleMouseEnter() { +void MystAreaHover::handleMouseEnter() { // Pass along the enter opcode to the script parser // The variable to use is stored in the dest field _vm->_scriptParser->runOpcode(_enterOpcode, _dest); } -void MystResourceType13::handleMouseLeave() { +void MystAreaHover::handleMouseLeave() { // Pass along the leave opcode (with no parameters) to the script parser // The variable to use is stored in the dest field _vm->_scriptParser->runOpcode(_leaveOpcode, _dest); } -void MystResourceType13::handleMouseUp() { +void MystAreaHover::handleMouseUp() { // Type 13 Resources do nothing on Mouse Clicks. // This is required to override the inherited default - // i.e. MystResource::handleMouseUp + // i.e. MystArea::handleMouseUp } -const Common::String MystResourceType13::describe() { +const Common::String MystAreaHover::describe() { return Common::String::format("%s enter: %s leave: %s", - MystResource::describe().c_str(), + MystArea::describe().c_str(), _vm->_scriptParser->getOpcodeDesc(_enterOpcode).c_str(), _vm->_scriptParser->getOpcodeDesc(_leaveOpcode).c_str()); } diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index 881edf28d4..2b16b6e502 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -32,19 +32,19 @@ namespace Mohawk { // Myst Resource Types enum ResourceType { - kMystForwardArea = 0, - kMystLeftArea = 1, - kMystRightArea = 2, - kMystDownArea = 3, - kMystUpArea = 4, - kMystAction = 5, - kMystVideo = 6, - kMystSwitch = 7, - kMystConditionalImage = 8, - kMystSlider = 10, - kMystDragArea = 11, + kMystAreaForward = 0, + kMystAreaLeft = 1, + kMystAreaRight = 2, + kMystAreaDown = 3, + kMystAreaUp = 4, + kMystAreaAction = 5, + kMystAreaVideo = 6, + kMystAreaActionSwitch = 7, + kMystAreaImageSwitch = 8, + kMystAreaSlider = 10, + kMystAreaDrag = 11, kMystVideoInfo = 12, - kMystHoverArea = 13 + kMystAreaHover = 13 }; // Myst Resource Flags @@ -56,16 +56,14 @@ enum { kMystZipModeEnableFlag = (1 << 3) }; -class MystResource { +class MystArea { public: - MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResource(); + MystArea(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystArea(); + virtual const Common::String describe(); void drawBoundingRect(); - MystResource *_parent; - ResourceType type; - bool contains(Common::Point point) { return _rect.contains(point); } virtual void drawDataToScreen() {} virtual void handleCardChange() {} @@ -75,7 +73,7 @@ public: void setEnabled(bool enabled); bool isDrawSubimages() { return _flags & kMystSubimageEnableFlag; } uint16 getDest() { return _dest; } - virtual uint16 getType8Var() { return 0xFFFF; } + virtual uint16 getImageSwitchVar() { return 0xFFFF; } bool unreachableZipDest(); bool canBecomeActive(); @@ -84,6 +82,8 @@ public: virtual void handleMouseDown() {} virtual void handleMouseDrag() {} + MystArea *_parent; + ResourceType type; protected: MohawkEngine_Myst *_vm; @@ -92,9 +92,10 @@ protected: uint16 _dest; }; -class MystResourceType5 : public MystResource { +class MystAreaAction : public MystArea { public: - MystResourceType5(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); + MystAreaAction(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + void handleMouseUp() override; const Common::String describe() override; @@ -102,9 +103,10 @@ protected: MystScript _script; }; -class MystResourceType6 : public MystResourceType5 { +class MystAreaVideo : public MystAreaAction { public: - MystResourceType6(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); + MystAreaVideo(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + VideoHandle playMovie(); void handleCardChange() override; bool isPlaying(); @@ -114,6 +116,7 @@ public: protected: static Common::String convertMystVideoName(Common::String name); + Common::String _videoFile; int16 _left; int16 _top; @@ -124,10 +127,10 @@ protected: uint16 _u3; }; -class MystResourceType7 : public MystResource { +class MystAreaActionSwitch : public MystArea { public: - MystResourceType7(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResourceType7(); + MystAreaActionSwitch(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystAreaActionSwitch(); virtual void drawDataToScreen() override; virtual void handleCardChange() override; @@ -135,17 +138,17 @@ public: virtual void handleMouseUp() override; virtual void handleMouseDown() override; - MystResource *getSubResource(uint16 index) { return _subResources[index]; } + MystArea *getSubResource(uint16 index) { return _subResources[index]; } protected: - uint16 _var7; + uint16 _actionSwitchVar; uint16 _numSubResources; - Common::Array<MystResource *> _subResources; + Common::Array<MystArea *> _subResources; }; -class MystResourceType8 : public MystResourceType7 { +class MystAreaImageSwitch : public MystAreaActionSwitch { public: - MystResourceType8(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResourceType8(); + MystAreaImageSwitch(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystAreaImageSwitch(); struct SubImage { uint16 wdib; @@ -155,23 +158,22 @@ public: virtual const Common::String describe() override; virtual void drawDataToScreen() override; void drawConditionalDataToScreen(uint16 state, bool update = true); - uint16 getType8Var() override; + uint16 getImageSwitchVar() override; SubImage getSubImage(uint index) const; void setSubImageRect(uint index, const Common::Rect &rect); protected: - uint16 _var8; + uint16 _imageSwitchVar; uint16 _numSubImages; Common::Array<SubImage> _subImages; }; -// No MystResourceType9! - -class MystResourceType11 : public MystResourceType8 { +class MystAreaDrag : public MystAreaImageSwitch { public: - MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResourceType11(); + MystAreaDrag(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystAreaDrag(); + const Common::String describe() override; virtual void handleMouseDown() override; @@ -187,6 +189,11 @@ public: Common::Point _pos; protected: + struct ValueList { + uint16 listCount; + uint16 *list; + }; + void setPositionClipping(const Common::Point &mouse, Common::Point &dest); uint16 _flagHV; @@ -201,17 +208,13 @@ protected: uint16 _mouseDownOpcode; uint16 _mouseDragOpcode; uint16 _mouseUpOpcode; - struct { - uint16 listCount; - uint16 *list; - } _lists[3]; - + ValueList _lists[3]; }; -class MystResourceType10 : public MystResourceType11 { +class MystAreaSlider : public MystAreaDrag { public: - MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResourceType10(); + MystAreaSlider(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystAreaSlider(); void handleMouseDown() override; void handleMouseUp() override; @@ -229,10 +232,11 @@ protected: uint16 _sliderHeight; }; -class MystResourceType12 : public MystResourceType11 { +class MystVideoInfo : public MystAreaDrag { public: - MystResourceType12(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); - virtual ~MystResourceType12(); + MystVideoInfo(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + virtual ~MystVideoInfo(); + void drawFrame(uint16 frame); bool pullLeverV(); void releaseLeverV(); @@ -247,9 +251,10 @@ private: uint16 _currentFrame; }; -class MystResourceType13 : public MystResource { +class MystAreaHover : public MystArea { public: - MystResourceType13(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); + MystAreaHover(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystArea *parent); + const Common::String describe() override; void handleMouseUp() override; diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 14a95ee582..aee937239d 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -154,7 +154,7 @@ void MystScriptParser::setupCommonOpcodes() { #undef OPCODE -void MystScriptParser::runScript(MystScript script, MystResource *invokingResource) { +void MystScriptParser::runScript(MystScript script, MystArea *invokingResource) { debugC(kDebugScript, "Script Size: %d", script->size()); // Scripted drawing takes more time to simulate older hardware @@ -442,7 +442,7 @@ void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, uint16 argc, uint16 debugC(kDebugScript, "\tDirection: %d", direction); // Trigger resource 6 movie overriding play direction - MystResourceType6 *resource = static_cast<MystResourceType6 *>(_invokingResource); + MystAreaVideo *resource = static_cast<MystAreaVideo *>(_invokingResource); resource->setDirection(direction); resource->playMovie(); @@ -459,7 +459,7 @@ void MystScriptParser::o_drawAreaState(uint16 op, uint16 var, uint16 argc, uint1 debugC(kDebugScript, "Opcode %d: drawAreaState, state: %d", op, argv[0]); debugC(kDebugScript, "\tVar: %d", var); - MystResourceType8 *parent = static_cast<MystResourceType8 *>(_invokingResource->_parent); + MystAreaImageSwitch *parent = static_cast<MystAreaImageSwitch *>(_invokingResource->_parent); parent->drawConditionalDataToScreen(argv[0]); } @@ -522,7 +522,7 @@ void MystScriptParser::o_enableAreas(uint16 op, uint16 var, uint16 argc, uint16 for (uint16 i = 0; i < count; i++) { debugC(kDebugScript, "Enable hotspot index %d", argv[i + 1]); - MystResource *resource = nullptr; + MystArea *resource = nullptr; if (argv[i + 1] == 0xFFFF) resource = _invokingResource; else @@ -547,7 +547,7 @@ void MystScriptParser::o_disableAreas(uint16 op, uint16 var, uint16 argc, uint16 for (uint16 i = 0; i < count; i++) { debugC(kDebugScript, "Disable hotspot index %d", argv[i + 1]); - MystResource *resource = nullptr; + MystArea *resource = nullptr; if (argv[i + 1] == 0xFFFF) resource = _invokingResource; else @@ -578,7 +578,7 @@ void MystScriptParser::o_toggleAreasActivation(uint16 op, uint16 var, uint16 arg for (uint16 i = 0; i < count; i++) { debugC(kDebugScript, "Enable/Disable hotspot index %d", argv[i + 1]); - MystResource *resource = nullptr; + MystArea *resource = nullptr; if (argv[i + 1] == 0xFFFF) resource = _invokingResource; else diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index 3cf5c2d7f2..835bb7c270 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -34,7 +34,7 @@ namespace Mohawk { #define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) class MohawkEngine_Myst; -class MystResource; +class MystArea; enum MystScriptType { kMystScriptNone, @@ -63,11 +63,11 @@ public: MystScriptParser(MohawkEngine_Myst *vm); virtual ~MystScriptParser(); - void runScript(MystScript script, MystResource *invokingResource = nullptr); + void runScript(MystScript script, MystArea *invokingResource = nullptr); void runOpcode(uint16 op, uint16 var = 0, uint16 argc = 0, uint16 *argv = nullptr); const Common::String getOpcodeDesc(uint16 op); MystScript readScript(Common::SeekableReadStream *stream, MystScriptType type); - void setInvokingResource(MystResource *resource) { _invokingResource = resource; } + void setInvokingResource(MystArea *resource) { _invokingResource = resource; } virtual void disablePersistentScripts() = 0; virtual void runPersistentScripts() = 0; @@ -151,7 +151,7 @@ protected: Common::Array<MystOpcode *> _opcodes; - MystResource *_invokingResource; + MystArea *_invokingResource; uint16 _savedCardId; uint16 _savedMapCardId; diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 0718f8e683..7b38e3707f 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -377,7 +377,7 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint1 void Channelwood::o_leverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever start move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); _vm->_cursor->setCursor(700); _leverPulled = false; @@ -386,7 +386,7 @@ void Channelwood::o_leverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *a void Channelwood::o_leverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); if (lever->pullLeverV()) { if (!_leverPulled) { @@ -401,7 +401,7 @@ void Channelwood::o_leverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) void Channelwood::o_leverMoveFail(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); if (lever->pullLeverV()) { if (!_leverPulled) { @@ -419,7 +419,7 @@ void Channelwood::o_leverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *arg debugC(kDebugScript, "Opcode %d: Generic lever end move", op); // Get current lever frame - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Release lever lever->releaseLeverV(); @@ -439,7 +439,7 @@ void Channelwood::o_leverEndMoveResumeBackground(uint16 op, uint16 var, uint16 a void Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { o_leverEndMove(op, var, argc, argv); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); uint16 soundId = lever->getList3(0); if (soundId) _vm->_sound->replaceSoundMyst(soundId); @@ -461,7 +461,7 @@ void Channelwood::o_leverElev3EndMove(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_pumpLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Pump lever move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); if (lever->pullLeverV()) { uint16 soundId = lever->getList2(0); @@ -475,7 +475,7 @@ void Channelwood::o_pumpLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *ar void Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { o_leverEndMove(op, var, argc, argv); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); uint16 soundId = lever->getList3(0); if (soundId) _vm->_sound->replaceBackgroundMyst(soundId, 36864); @@ -484,7 +484,7 @@ void Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play stairs door video", op); - MystResourceType6 *movie = static_cast<MystResourceType6 *>(_invokingResource); + MystAreaVideo *movie = static_cast<MystAreaVideo *>(_invokingResource); if (_state.stairsUpperDoorState) { // Close door, play the open movie backwards @@ -500,7 +500,7 @@ void Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_valveHandleMove1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); if (handle->getRect().contains(mouse)) { @@ -516,7 +516,7 @@ void Channelwood::o_valveHandleMove1(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); uint16 soundId = handle->getList1(0); if (soundId) _vm->_sound->replaceSoundMyst(soundId); @@ -528,7 +528,7 @@ void Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var, uint16 argc, ui void Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move stop", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); // Update state with valve position if (_tempVar <= 5) @@ -551,7 +551,7 @@ void Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, uint16 argc, uint void Channelwood::o_valveHandleMove2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); if (handle->getRect().contains(mouse)) { @@ -567,7 +567,7 @@ void Channelwood::o_valveHandleMove2(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); uint16 soundId = handle->getList1(0); if (soundId) _vm->_sound->replaceSoundMyst(soundId); @@ -579,7 +579,7 @@ void Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var, uint16 argc, ui void Channelwood::o_valveHandleMove3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); if (handle->getRect().contains(mouse)) { @@ -595,7 +595,7 @@ void Channelwood::o_valveHandleMove3(uint16 op, uint16 var, uint16 argc, uint16 void Channelwood::o_valveHandleMoveStart3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); uint16 soundId = handle->getList1(0); if (soundId) _vm->_sound->replaceSoundMyst(soundId); @@ -680,7 +680,7 @@ void Channelwood::o_hologramTemple(uint16 op, uint16 var, uint16 argc, uint16 *a void Channelwood::o_executeMouseUp(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Execute mouse up", op); - MystResourceType5 *resource = static_cast<MystResourceType5 *>(_vm->_resources[argv[0]]); + MystAreaAction *resource = static_cast<MystAreaAction *>(_vm->_resources[argv[0]]); resource->handleMouseUp(); } @@ -753,7 +753,7 @@ void Channelwood::o_soundReplace(uint16 op, uint16 var, uint16 argc, uint16 *arg void Channelwood::o_lever_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever init", op); - _leverAction = static_cast<MystResourceType5 *>(_invokingResource); + _leverAction = static_cast<MystAreaAction *>(_invokingResource); } void Channelwood::o_pipeValve_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 719257f1ef..c141a62cd6 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -94,7 +94,7 @@ private: uint16 _doorOpened; // 68 bool _leverPulled; - MystResourceType5 *_leverAction; // 72 + MystAreaAction *_leverAction; // 72 bool pipeChangeValve(bool open, uint16 mask); }; diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index dc66984398..a139ca2a9b 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -170,7 +170,7 @@ void Intro::mystLinkBook_run() { void Intro::o_mystLinkBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Myst link book init", op); - _linkBookMovie = static_cast<MystResourceType6 *>(_invokingResource); + _linkBookMovie = static_cast<MystAreaVideo *>(_invokingResource); _startTime = 1; _linkBookRunning = true; } diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h index acff03e2a0..0095706795 100644 --- a/engines/mohawk/myst_stacks/intro.h +++ b/engines/mohawk/myst_stacks/intro.h @@ -29,7 +29,7 @@ namespace Mohawk { -class MystResourceType6; +class MystAreaVideo; struct MystScriptEntry; namespace MystStacks { @@ -60,7 +60,7 @@ private: uint16 _introStep; bool _linkBookRunning; - MystResourceType6 *_linkBookMovie; + MystAreaVideo *_linkBookMovie; }; } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index ffcaa226c6..3f1fbf91e7 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -277,7 +277,7 @@ void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint1 void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op); - MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *crank = static_cast<MystAreaDrag *>(_invokingResource); uint16 crankSoundId = crank->getList2(0); _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true); @@ -285,16 +285,16 @@ void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *ar _birdSingEndTime = 0; _birdCrankStartTime = _vm->_system->getMillis(); - MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + MystAreaVideo *crankMovie = static_cast<MystAreaVideo *>(crank->getSubResource(0)); crankMovie->playMovie(); } void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op); - MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *crank = static_cast<MystAreaDrag *>(_invokingResource); - MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + MystAreaVideo *crankMovie = static_cast<MystAreaVideo *>(crank->getSubResource(0)); crankMovie->pauseMovie(true); uint16 crankSoundId = crank->getList2(1); @@ -334,7 +334,7 @@ void Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, uint16 argc, ui void Mechanical::o_elevatorRotationStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Elevator rotation lever start", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); _elevatorRotationLeverMoving = true; @@ -349,7 +349,7 @@ void Mechanical::o_elevatorRotationMove(uint16 op, uint16 var, uint16 argc, uint debugC(kDebugScript, "Opcode %d: Elevator rotation lever move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Make the handle follow the mouse int16 maxStep = lever->getNumFrames() - 1; @@ -367,7 +367,7 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint debugC(kDebugScript, "Opcode %d: Elevator rotation lever stop", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Get current lever frame int16 maxStep = lever->getNumFrames() - 1; @@ -416,7 +416,7 @@ void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, uint16 argc _vm->_cursor->setCursor(700); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); } @@ -424,7 +424,7 @@ void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Make the handle follow the mouse int16 maxStep = lever->getNumFrames() - 1; @@ -441,7 +441,7 @@ void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Release lever for (int i = _fortressRotationSpeed; i >= 0; i--) { @@ -459,7 +459,7 @@ void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, uint16 argc _vm->_cursor->setCursor(700); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(_fortressRotationBrake); } @@ -467,7 +467,7 @@ void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Make the handle follow the mouse int16 maxStep = lever->getNumFrames() - 1; @@ -484,7 +484,7 @@ void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(_fortressRotationBrake); _vm->checkCursorHints(); @@ -495,7 +495,7 @@ void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, uint16 ar _vm->_cursor->setCursor(700); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); } @@ -503,7 +503,7 @@ void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 arg debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Make the handle follow the mouse int16 maxStep = lever->getNumFrames() - 1; @@ -520,7 +520,7 @@ void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 arg void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Release lever for (int i = _fortressSimulationSpeed; i >= 0; i--) { @@ -538,7 +538,7 @@ void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, uint16 ar _vm->_cursor->setCursor(700); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(_fortressSimulationBrake); } @@ -546,7 +546,7 @@ void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 arg debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // Make the handle follow the mouse int16 maxStep = lever->getNumFrames() - 1; @@ -563,7 +563,7 @@ void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 arg void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(_fortressSimulationBrake); _vm->checkCursorHints(); @@ -763,13 +763,13 @@ void Mechanical::o_bird_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _birdSinging = false; _birdSingEndTime = 0; - _bird = static_cast<MystResourceType6 *>(_invokingResource); + _bird = static_cast<MystAreaVideo *>(_invokingResource); } void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Snake box init", op); - _snakeBox = static_cast<MystResourceType6 *>(_invokingResource); + _snakeBox = static_cast<MystAreaVideo *>(_invokingResource); } void Mechanical::elevatorRotation_run() { @@ -872,7 +872,7 @@ void Mechanical::fortressRotation_run() { void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Fortress rotation init", op); - _fortressRotationGears = static_cast<MystResourceType6 *>(_invokingResource); + _fortressRotationGears = static_cast<MystAreaVideo *>(_invokingResource); VideoHandle gears = _fortressRotationGears->playMovie(); gears->setLooping(true); @@ -997,7 +997,7 @@ void Mechanical::fortressSimulation_run() { void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op); - _fortressSimulationHolo = static_cast<MystResourceType6 *>(_invokingResource); + _fortressSimulationHolo = static_cast<MystAreaVideo *>(_invokingResource); _fortressSimulationStartSound1 = argv[0]; _fortressSimulationStartSound2 = argv[1]; @@ -1019,7 +1019,7 @@ void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, u void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op); - _fortressSimulationStartup = static_cast<MystResourceType6 *>(_invokingResource); + _fortressSimulationStartup = static_cast<MystAreaVideo *>(_invokingResource); } } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index ccc2783712..159a330c79 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -109,7 +109,7 @@ private: uint16 _fortressRotationBrake; // 80 uint16 _fortressPosition; // 82 uint16 _fortressRotationSounds[4]; // 86 to 92 - MystResourceType6 *_fortressRotationGears; // 172 + MystAreaVideo *_fortressRotationGears; // 172 bool _fortressRotationShortMovieWorkaround; uint32 _fortressRotationShortMovieCount; @@ -121,8 +121,8 @@ private: uint16 _fortressSimulationBrake; // 98 uint16 _fortressSimulationStartSound1; // 102 uint16 _fortressSimulationStartSound2; // 100 - MystResourceType6 *_fortressSimulationHolo; // 160 - MystResourceType6 *_fortressSimulationStartup; // 164 + MystAreaVideo *_fortressSimulationHolo; // 160 + MystAreaVideo *_fortressSimulationStartup; // 164 uint16 _elevatorGoingDown; // 112 @@ -143,10 +143,10 @@ private: bool _birdSinging; // 144 uint32 _birdCrankStartTime; // 136 uint32 _birdSingEndTime; // 140 - MystResourceType6 *_bird; // 152 + MystAreaVideo *_bird; // 152 - MystResourceType6 *_snakeBox; // 156 + MystAreaVideo *_snakeBox; // 156 }; } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index c5f76fe54d..8d2e732c2c 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -1251,7 +1251,7 @@ void Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) void Myst::o_imagerEraseButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager erase button", op); - _imagerRedButton = static_cast<MystResourceType8 *>(_invokingResource->_parent); + _imagerRedButton = static_cast<MystAreaImageSwitch *>(_invokingResource->_parent); for (uint i = 0; i < 4; i++) _imagerSound[i] = argv[i]; _imagerValidationCard = argv[4]; @@ -1351,7 +1351,7 @@ void Myst::o_towerElevatorAnimation(uint16 op, uint16 var, uint16 argc, uint16 * void Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator button pressed", op); - MystResource *button = _invokingResource->_parent; + MystArea *button = _invokingResource->_parent; generatorRedrawRocket(); @@ -1385,7 +1385,7 @@ void Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint16 argc, uint16 * } // Redraw button - _vm->redrawArea(button->getType8Var()); + _vm->redrawArea(button->getImageSwitchVar()); // Blow breaker if (_state.generatorVoltage > 59) @@ -1398,8 +1398,8 @@ void Myst::generatorRedrawRocket() { _vm->redrawArea(97); } -void Myst::generatorButtonValue(MystResource *button, uint16 &mask, uint16 &value) { - switch (button->getType8Var()) { +void Myst::generatorButtonValue(MystArea *button, uint16 &mask, uint16 &value) { + switch (button->getImageSwitchVar()) { case 52: // Generator Switch #1 mask = 1; value = 10; @@ -1466,7 +1466,7 @@ void Myst::o_cabinSafeHandleStartMove(uint16 op, uint16 var, uint16 argc, uint16 debugC(kDebugScript, "Opcode %d: Cabin safe handle start move", op); // Used on Card 4100 - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); handle->drawFrame(0); _vm->_cursor->setCursor(700); _tempVar = 0; @@ -1476,7 +1476,7 @@ void Myst::o_cabinSafeHandleMove(uint16 op, uint16 var, uint16 argc, uint16 *arg debugC(kDebugScript, "Opcode %d: Cabin safe handle move", op); // Used on Card 4100 - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); if (handle->pullLeverV()) { // Sound not played yet @@ -1506,7 +1506,7 @@ void Myst::o_cabinSafeHandleEndMove(uint16 op, uint16 var, uint16 argc, uint16 * debugC(kDebugScript, "Opcode %d: Cabin safe handle end move", op); // Used on Card 4100 - MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *handle = static_cast<MystVideoInfo *>(_invokingResource); handle->drawFrame(0); _vm->checkCursorHints(); } @@ -1804,7 +1804,7 @@ void Myst::o_observatoryTimeSliderMove(uint16 op, uint16 var, uint16 argc, uint1 void Myst::o_circuitBreakerStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker start move", op); - MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *breaker = static_cast<MystVideoInfo *>(_invokingResource); breaker->drawFrame(0); _vm->_cursor->setCursor(700); _tempVar = 0; @@ -1813,7 +1813,7 @@ void Myst::o_circuitBreakerStartMove(uint16 op, uint16 var, uint16 argc, uint16 void Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker move", op); - MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *breaker = static_cast<MystVideoInfo *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); int16 maxStep = breaker->getStepsV() - 1; @@ -1828,7 +1828,7 @@ void Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv // Breaker switched if (step == maxStep) { // Choose breaker - if (breaker->getType8Var() == 93) { + if (breaker->getImageSwitchVar() == 93) { // Voltage is still too high or not broken if (_state.generatorVoltage > 59 || _state.generatorBreakers != 1) { uint16 soundId = breaker->getList2(1); @@ -1864,8 +1864,8 @@ void Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv void Myst::o_circuitBreakerEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker end move", op); - MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); - _vm->redrawArea(breaker->getType8Var()); + MystVideoInfo *breaker = static_cast<MystVideoInfo *>(_invokingResource); + _vm->redrawArea(breaker->getImageSwitchVar()); _vm->checkCursorHints(); } @@ -2202,7 +2202,7 @@ void Myst::o_rocketSoundSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 } void Myst::rocketSliderMove() { - MystResourceType10 *slider = static_cast<MystResourceType10 *>(_invokingResource); + MystAreaSlider *slider = static_cast<MystAreaSlider *>(_invokingResource); if (_state.generatorVoltage == 59 && !_state.generatorBreakers) { uint16 soundId = rocketSliderGetSound(slider->_pos.y); @@ -2262,7 +2262,7 @@ void Myst::rocketCheckSolution() { if (solved) { // Reset lever position - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); // Book appearing @@ -2299,7 +2299,7 @@ void Myst::rocketCheckSolution() { void Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket piano start move", op); - MystResourceType11 *key = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *key = static_cast<MystAreaDrag *>(_invokingResource); // What the hell?? Common::Rect src = key->getSubImage(1).rect; @@ -2326,7 +2326,7 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { Common::Rect piano = Common::Rect(85, 123, 460, 270); // Unpress previous key - MystResourceType11 *key = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *key = static_cast<MystAreaDrag *>(_invokingResource); Common::Rect src = key->getSubImage(0).rect; Common::Rect dest = src; @@ -2337,10 +2337,10 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _vm->_gfx->copyImageSectionToScreen(key->getSubImage(0).wdib, src, dest); if (piano.contains(mouse)) { - MystResource *resource = _vm->updateCurrentResource(); - if (resource && resource->type == kMystDragArea) { + MystArea *resource = _vm->updateCurrentResource(); + if (resource && resource->type == kMystAreaDrag) { // Press new key - key = static_cast<MystResourceType11 *>(resource); + key = static_cast<MystAreaDrag *>(resource); src = key->getSubImage(1).rect; Common::Rect rect = key->getSubImage(0).rect; dest = rect; @@ -2368,7 +2368,7 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket piano end move", op); - MystResourceType8 *key = static_cast<MystResourceType8 *>(_invokingResource); + MystAreaImageSwitch *key = static_cast<MystAreaImageSwitch *>(_invokingResource); Common::Rect src = key->getSubImage(0).rect; Common::Rect dest = src; @@ -2386,7 +2386,7 @@ void Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever start move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); _vm->_cursor->setCursor(700); _rocketLeverPosition = 0; @@ -2406,7 +2406,7 @@ void Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_rocketLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); // Make the lever follow the mouse @@ -2435,7 +2435,7 @@ void Myst::o_rocketLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_rocketLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever end move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); _vm->checkCursorHints(); _rocketLeverPosition = 0; @@ -2712,7 +2712,7 @@ void Myst::clockWheel_run() { } void Myst::clockWheelStartTurn(uint16 wheel) { - MystResourceType11 *resource = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *resource = static_cast<MystAreaDrag *>(_invokingResource); uint16 soundId = resource->getList1(0); if (soundId) @@ -2874,7 +2874,7 @@ void Myst::o_imagerEraseStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_clockLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock lever start move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); _vm->_cursor->setCursor(700); _clockMiddleGearMovedAlone = false; @@ -2885,7 +2885,7 @@ void Myst::o_clockLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock left lever move", op); if (!_clockLeverPulled) { - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // If lever pulled if (lever->pullLeverV()) { @@ -2977,7 +2977,7 @@ void Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) _vm->_sound->replaceSoundMyst(8113); // Release lever - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->releaseLeverV(); // Check if puzzle is solved @@ -3021,7 +3021,7 @@ void Myst::clockGearsCheckSolution() { void Myst::o_clockResetLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock reset lever start move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->drawFrame(0); _vm->_cursor->setCursor(700); } @@ -3029,7 +3029,7 @@ void Myst::o_clockResetLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 void Myst::o_clockResetLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock reset lever move", op); - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); // If pulled if (lever->pullLeverV() && _clockWeightPosition != 0) @@ -3125,7 +3125,7 @@ void Myst::o_clockResetLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 * debugC(kDebugScript, "Opcode %d: Clock reset lever end move", op); // Get current lever frame - MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + MystVideoInfo *lever = static_cast<MystVideoInfo *>(_invokingResource); lever->releaseLeverV(); @@ -3189,8 +3189,8 @@ void Myst::towerRotationMap_run() { void Myst::o_towerRotationMap_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _towerRotationMapRunning = true; - _towerRotationMapTower = static_cast<MystResourceType11 *>(_invokingResource); - _towerRotationMapLabel = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); + _towerRotationMapTower = static_cast<MystAreaDrag *>(_invokingResource); + _towerRotationMapLabel = static_cast<MystAreaImageSwitch *>(_vm->_resources[argv[0]]); _tempVar = 0; _startTime = 0; _towerRotationMapClicked = false; @@ -3202,7 +3202,7 @@ void Myst::towerRotationDrawBuildings() { // Draw other resources for (uint i = 1; i <= 10; i++) { - MystResourceType8 *resource = static_cast<MystResourceType8 *>(_vm->_resources[i]); + MystAreaImageSwitch *resource = static_cast<MystAreaImageSwitch *>(_vm->_resources[i]); _vm->redrawResource(resource, false); } } @@ -3322,7 +3322,7 @@ void Myst::o_butterflies_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) // Used for Card 4256 (Butterfly Movie Activation) if (!_butterfliesMoviePlayed) { - MystResourceType6 *butterflies = static_cast<MystResourceType6 *>(_invokingResource); + MystAreaVideo *butterflies = static_cast<MystAreaVideo *>(_invokingResource); butterflies->playMovie(); _butterfliesMoviePlayed = true; @@ -3333,8 +3333,8 @@ void Myst::o_imager_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager init", op); debugC(kDebugScript, "Var: %d", var); - MystResourceType7 *select = static_cast<MystResourceType7 *>(_invokingResource); - _imagerMovie = static_cast<MystResourceType6 *>(select->getSubResource(getVar(var))); + MystAreaActionSwitch *select = static_cast<MystAreaActionSwitch *>(_invokingResource); + _imagerMovie = static_cast<MystAreaVideo *>(select->getSubResource(getVar(var))); _imagerRunning = true; } @@ -3377,8 +3377,8 @@ void Myst::libraryBookcaseTransform_run(void) { void Myst::o_libraryBookcaseTransform_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { if (_libraryBookcaseChanged) { - MystResourceType7 *resource = static_cast<MystResourceType7 *>(_invokingResource); - _libraryBookcaseMovie = static_cast<MystResourceType6 *>(resource->getSubResource(getVar(0))); + MystAreaActionSwitch *resource = static_cast<MystAreaActionSwitch *>(_invokingResource); + _libraryBookcaseMovie = static_cast<MystAreaVideo *>(resource->getSubResource(getVar(0))); _libraryBookcaseSoundId = argv[0]; _libraryBookcaseMoving = true; } @@ -3471,17 +3471,17 @@ void Myst::o_observatory_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) _tempVar = 0; _observatoryNotInitialized = true; - _observatoryVisualizer = static_cast<MystResourceType8 *>(_invokingResource); - _observatoryGoButton = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); + _observatoryVisualizer = static_cast<MystAreaImageSwitch *>(_invokingResource); + _observatoryGoButton = static_cast<MystAreaImageSwitch *>(_vm->_resources[argv[0]]); if (observatoryIsDDMMYYYY2400()) { - _observatoryDaySlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[1]]); - _observatoryMonthSlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[2]]); + _observatoryDaySlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[1]]); + _observatoryMonthSlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[2]]); } else { - _observatoryMonthSlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[1]]); - _observatoryDaySlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[2]]); + _observatoryMonthSlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[1]]); + _observatoryDaySlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[2]]); } - _observatoryYearSlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[3]]); - _observatoryTimeSlider = static_cast<MystResourceType10 *>(_vm->_resources[argv[4]]); + _observatoryYearSlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[3]]); + _observatoryTimeSlider = static_cast<MystAreaSlider *>(_vm->_resources[argv[4]]); // Set date selection sliders position _observatoryDaySlider->setPosition(_state.observatoryDaySlider); @@ -3614,13 +3614,13 @@ void Myst::gullsFly2_run() { void Myst::o_treeCard_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Enter tree card", op); - _tree = static_cast<MystResourceType8 *>(_invokingResource); + _tree = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Myst::o_treeEntry_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Enter tree card with entry", op); - _treeAlcove = static_cast<MystResourceType5 *>(_invokingResource); + _treeAlcove = static_cast<MystAreaAction *>(_invokingResource); _treeMinAccessiblePosition = argv[0]; _treeMaxAccessiblePosition = argv[1]; @@ -3704,11 +3704,11 @@ void Myst::boilerGaugeInit() { void Myst::o_rocketSliders_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket sliders init", op); - _rocketSlider1 = static_cast<MystResourceType10 *>(_vm->_resources[argv[0]]); - _rocketSlider2 = static_cast<MystResourceType10 *>(_vm->_resources[argv[1]]); - _rocketSlider3 = static_cast<MystResourceType10 *>(_vm->_resources[argv[2]]); - _rocketSlider4 = static_cast<MystResourceType10 *>(_vm->_resources[argv[3]]); - _rocketSlider5 = static_cast<MystResourceType10 *>(_vm->_resources[argv[4]]); + _rocketSlider1 = static_cast<MystAreaSlider *>(_vm->_resources[argv[0]]); + _rocketSlider2 = static_cast<MystAreaSlider *>(_vm->_resources[argv[1]]); + _rocketSlider3 = static_cast<MystAreaSlider *>(_vm->_resources[argv[2]]); + _rocketSlider4 = static_cast<MystAreaSlider *>(_vm->_resources[argv[3]]); + _rocketSlider5 = static_cast<MystAreaSlider *>(_vm->_resources[argv[4]]); // Initialize sliders position for (uint i = 0; i < 5; i++) diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index 38b6d9918e..576f929d18 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -192,11 +192,11 @@ protected: bool _generatorControlRoomRunning; uint16 _generatorVoltage; // 58 - MystResourceType10 *_rocketSlider1; // 248 - MystResourceType10 *_rocketSlider2; // 252 - MystResourceType10 *_rocketSlider3; // 256 - MystResourceType10 *_rocketSlider4; // 260 - MystResourceType10 *_rocketSlider5; // 264 + MystAreaSlider *_rocketSlider1; // 248 + MystAreaSlider *_rocketSlider2; // 252 + MystAreaSlider *_rocketSlider3; // 256 + MystAreaSlider *_rocketSlider4; // 260 + MystAreaSlider *_rocketSlider5; // 264 uint16 _rocketSliderSound; // 294 uint16 _rocketLeverPosition; // 296 VideoHandle _rocketLinkBook; @@ -214,7 +214,7 @@ protected: uint32 _gullsNextTime; // 216 bool _libraryBookcaseMoving; - MystResourceType6 *_libraryBookcaseMovie; // 104 + MystAreaVideo *_libraryBookcaseMovie; // 104 uint16 _libraryBookcaseSoundId; // 284 bool _libraryBookcaseChanged; // 288 uint16 _libraryBookSound1; // 298 @@ -223,13 +223,13 @@ protected: uint16 _courtyardBoxSound; // 302 bool _imagerValidationRunning; - MystResourceType8 *_imagerRedButton; // 304 + MystAreaImageSwitch *_imagerRedButton; // 304 uint16 _imagerSound[4]; // 308 to 314 uint16 _imagerValidationCard; // 316 uint16 _imagerValidationStep; // 318 bool _imagerRunning; - MystResourceType6 *_imagerMovie; // 64 + MystAreaVideo *_imagerMovie; // 64 uint16 _fireplaceLines[6]; // 74 to 84 @@ -248,8 +248,8 @@ protected: bool _towerRotationBlinkLabel; uint16 _towerRotationBlinkLabelCount; uint16 _towerRotationMapInitialized; // 292 - MystResourceType11 *_towerRotationMapTower; // 108 - MystResourceType8 *_towerRotationMapLabel; // 112 + MystAreaDrag *_towerRotationMapTower; // 108 + MystAreaImageSwitch *_towerRotationMapLabel; // 112 uint16 _towerRotationSpeed; // 124 bool _towerRotationMapClicked; // 132 bool _towerRotationOverSpot; // 136 @@ -269,8 +269,8 @@ protected: bool _basementPressureDecreasing; bool _treeStopped; // 236 - MystResourceType8 *_tree; // 220 - MystResourceType5 *_treeAlcove; // 224 + MystAreaImageSwitch *_tree; // 220 + MystAreaAction *_treeAlcove; // 224 uint16 _treeMinPosition; // 228 uint16 _treeMinAccessiblePosition; // 230 uint16 _treeMaxAccessiblePosition; // 232 @@ -280,21 +280,21 @@ protected: bool _observatoryDayChanging; bool _observatoryYearChanging; bool _observatoryTimeChanging; - MystResourceType8 *_observatoryVisualizer; // 184 - MystResourceType8 *_observatoryGoButton; // 188 - MystResourceType10 *_observatoryDaySlider; // 192 - MystResourceType10 *_observatoryMonthSlider; // 196 - MystResourceType10 *_observatoryYearSlider; // 200 - MystResourceType10 *_observatoryTimeSlider; // 204 + MystAreaImageSwitch *_observatoryVisualizer; // 184 + MystAreaImageSwitch *_observatoryGoButton; // 188 + MystAreaSlider *_observatoryDaySlider; // 192 + MystAreaSlider *_observatoryMonthSlider; // 196 + MystAreaSlider *_observatoryYearSlider; // 200 + MystAreaSlider *_observatoryTimeSlider; // 204 uint32 _observatoryLastTime; // 208 bool _observatoryNotInitialized; // 212 int16 _observatoryIncrement; // 346 - MystResourceType10 *_observatoryCurrentSlider; // 348 + MystAreaSlider *_observatoryCurrentSlider; // 348 bool _greenBookRunning; void generatorRedrawRocket(); - void generatorButtonValue(MystResource *button, uint16 &offset, uint16 &value); + void generatorButtonValue(MystArea *button, uint16 &offset, uint16 &value); void rocketSliderMove(); uint16 rocketSliderGetSound(uint16 pos); diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index 4cae4aaca7..7f6d38da2b 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -239,13 +239,13 @@ void Preview::o_library_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Library init", op); // Used for Card 3002 (Myst Island Overview) - _library = static_cast<MystResourceType8 *>(_invokingResource); + _library = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Preview::o_libraryBookcaseTransformDemo_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { if (_libraryBookcaseChanged) { - MystResourceType7 *resource = static_cast<MystResourceType7 *>(_invokingResource); - _libraryBookcaseMovie = static_cast<MystResourceType6 *>(resource->getSubResource(getVar(303))); + MystAreaActionSwitch *resource = static_cast<MystAreaActionSwitch *>(_invokingResource); + _libraryBookcaseMovie = static_cast<MystAreaVideo *>(resource->getSubResource(getVar(303))); _libraryBookcaseSoundId = argv[0]; _libraryBookcaseMoving = true; } diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h index 04ad6c31cb..9d833b35e2 100644 --- a/engines/mohawk/myst_stacks/preview.h +++ b/engines/mohawk/myst_stacks/preview.h @@ -56,7 +56,7 @@ private: DECLARE_OPCODE(o_library_init); uint16 _libraryState; // 4 - MystResourceType8 *_library; // 32 + MystAreaImageSwitch *_library; // 32 bool _speechRunning; uint _speechStep; diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 7d1e1b9dff..30333ec47c 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -773,7 +773,7 @@ uint16 Selenitic::soundLockCurrentSound(uint16 position, bool pixels) { return 0; } -MystResourceType10 *Selenitic::soundLockSliderFromVar(uint16 var) { +MystAreaSlider *Selenitic::soundLockSliderFromVar(uint16 var) { switch (var) { case 20: return _soundLockSlider1; @@ -793,7 +793,7 @@ MystResourceType10 *Selenitic::soundLockSliderFromVar(uint16 var) { void Selenitic::o_soundLockMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock move", op); - MystResourceType10 *slider = soundLockSliderFromVar(var); + MystAreaSlider *slider = soundLockSliderFromVar(var); uint16 soundId = soundLockCurrentSound(slider->_pos.y, true); if (_soundLockSoundId != soundId) { @@ -805,7 +805,7 @@ void Selenitic::o_soundLockMove(uint16 op, uint16 var, uint16 argc, uint16 *argv void Selenitic::o_soundLockStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock start move", op); - MystResourceType10 *slider = soundLockSliderFromVar(var); + MystAreaSlider *slider = soundLockSliderFromVar(var); _vm->_cursor->setCursor(700); _vm->_sound->pauseBackgroundMyst(); @@ -817,7 +817,7 @@ void Selenitic::o_soundLockStartMove(uint16 op, uint16 var, uint16 argc, uint16 void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock end move", op); - MystResourceType10 *slider = soundLockSliderFromVar(var); + MystAreaSlider *slider = soundLockSliderFromVar(var); uint16 *value = &_state.soundLockSliderPositions[0]; switch (var) { @@ -861,7 +861,7 @@ void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *a _vm->_sound->resumeBackgroundMyst(); } -void Selenitic::soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved) { +void Selenitic::soundLockCheckSolution(MystAreaSlider *slider, uint16 value, uint16 solution, bool &solved) { slider->drawConditionalDataToScreen(2); _vm->_sound->replaceSoundMyst(soundLockCurrentSound(value / 12, false)); _vm->_system->delayMillis(1500); @@ -929,15 +929,15 @@ void Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, uint16 argc, uint1 } void Selenitic::o_mazeRunnerCompass_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - _mazeRunnerCompass = static_cast<MystResourceType8 *>(_invokingResource); + _mazeRunnerCompass = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Selenitic::o_mazeRunnerWindow_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - _mazeRunnerWindow = static_cast<MystResourceType8 *>(_invokingResource); + _mazeRunnerWindow = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Selenitic::o_mazeRunnerLight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - _mazeRunnerLight = static_cast<MystResourceType8 *>(_invokingResource); + _mazeRunnerLight = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Selenitic::soundReceiver_run() { @@ -1059,19 +1059,19 @@ void Selenitic::o_soundReceiver_init(uint16 op, uint16 var, uint16 argc, uint16 // Used for Card 1245 (Sound Receiver) _soundReceiverRunning = true; - _soundReceiverRightButton = static_cast<MystResourceType8 *>(_vm->_resources[0]); - _soundReceiverLeftButton = static_cast<MystResourceType8 *>(_vm->_resources[1]); - _soundReceiverSigmaButton = static_cast<MystResourceType8 *>(_vm->_resources[2]); - _soundReceiverSources[4] = static_cast<MystResourceType8 *>(_vm->_resources[3]); - _soundReceiverSources[3] = static_cast<MystResourceType8 *>(_vm->_resources[4]); - _soundReceiverSources[2] = static_cast<MystResourceType8 *>(_vm->_resources[5]); - _soundReceiverSources[1] = static_cast<MystResourceType8 *>(_vm->_resources[6]); - _soundReceiverSources[0] = static_cast<MystResourceType8 *>(_vm->_resources[7]); - _soundReceiverViewer = static_cast<MystResourceType8 *>(_vm->_resources[8]); - _soundReceiverAngle1 = static_cast<MystResourceType8 *>(_vm->_resources[10]); - _soundReceiverAngle2 = static_cast<MystResourceType8 *>(_vm->_resources[11]); - _soundReceiverAngle3 = static_cast<MystResourceType8 *>(_vm->_resources[12]); - _soundReceiverAngle4 = static_cast<MystResourceType8 *>(_vm->_resources[13]); + _soundReceiverRightButton = static_cast<MystAreaImageSwitch *>(_vm->_resources[0]); + _soundReceiverLeftButton = static_cast<MystAreaImageSwitch *>(_vm->_resources[1]); + _soundReceiverSigmaButton = static_cast<MystAreaImageSwitch *>(_vm->_resources[2]); + _soundReceiverSources[4] = static_cast<MystAreaImageSwitch *>(_vm->_resources[3]); + _soundReceiverSources[3] = static_cast<MystAreaImageSwitch *>(_vm->_resources[4]); + _soundReceiverSources[2] = static_cast<MystAreaImageSwitch *>(_vm->_resources[5]); + _soundReceiverSources[1] = static_cast<MystAreaImageSwitch *>(_vm->_resources[6]); + _soundReceiverSources[0] = static_cast<MystAreaImageSwitch *>(_vm->_resources[7]); + _soundReceiverViewer = static_cast<MystAreaImageSwitch *>(_vm->_resources[8]); + _soundReceiverAngle1 = static_cast<MystAreaImageSwitch *>(_vm->_resources[10]); + _soundReceiverAngle2 = static_cast<MystAreaImageSwitch *>(_vm->_resources[11]); + _soundReceiverAngle3 = static_cast<MystAreaImageSwitch *>(_vm->_resources[12]); + _soundReceiverAngle4 = static_cast<MystAreaImageSwitch *>(_vm->_resources[13]); uint16 currentSource = _state.soundReceiverCurrentSource; _soundReceiverPosition = &_state.soundReceiverPositions[currentSource]; @@ -1084,31 +1084,31 @@ void Selenitic::o_soundLock_init(uint16 op, uint16 var, uint16 argc, uint16 *arg debugC(kDebugScript, "Opcode %d: Sound lock init", op); for (uint i = 0; i < _vm->_resources.size(); i++) { - if (_vm->_resources[i]->type == kMystSlider) { - switch (_vm->_resources[i]->getType8Var()) { + if (_vm->_resources[i]->type == kMystAreaSlider) { + switch (_vm->_resources[i]->getImageSwitchVar()) { case 20: - _soundLockSlider1 = static_cast<MystResourceType10 *>(_vm->_resources[i]); + _soundLockSlider1 = static_cast<MystAreaSlider *>(_vm->_resources[i]); _soundLockSlider1->setStep(_state.soundLockSliderPositions[0]); break; case 21: - _soundLockSlider2 = static_cast<MystResourceType10 *>(_vm->_resources[i]); + _soundLockSlider2 = static_cast<MystAreaSlider *>(_vm->_resources[i]); _soundLockSlider2->setStep(_state.soundLockSliderPositions[1]); break; case 22: - _soundLockSlider3 = static_cast<MystResourceType10 *>(_vm->_resources[i]); + _soundLockSlider3 = static_cast<MystAreaSlider *>(_vm->_resources[i]); _soundLockSlider3->setStep(_state.soundLockSliderPositions[2]); break; case 23: - _soundLockSlider4 = static_cast<MystResourceType10 *>(_vm->_resources[i]); + _soundLockSlider4 = static_cast<MystAreaSlider *>(_vm->_resources[i]); _soundLockSlider4->setStep(_state.soundLockSliderPositions[3]); break; case 24: - _soundLockSlider5 = static_cast<MystResourceType10 *>(_vm->_resources[i]); + _soundLockSlider5 = static_cast<MystAreaSlider *>(_vm->_resources[i]); _soundLockSlider5->setStep(_state.soundLockSliderPositions[4]); break; } - } else if (_vm->_resources[i]->type == kMystConditionalImage && _vm->_resources[i]->getType8Var() == 28) { - _soundLockButton = static_cast<MystResourceType8 *>(_vm->_resources[i]); + } else if (_vm->_resources[i]->type == kMystAreaImageSwitch && _vm->_resources[i]->getImageSwitchVar() == 28) { + _soundLockButton = static_cast<MystAreaImageSwitch *>(_vm->_resources[i]); } } @@ -1116,11 +1116,11 @@ void Selenitic::o_soundLock_init(uint16 op, uint16 var, uint16 argc, uint16 *arg } void Selenitic::o_mazeRunnerRight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - _mazeRunnerRightButton = static_cast<MystResourceType8 *>(_invokingResource); + _mazeRunnerRightButton = static_cast<MystAreaImageSwitch *>(_invokingResource); } void Selenitic::o_mazeRunnerLeft_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - _mazeRunnerLeftButton = static_cast<MystResourceType8 *>(_invokingResource); + _mazeRunnerLeftButton = static_cast<MystAreaImageSwitch *>(_invokingResource); } const uint16 Selenitic::_mazeRunnerMap[300][4] = { diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 7654ffd3c4..ffd8941f2c 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -29,7 +29,7 @@ namespace Mohawk { -class MystResourceType8; +class MystAreaImageSwitch; struct MystScriptEntry; namespace MystStacks { @@ -80,40 +80,40 @@ private: bool _soundReceiverRunning; bool _soundReceiverSigmaPressed; // 6 - MystResourceType8 *_soundReceiverSources[5]; // 92 -> 108 - MystResourceType8 *_soundReceiverCurrentSource; // 112 + MystAreaImageSwitch *_soundReceiverSources[5]; // 92 -> 108 + MystAreaImageSwitch *_soundReceiverCurrentSource; // 112 uint16 *_soundReceiverPosition; // 116 uint16 _soundReceiverDirection; // 120 uint16 _soundReceiverSpeed; // 122 uint32 _soundReceiverStartTime; //124 - MystResourceType8 *_soundReceiverViewer; // 128 - MystResourceType8 *_soundReceiverRightButton; // 132 - MystResourceType8 *_soundReceiverLeftButton; // 136 - MystResourceType8 *_soundReceiverAngle1; // 140 - MystResourceType8 *_soundReceiverAngle2; // 144 - MystResourceType8 *_soundReceiverAngle3; // 148 - MystResourceType8 *_soundReceiverAngle4; // 152 - MystResourceType8 *_soundReceiverSigmaButton; // 156 + MystAreaImageSwitch *_soundReceiverViewer; // 128 + MystAreaImageSwitch *_soundReceiverRightButton; // 132 + MystAreaImageSwitch *_soundReceiverLeftButton; // 136 + MystAreaImageSwitch *_soundReceiverAngle1; // 140 + MystAreaImageSwitch *_soundReceiverAngle2; // 144 + MystAreaImageSwitch *_soundReceiverAngle3; // 148 + MystAreaImageSwitch *_soundReceiverAngle4; // 152 + MystAreaImageSwitch *_soundReceiverSigmaButton; // 156 static const uint16 _mazeRunnerMap[300][4]; static const uint8 _mazeRunnerVideos[300][4]; uint16 _mazeRunnerPosition; // 56 uint16 _mazeRunnerDirection; // 58 - MystResourceType8 *_mazeRunnerWindow; // 68 - MystResourceType8 *_mazeRunnerCompass; // 72 - MystResourceType8 *_mazeRunnerLight; // 76 - MystResourceType8 *_mazeRunnerRightButton; // 80 - MystResourceType8 *_mazeRunnerLeftButton; // 84 + MystAreaImageSwitch *_mazeRunnerWindow; // 68 + MystAreaImageSwitch *_mazeRunnerCompass; // 72 + MystAreaImageSwitch *_mazeRunnerLight; // 76 + MystAreaImageSwitch *_mazeRunnerRightButton; // 80 + MystAreaImageSwitch *_mazeRunnerLeftButton; // 84 bool _mazeRunnerDoorOpened; // 160 uint16 _soundLockSoundId; - MystResourceType10 *_soundLockSlider1; // 164 - MystResourceType10 *_soundLockSlider2; // 168 - MystResourceType10 *_soundLockSlider3; // 172 - MystResourceType10 *_soundLockSlider4; // 176 - MystResourceType10 *_soundLockSlider5; // 180 - MystResourceType8 *_soundLockButton; // 184 + MystAreaSlider *_soundLockSlider1; // 164 + MystAreaSlider *_soundLockSlider2; // 168 + MystAreaSlider *_soundLockSlider3; // 172 + MystAreaSlider *_soundLockSlider4; // 176 + MystAreaSlider *_soundLockSlider5; // 180 + MystAreaImageSwitch *_soundLockButton; // 184 void soundReceiverLeftRight(uint direction); void soundReceiverUpdate(); @@ -125,8 +125,8 @@ private: void soundReceiverSolution(uint16 source, uint16 &solution, bool &enabled); uint16 soundLockCurrentSound(uint16 position, bool pixels); - MystResourceType10 *soundLockSliderFromVar(uint16 var); - void soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved); + MystAreaSlider *soundLockSliderFromVar(uint16 var); + void soundLockCheckSolution(MystAreaSlider *slider, uint16 value, uint16 solution, bool &solved); bool mazeRunnerForwardAllowed(uint16 position); void mazeRunnerUpdateCompass(); diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index 1113ceeac9..d20ed32321 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -402,9 +402,9 @@ void Stoneship::o_pumpTurnOff(uint16 op, uint16 var, uint16 argc, uint16 *argv) } for (uint i = 0; i < _vm->_resources.size(); i++) { - MystResource *resource = _vm->_resources[i]; - if (resource->type == kMystConditionalImage && resource->getType8Var() == buttonVar) { - static_cast<MystResourceType8 *>(resource)->drawConditionalDataToScreen(0, true); + MystArea *resource = _vm->_resources[i]; + if (resource->type == kMystAreaImageSwitch && resource->getImageSwitchVar() == buttonVar) { + static_cast<MystAreaImageSwitch *>(resource)->drawConditionalDataToScreen(0, true); break; } } @@ -437,9 +437,9 @@ void Stoneship::o_cabinBookMovie(uint16 op, uint16 var, uint16 argc, uint16 *arg void Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open drawer", op); - MystResourceType8 *drawer = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); + MystAreaImageSwitch *drawer = static_cast<MystAreaImageSwitch *>(_vm->_resources[argv[0]]); - if (drawer->getType8Var() == 35) { + if (drawer->getImageSwitchVar() == 35) { drawer->drawConditionalDataToScreen(getVar(102), 0); } else { drawer->drawConditionalDataToScreen(0, 0); @@ -466,7 +466,7 @@ void Stoneship::o_telescopeStart(uint16 op, uint16 var, uint16 argc, uint16 *arg void Stoneship::o_telescopeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Telescope move", op); - MystResourceType11 *display = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *display = static_cast<MystAreaDrag *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); // Compute telescope position @@ -489,7 +489,7 @@ void Stoneship::o_telescopeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv void Stoneship::o_generatorStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator start", op); - MystResourceType11 *handle = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *handle = static_cast<MystAreaDrag *>(_invokingResource); uint16 soundId = handle->getList1(0); if (soundId) @@ -504,7 +504,7 @@ void Stoneship::o_generatorStart(uint16 op, uint16 var, uint16 argc, uint16 *arg _batteryNextTime = _vm->_system->getMillis() + 1000; // Start handle movie - MystResourceType6 *movie = static_cast<MystResourceType6 *>(handle->getSubResource(0)); + MystAreaVideo *movie = static_cast<MystAreaVideo *>(handle->getSubResource(0)); movie->playMovie(); soundId = handle->getList2(0); @@ -530,8 +530,8 @@ void Stoneship::o_generatorStop(uint16 op, uint16 var, uint16 argc, uint16 *argv } // Pause handle movie - MystResourceType11 *handle = static_cast<MystResourceType11 *>(_invokingResource); - MystResourceType6 *movie = static_cast<MystResourceType6 *>(handle->getSubResource(0)); + MystAreaDrag *handle = static_cast<MystAreaDrag *>(_invokingResource); + MystAreaVideo *movie = static_cast<MystAreaVideo *>(handle->getSubResource(0)); movie->pauseMovie(true); uint16 soundId = handle->getList3(0); @@ -582,7 +582,7 @@ void Stoneship::batteryDeplete_run() { void Stoneship::o_drawerOpenAchenar(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open drawer", op); - MystResourceType8 *drawer = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); + MystAreaImageSwitch *drawer = static_cast<MystAreaImageSwitch *>(_vm->_resources[argv[0]]); drawer->drawConditionalDataToScreen(0, 0); _vm->_gfx->runTransition(kTransitionTopToBottom, drawer->getRect(), 25, 5); } @@ -617,7 +617,7 @@ void Stoneship::o_hologramSelectionStart(uint16 op, uint16 var, uint16 argc, uin void Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram move", op); - MystResourceType11 *handle = static_cast<MystResourceType11 *>(_invokingResource); + MystAreaDrag *handle = static_cast<MystAreaDrag *>(_invokingResource); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); if (handle->getRect().contains(mouse)) { @@ -822,20 +822,20 @@ void Stoneship::drawerClose(uint16 drawer) { _vm->drawCardBackground(); _vm->drawResourceImages(); - MystResource *res = _vm->_resources[drawer]; + MystArea *res = _vm->_resources[drawer]; _vm->_gfx->runTransition(kTransitionBottomToTop, res->getRect(), 25, 5); } void Stoneship::o_hologramDisplay_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram display init", op); - _hologramDisplay = static_cast<MystResourceType6 *>(_invokingResource); + _hologramDisplay = static_cast<MystAreaVideo *>(_invokingResource); _hologramDisplayPos = 0; } void Stoneship::o_hologramSelection_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram selection init", op); - _hologramSelection = static_cast<MystResourceType6 *>(_invokingResource); + _hologramSelection = static_cast<MystAreaVideo *>(_invokingResource); } void Stoneship::batteryGaugeUpdate() { @@ -856,7 +856,7 @@ void Stoneship::o_battery_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) // Used for Card 2160 (Lighthouse Battery Pack Closeup) debugC(kDebugScript, "Opcode %d: Battery init", op); - _batteryGauge = static_cast<MystResourceType8 *>(_invokingResource); + _batteryGauge = static_cast<MystAreaImageSwitch *>(_invokingResource); batteryGaugeUpdate(); } @@ -1014,7 +1014,7 @@ void Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, uint16 argc, uint16 void Stoneship::o_cloudOrb_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cloud orb init", op); - _cloudOrbMovie = static_cast<MystResourceType6 *>(_invokingResource); + _cloudOrbMovie = static_cast<MystAreaVideo *>(_invokingResource); _cloudOrbSound = argv[0]; _cloudOrbStopSound = argv[1]; } diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index b77776f359..776641a787 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -98,7 +98,7 @@ private: bool _batteryGaugeRunning; uint16 _batteryLastCharge; // 92 - MystResourceType8 *_batteryGauge; // 96 + MystAreaImageSwitch *_batteryGauge; // 96 void batteryGaugeUpdate(); void batteryGauge_run(); @@ -113,8 +113,8 @@ private: void drawerClose(uint16 drawer); uint16 _hologramTurnedOn; // 80 - MystResourceType6 *_hologramDisplay; // 84 - MystResourceType6 *_hologramSelection; // 88 + MystAreaVideo *_hologramDisplay; // 84 + MystAreaVideo *_hologramSelection; // 88 uint16 _hologramDisplayPos; bool _tunnelRunning; @@ -135,7 +135,7 @@ private: void telescope_run(); void telescopeLighthouseDraw(); - MystResourceType6 *_cloudOrbMovie; // 136 + MystAreaVideo *_cloudOrbMovie; // 136 uint16 _cloudOrbSound; // 140 uint16 _cloudOrbStopSound; // 142 |