diff options
author | Bastien Bouclet | 2018-05-27 20:39:26 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-06-13 07:55:55 +0200 |
commit | 13b3371f1af143a319656bf476712abf41ee613b (patch) | |
tree | ae4c51e877e2627358c12a6431931c56bd905d1c /engines/mohawk/myst_areas.cpp | |
parent | e3972150482531fdeea16609680fa6db1209c6ac (diff) | |
download | scummvm-rg350-13b3371f1af143a319656bf476712abf41ee613b.tar.gz scummvm-rg350-13b3371f1af143a319656bf476712abf41ee613b.tar.bz2 scummvm-rg350-13b3371f1af143a319656bf476712abf41ee613b.zip |
MOHAWK: MYST: Extract a Card class out of the main engine class
This is to allow having multiple cards loaded at the same time in the
future.
Diffstat (limited to 'engines/mohawk/myst_areas.cpp')
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index eff51bf1c9..2d2d3467a9 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -21,6 +21,7 @@ */ #include "mohawk/myst_areas.h" +#include "mohawk/myst_card.h" #include "mohawk/myst_graphics.h" #include "mohawk/myst_scripts.h" #include "mohawk/myst_sound.h" @@ -152,11 +153,11 @@ void MystAreaAction::handleMouseUp() { const Common::String MystAreaAction::describe() { Common::String desc = MystArea::describe(); - if (_script->size() != 0) { + if (!_script.empty()) { desc += " ops:"; - for (uint i = 0; i < _script->size(); i++) - desc += " " + _vm->_scriptParser->getOpcodeDesc((*_script)[i].opcode); + for (uint i = 0; i < _script.size(); i++) + desc += " " + _vm->_scriptParser->getOpcodeDesc(_script[i].opcode); } return desc; @@ -419,7 +420,7 @@ void MystAreaImageSwitch::drawDataToScreen() { // This special case means redraw background if (imageToDraw == 0xFFFF) - imageToDraw = _vm->getCardBackgroundId(); + imageToDraw = _vm->getCard()->getBackgroundImageId(); _vm->_gfx->copyImageSectionToBackBuffer(imageToDraw, _subImages[subImageId].rect, _rect); } @@ -448,7 +449,7 @@ void MystAreaImageSwitch::drawConditionalDataToScreen(uint16 state, bool update) // This special case means redraw background if (imageToDraw == 0xFFFF) - imageToDraw = _vm->getCardBackgroundId(); + imageToDraw = _vm->getCard()->getBackgroundImageId(); // Draw to screen if (update) { @@ -542,7 +543,7 @@ void MystAreaSlider::restoreBackground() { Common::Rect dest = boundingBox(); src.top = 332 - dest.bottom; src.bottom = 332 - dest.top; - _vm->_gfx->copyImageSectionToScreen(_vm->getCardBackgroundId(), src, dest); + _vm->_gfx->copyImageSectionToScreen(_vm->getCard()->getBackgroundImageId(), src, dest); } void MystAreaSlider::handleMouseDown() { |