diff options
author | Strangerke | 2015-01-17 14:26:56 +0100 |
---|---|---|
committer | Strangerke | 2015-01-17 14:26:56 +0100 |
commit | c4e8460ba2a82560a29f32a08f31580befba78c1 (patch) | |
tree | 6b0ebf19648f9974a592024d1aaa6fe5355d3179 /engines | |
parent | 27a9a046153c20d664394079f123f46a7ccde470 (diff) | |
download | scummvm-rg350-c4e8460ba2a82560a29f32a08f31580befba78c1.tar.gz scummvm-rg350-c4e8460ba2a82560a29f32a08f31580befba78c1.tar.bz2 scummvm-rg350-c4e8460ba2a82560a29f32a08f31580befba78c1.zip |
ACCESS: MM - Fix a bug related to the down arrow, some refactoring and renaming
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/access.cpp | 2 | ||||
-rw-r--r-- | engines/access/access.h | 2 | ||||
-rw-r--r-- | engines/access/bubble_box.cpp | 21 | ||||
-rw-r--r-- | engines/access/bubble_box.h | 2 |
4 files changed, 13 insertions, 14 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp index d0b2b78fe4..8e9d52f3c4 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -105,8 +105,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) BOXSELECTY = 0; BOXSELECTYOLD = -1; NUMBLINES = 0; - _word234F3 = _word234F7 = _word234F5 = _word234F9 = 0; - _word234FB = _word234FF = _word234FD = _word23501 = 0; TEMPLIST = nullptr; _vidEnd = false; diff --git a/engines/access/access.h b/engines/access/access.h index 90c3d1fa3c..176fb648c7 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -223,8 +223,6 @@ public: int NUMBLINES; byte _byte26CB5; int BCNT; - int _word234F3, _word234F7, _word234F5, _word234F9; - int _word234FB, _word234FF, _word234FD, _word23501; byte *TEMPLIST; // diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp index e55f7f8564..21e2501694 100644 --- a/engines/access/bubble_box.cpp +++ b/engines/access/bubble_box.cpp @@ -44,6 +44,8 @@ BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w _tempList[i] = ""; _tempListIdx[i] = 0; } + _btnUpPos = Common::Rect(0, 0, 0, 0); + _btnDownPos = Common::Rect(0, 0, 0, 0); } void BubbleBox::load(Common::SeekableReadStream *stream) { @@ -490,8 +492,8 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { _vm->_screen->_orgY2 -= 8; _vm->_screen->_orgY2 -= 8; - _vm->_word234F7 = _vm->_word234FF = _vm->_screen->_orgX2; - _vm->_word234F3 = _vm->_word234FB = _vm->_screen->_orgX1 = _vm->_screen->_orgX2 - 8; + _btnUpPos.right = _btnDownPos.right = _vm->_screen->_orgX2; + _btnUpPos.left = _btnDownPos.left = _vm->_screen->_orgX1 = _vm->_screen->_orgX2 - 8; BOXENDX = _vm->_screen->_orgX1 - 1; _vm->_screen->drawBox(); @@ -499,10 +501,11 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { _vm->_screen->_orgY2 -= 6; _vm->_screen->drawBox(); - _vm->_word234F9 = _vm->_screen->_orgY1 + 1; - _vm->_word234F5 = _vm->_word234F9 - 5; - _vm->_word234FD = _vm->_screen->_orgY2 + 1; - _vm->_word23501 = _vm->_word234FD - 6; + _btnUpPos.bottom = _vm->_screen->_orgY1 + 1; + _btnUpPos.top = _btnUpPos.bottom - 5; + _btnDownPos.top = _vm->_screen->_orgY2 + 1; + _btnDownPos.bottom = _btnDownPos.top + 6; + _vm->_screen->_orgX1 += 4; _vm->_screen->_orgX2 = _vm->_screen->_orgX1; _vm->_screen->_orgY1 -= 4; @@ -619,8 +622,7 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { if ((_type != TYPE_1) && (_vm->_timers[2]._flag == 0)) { ++_vm->_timers[2]._flag; - if ((_vm->_events->_mousePos.x >= _vm->_word234F3) && (_vm->_events->_mousePos.x <= _vm->_word234F7) - && (_vm->_events->_mousePos.y >= _vm->_word234F5) && (_vm->_events->_mousePos.y < _vm->_word234F9)) { + if (_btnUpPos.contains(_vm->_events->_mousePos)) { if (_vm->BCNT) { if (_vm->BOXSELECTY != 0) { --_vm->BOXSELECTY; @@ -632,8 +634,7 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) { } } continue; - } else if ((_vm->_events->_mousePos.x >= _vm->_word234FB) && (_vm->_events->_mousePos.x <= _vm->_word234FF) - && (_vm->_events->_mousePos.y >= _vm->_word234FD) && (_vm->_events->_mousePos.y < _vm->_word23501)) { + } else if (_btnDownPos.contains(_vm->_events->_mousePos)) { if (_vm->BCNT) { if (_vm->BCNT == _vm->NUMBLINES) { if (_vm->BCNT != _vm->BOXSELECTY + 1) { diff --git a/engines/access/bubble_box.h b/engines/access/bubble_box.h index 5697c7397b..dd6a043a55 100644 --- a/engines/access/bubble_box.h +++ b/engines/access/bubble_box.h @@ -65,6 +65,8 @@ public: int _btnX2; int _btnId3; int _btnX3; + Common::Rect _btnUpPos; + Common::Rect _btnDownPos; Common::Array<Common::Rect> _bubbles; public: |