aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-09-02 15:44:55 +0200
committeruruk2013-09-02 15:44:55 +0200
commit9e848e8e64103406a7e356081f18d9c597b0018d (patch)
tree37ccd57e6cde4b687c868fb24127cb8ecb555c26 /engines
parentcf5f150d9b4d00ee16b0ee51861a4386b35f9626 (diff)
downloadscummvm-rg350-9e848e8e64103406a7e356081f18d9c597b0018d.tar.gz
scummvm-rg350-9e848e8e64103406a7e356081f18d9c597b0018d.tar.bz2
scummvm-rg350-9e848e8e64103406a7e356081f18d9c597b0018d.zip
AVALANCHE: Upgrade drop-down menu. (Now it's complete.) Fix Trip::neardoor().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/avalanche.cpp2
-rw-r--r--engines/avalanche/dropdown2.cpp15
-rw-r--r--engines/avalanche/trip6.cpp4
3 files changed, 14 insertions, 7 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 0c5869efbe..73b39d6407 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -532,7 +532,7 @@ void AvalancheEngine::updateEvents() {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
- _lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::checkclick().
+ _lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick() and Dropdown::menu_link().
break;
case Common::EVENT_LBUTTONUP:
_lucerna->holdLeftMouse = false; // Same as above.
diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp
index 4647f5947a..baf1e94edf 100644
--- a/engines/avalanche/dropdown2.cpp
+++ b/engines/avalanche/dropdown2.cpp
@@ -863,7 +863,8 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
if (_vm->_lucerna->holdLeftMouse) {
if (cursorPos.y > 21) {
if (!((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
- && (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) { // Clicked OUTSIDE the menu.
+ && (cursorPos.y >= 24) && (cursorPos.y <= (ddm_o.fly * 2 + 1))))) {
+ // Clicked OUTSIDE the menu.
if (ddm_o.menunow) {
ddm_o.wipe();
_vm->_lucerna->holdLeftMouse = false;
@@ -874,9 +875,16 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
// Clicked on menu bar.
if (ddm_o.menunow) {
ddm_o.wipe();
- _vm->_lucerna->holdLeftMouse = true;
_vm->_graphics->_surface.copyFrom(backup);
_vm->_graphics->refreshScreen();
+ _vm->_lucerna->holdLeftMouse = true;
+
+ if (((ddm_o.left * 8) <= cursorPos.x) && (cursorPos.x <= (ddm_o.left * 8 + 80))) { // 80: the width of one menu item on the bar in pixels.
+ // If we clicked on the same menu item on the bar...
+ _vm->_lucerna->holdLeftMouse = false;
+ return;
+ }
+
break;
}
}
@@ -885,8 +893,7 @@ void Dropdown::menu_link() { // TODO: Optimize it ASAP!!! It really needs it...
if ((ddm_o.firstlix) && ((cursorPos.x >= ddm_o.flx1 * 8) && (cursorPos.x <= ddm_o.flx2 * 8)
&& (cursorPos.y >= 12) && (cursorPos.y <= (ddm_o.fly * 2 + 1)))) {
- // We act only if the button is relased over a menu item.
- Common::Event event;
+ // We act only if the button is released over a menu item.
while (!_vm->shouldQuit()) {
cursorPos = _vm->getMousePos();
ddm_o.lightup(cursorPos);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index f83bfc07b9..5e42839e93 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1573,7 +1573,7 @@ bool Trip::infield(byte which) {
}
bool Trip::neardoor() {
- if (_vm->_gyro->numfields < 9) {
+ if (_vm->_gyro->numfields < 8) {
/* there ARE no doors here! */
return false;
}
@@ -1581,7 +1581,7 @@ bool Trip::neardoor() {
int16 ux = tr[0].x;
int16 uy = tr[0].y + tr[0]._info.yl;
bool nd = false;
- for (byte fv = 9; fv <= _vm->_gyro->numfields; fv++)
+ for (byte fv = 8; fv < _vm->_gyro->numfields; fv++)
if ((ux >= _vm->_gyro->fields[fv].x1) && (ux <= _vm->_gyro->fields[fv].x2)
&& (uy >= _vm->_gyro->fields[fv].y1) && (uy <= _vm->_gyro->fields[fv].y2))
nd = true;