aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorBastien Bouclet2016-02-06 12:57:03 +0100
committerBastien Bouclet2016-02-07 15:27:03 +0100
commit085f3700f7cd6ddb23abe3719ca21b7025695da4 (patch)
treeaaee4b1035a9add41cb9f88bf3aa6cd705b46aec /engines/mohawk/myst_stacks
parent0c8d8bbd40e4806e1b63196e283bcbff21431080 (diff)
downloadscummvm-rg350-085f3700f7cd6ddb23abe3719ca21b7025695da4.tar.gz
scummvm-rg350-085f3700f7cd6ddb23abe3719ca21b7025695da4.tar.bz2
scummvm-rg350-085f3700f7cd6ddb23abe3719ca21b7025695da4.zip
MOHAWK: Make MystResourceType8::_subImages private
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp40
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp7
2 files changed, 23 insertions, 24 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index c449cccbf9..c5f76fe54d 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -2302,14 +2302,14 @@ void Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv)
MystResourceType11 *key = static_cast<MystResourceType11 *>(_invokingResource);
// What the hell??
- Common::Rect src = key->_subImages[1].rect;
- Common::Rect rect = key->_subImages[0].rect;
+ Common::Rect src = key->getSubImage(1).rect;
+ Common::Rect rect = key->getSubImage(0).rect;
Common::Rect dest = rect;
dest.top = 332 - rect.bottom;
dest.bottom = 332 - rect.top;
// Draw pressed piano key
- _vm->_gfx->copyImageSectionToScreen(key->_subImages[1].wdib, src, dest);
+ _vm->_gfx->copyImageSectionToScreen(key->getSubImage(0).wdib, src, dest);
_vm->_system->updateScreen();
// Play note
@@ -2328,27 +2328,27 @@ void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
// Unpress previous key
MystResourceType11 *key = static_cast<MystResourceType11 *>(_invokingResource);
- Common::Rect src = key->_subImages[0].rect;
+ Common::Rect src = key->getSubImage(0).rect;
Common::Rect dest = src;
dest.top = 332 - src.bottom;
dest.bottom = 332 - src.top;
// Draw unpressed piano key
- _vm->_gfx->copyImageSectionToScreen(key->_subImages[0].wdib, src, dest);
+ _vm->_gfx->copyImageSectionToScreen(key->getSubImage(0).wdib, src, dest);
if (piano.contains(mouse)) {
MystResource *resource = _vm->updateCurrentResource();
if (resource && resource->type == kMystDragArea) {
// Press new key
key = static_cast<MystResourceType11 *>(resource);
- src = key->_subImages[1].rect;
- Common::Rect rect = key->_subImages[0].rect;
+ src = key->getSubImage(1).rect;
+ Common::Rect rect = key->getSubImage(0).rect;
dest = rect;
dest.top = 332 - rect.bottom;
dest.bottom = 332 - rect.top;
// Draw pressed piano key
- _vm->_gfx->copyImageSectionToScreen(key->_subImages[1].wdib, src, dest);
+ _vm->_gfx->copyImageSectionToScreen(key->getSubImage(1).wdib, src, dest);
// Play note
if (_state.generatorVoltage == 59 && !_state.generatorBreakers) {
@@ -2370,13 +2370,13 @@ void Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
MystResourceType8 *key = static_cast<MystResourceType8 *>(_invokingResource);
- Common::Rect &src = key->_subImages[0].rect;
+ Common::Rect src = key->getSubImage(0).rect;
Common::Rect dest = src;
dest.top = 332 - src.bottom;
dest.bottom = 332 - src.top;
// Draw unpressed piano key
- _vm->_gfx->copyImageSectionToScreen(key->_subImages[0].wdib, src, dest);
+ _vm->_gfx->copyImageSectionToScreen(key->getSubImage(0).wdib, src, dest);
_vm->_system->updateScreen();
_vm->_sound->stopSound();
@@ -3503,18 +3503,14 @@ bool Myst::observatoryIsDDMMYYYY2400() {
}
void Myst::observatoryUpdateVisualizer(uint16 x, uint16 y) {
- Common::Rect &visu0 = _observatoryVisualizer->_subImages[0].rect;
- Common::Rect &visu1 = _observatoryVisualizer->_subImages[1].rect;
-
- visu0.left = x;
- visu0.right = visu0.left + 105;
- visu0.bottom = 512 - y;
- visu0.top = visu0.bottom - 106;
-
- visu1.left = visu0.left;
- visu1.top = visu0.top;
- visu1.right = visu0.right;
- visu1.bottom = visu0.bottom;
+ Common::Rect visu;
+ visu.left = x;
+ visu.right = visu.left + 105;
+ visu.bottom = 512 - y;
+ visu.top = visu.bottom - 106;
+
+ _observatoryVisualizer->setSubImageRect(0, visu);
+ _observatoryVisualizer->setSubImageRect(1, visu);
}
void Myst::observatorySetTargetToSetting() {
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index 0cf89eb0a1..7d1e1b9dff 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -671,9 +671,12 @@ void Selenitic::soundReceiverUpdate() {
void Selenitic::soundReceiverDrawView() {
uint32 left = ((*_soundReceiverPosition) * 1800) / 3600;
- _soundReceiverViewer->_subImages->rect.left = left;
- _soundReceiverViewer->_subImages->rect.right = left + 136;
+ Common::Rect rect = _soundReceiverViewer->getSubImage(0).rect;
+ rect.left = left;
+ rect.right = left + 136;
+
+ _soundReceiverViewer->setSubImageRect(0, rect);
_soundReceiverViewer->drawConditionalDataToScreen(0);
soundReceiverDrawAngle();