aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authoruruk2013-08-16 23:02:53 +0200
committeruruk2013-08-16 23:02:53 +0200
commit05f3838b16a5e9533c2a0faeb18dfc50610eface (patch)
treee3ca80eb24589030893b7a0d56557aa2c10b5567 /engines/avalanche
parent2bcca8a0dd17f4ae55ff4587a54c63d60a021b03 (diff)
downloadscummvm-rg350-05f3838b16a5e9533c2a0faeb18dfc50610eface.tar.gz
scummvm-rg350-05f3838b16a5e9533c2a0faeb18dfc50610eface.tar.bz2
scummvm-rg350-05f3838b16a5e9533c2a0faeb18dfc50610eface.zip
AVALANCHE: Partially implement Lucerna::checkclick(), upgrade other parts of the code during the process. Repair Gyro::load_a_mouse().
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/avalanche.cpp6
-rw-r--r--engines/avalanche/gyro2.cpp2
-rw-r--r--engines/avalanche/lucerna2.cpp103
-rw-r--r--engines/avalanche/lucerna2.h6
-rw-r--r--engines/avalanche/scrolls2.cpp1
5 files changed, 117 insertions, 1 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 8196065bef..c2d0e0bd59 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -137,6 +137,12 @@ void AvalancheEngine::updateEvents() {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
+ case Common::EVENT_LBUTTONDOWN:
+ _lucerna->holdLeftMouse = true; // Used in Lucerna::checkclick().
+ break;
+ case Common::EVENT_LBUTTONUP:
+ _lucerna->holdLeftMouse = false; // Same as above.
+ break;
case Common::EVENT_KEYDOWN:
_avalot->handleKeyDown(event);
}
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index fa95a538c7..5278a3dc76 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -549,7 +549,7 @@ void Gyro::load_a_mouse(byte which) {
- CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which].horzhotspot, mps[which].verthotspot, 255, false);
+ CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which - 1].horzhotspot, mps[which - 1].verthotspot * 2, 255, false);
cursor.free();
}
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 340116b8b3..8dfb78ab8c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -978,6 +978,109 @@ void Lucerna::verte() {
}
void Lucerna::checkclick() {
+ bytefield b;
+
+ Common::Point cursorPos = _vm->getMousePos();
+ _vm->_gyro->ontoolbar = _vm->_gyro->slow_computer && ((cursorPos.y >= 169) || (cursorPos.y <= 10));
+
+ if (_vm->_gyro->mrelease > 0)
+ _vm->_gyro->after_the_scroll = false;
+
+ if ((0 <= cursorPos.y) && (cursorPos.y <= 21))
+ _vm->_gyro->newpointer(1); // up arrow
+ else if ((317 <= cursorPos.y) && (cursorPos.y <= 339))
+ _vm->_gyro->newpointer(8); //I-beam
+ else if ((340 <= cursorPos.y) && (cursorPos.y <= 399))
+ _vm->_gyro->newpointer(2); // screwdriver
+ else if (!_vm->_gyro->ddmnow) { // Dropdown can handle its own pointers.
+ if (holdLeftMouse) {
+ _vm->_gyro->newpointer(7); // Mark's crosshairs
+ verte(); // Normally, if you click on the picture, you're guiding Avvy around.
+ } else
+ _vm->_gyro->newpointer(4); // fletch
+ }
+
+
+
+ //if (_vm->_gyro->mpress > 0) {
+ // switch (_vm->_gyro->mpy) {
+ // case RANGE_11(0, 10):
+ // if (_vm->_gyro->dropsok) topcheck();
+ // break;
+ // case 11 ... 158:
+ // if (!_vm->_gyro->dropsok)
+ // _vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
+ // break; /* But otherwise, it's
+ // equivalent to pressing Enter. */
+ // case RANGE_11(159, 169): { /* Click on command line */
+ // cursor_off();
+ // curpos = (_vm->_gyro->mx - 16) / 8;
+ // if (curpos > length(current) + 1)
+ // curpos = length(current) + 1;
+ // if (curpos < 1)
+ // curpos = 1;
+ // cursor_on();
+ // }
+ // break;
+ // case 170 ... 200:
+ // switch (_vm->_gyro->mpx) { /* bottom check */
+ // case 0 ... 207:
+ // mouseway();
+ // break;
+ // case 208 ... 260: { /* Examine the thing */
+ // do {
+ // _vm->_gyro->check();
+ // } while (!(_vm->_gyro->mrelease > 0));
+ // if (_vm->_gyro->thinkthing) {
+ // _vm->_acci->thing = _vm->_gyro->thinks;
+ // _vm->_acci->thing += 49;
+ // _vm->_acci->person = _vm->_acci->pardon;
+ // } else {
+ // _vm->_acci->person = _vm->_gyro->thinks;
+ // _vm->_acci->thing = _vm->_acci->pardon;
+ // }
+ // callverb(_vm->_acci->vb_exam);
+ // }
+ // break;
+ // case 261 ... 319: {
+ // do {
+ // checkclick();
+ // } while (!(_vm->_gyro->mrelease > 0));
+ // callverb(_vm->_acci->vb_score);
+ // }
+ // break;
+ // case 320 ... 357: {
+ // _vm->_trip->tr[0].xs = _vm->_gyro->walk;
+ // _vm->_trip->newspeed();
+ // }
+ // break;
+ // case 358 ... 395: {
+ // _vm->_trip->tr[0].xs = _vm->_gyro->run;
+ // _vm->_trip->newspeed();
+ // }
+ // break;
+ // case 396 ... 483:
+ // fxtoggle();
+ // break; /* "sound" */
+ // /* 484..534: begin { clock }
+ // off; if getpixel(mx,my)=14 then mousetext:='#'+mousetext; on;
+ // end;*/
+ // case 535 ... 640:
+ // _vm->_gyro->mousetext = Common::String('\15') + _vm->_gyro->mousetext;
+ // break;
+ // }
+ // break;
+ // }
+ //}
+
+ /* if mrelease>0 then
+ begin
+ if (cw<>177) and (mry>10) then
+ begin to_do:=(((mrx-20) div 100)*20)+(mry div 10); closewin; end;
+ end;*/
+
+
+
warning("STUB: Lucerna::checkclick()");
}
diff --git a/engines/avalanche/lucerna2.h b/engines/avalanche/lucerna2.h
index 4cee781fd6..b422f74c39 100644
--- a/engines/avalanche/lucerna2.h
+++ b/engines/avalanche/lucerna2.h
@@ -38,6 +38,10 @@ class AvalancheEngine;
class Lucerna {
public:
+ bool holdLeftMouse;
+
+
+
Lucerna(AvalancheEngine *vm);
void init();
@@ -134,6 +138,8 @@ private:
Common::File f;
+
+
Common::String nextstring();
void scram1(Common::String &x);
void unscramble();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 1457503a98..d141edc101 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -213,6 +213,7 @@ void Scrolls::normscroll() {
_vm->_gyro->seescroll = false;
_vm->_lucerna->mousepage(_vm->_gyro->cp);
CursorMan.showMouse(false);
+ _vm->_lucerna->holdLeftMouse = false; // Used in Lucerna::checkclick().
warning("STUB: Scrolls::normscroll()");
}