aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authoruruk2013-08-07 10:30:44 +0200
committeruruk2013-08-07 10:30:44 +0200
commit26b73331375488a0d5c0fa6b7e0f9c49de4e45a1 (patch)
tree07f71fcec5551f2472409ad13b2242b4f12b2555 /engines/avalanche
parentbd516f4244bc4fdf4342dbd1abc0c479270b2ed3 (diff)
downloadscummvm-rg350-26b73331375488a0d5c0fa6b7e0f9c49de4e45a1.tar.gz
scummvm-rg350-26b73331375488a0d5c0fa6b7e0f9c49de4e45a1.tar.bz2
scummvm-rg350-26b73331375488a0d5c0fa6b7e0f9c49de4e45a1.zip
AVALANCHE: Repair parts of the scrolls system, implement the death of Avalot and almost everything connected to it.
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/avalot.cpp102
-rw-r--r--engines/avalanche/lucerna2.cpp15
-rw-r--r--engines/avalanche/scrolls2.cpp61
-rw-r--r--engines/avalanche/timeout2.cpp8
-rw-r--r--engines/avalanche/trip6.cpp7
5 files changed, 98 insertions, 95 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index c403f00a3d..3f4c545e9d 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -161,58 +161,60 @@ void Avalot::handleKeyDown(Common::Event &event) {
//
// To be implemented later with the sounds, I assume.
- switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
- case Common::KEYCODE_KP8:
- event.kbd.keycode = Common::KEYCODE_UP;
- break;
- case Common::KEYCODE_KP2:
- event.kbd.keycode = Common::KEYCODE_DOWN;
- break;
- case Common::KEYCODE_KP6:
- event.kbd.keycode = Common::KEYCODE_RIGHT;
- break;
- case Common::KEYCODE_KP4:
- event.kbd.keycode = Common::KEYCODE_LEFT;
- break;
- case Common::KEYCODE_KP9:
- event.kbd.keycode = Common::KEYCODE_PAGEUP;
- break;
- case Common::KEYCODE_KP3:
- event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
- break;
- case Common::KEYCODE_KP7:
- event.kbd.keycode = Common::KEYCODE_HOME;
- break;
- case Common::KEYCODE_KP1:
- event.kbd.keycode = Common::KEYCODE_END;
- break;
- }
-
- switch (event.kbd.keycode) {
- case Common::KEYCODE_UP:
- case Common::KEYCODE_DOWN:
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_PAGEUP:
- case Common::KEYCODE_PAGEDOWN:
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_END:
- case Common::KEYCODE_KP5:
- _vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
- _vm->_lucerna->showrw();
- if (_vm->_gyro->demo)
- _vm->_basher->get_demorec();
- return;
- case Common::KEYCODE_BACKSPACE:
- _vm->_parser->handleBackspace();
- break;
- case Common::KEYCODE_RETURN:
- _vm->_parser->handleReturn();
- break;
- }
-
if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
_vm->_parser->handleInputText(event);
+ else
+ switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
+ case Common::KEYCODE_KP8:
+ event.kbd.keycode = Common::KEYCODE_UP;
+ break;
+ case Common::KEYCODE_KP2:
+ event.kbd.keycode = Common::KEYCODE_DOWN;
+ break;
+ case Common::KEYCODE_KP6:
+ event.kbd.keycode = Common::KEYCODE_RIGHT;
+ break;
+ case Common::KEYCODE_KP4:
+ event.kbd.keycode = Common::KEYCODE_LEFT;
+ break;
+ case Common::KEYCODE_KP9:
+ event.kbd.keycode = Common::KEYCODE_PAGEUP;
+ break;
+ case Common::KEYCODE_KP3:
+ event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
+ break;
+ case Common::KEYCODE_KP7:
+ event.kbd.keycode = Common::KEYCODE_HOME;
+ break;
+ case Common::KEYCODE_KP1:
+ event.kbd.keycode = Common::KEYCODE_END;
+ break;
+ }
+
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP5:
+ if (_vm->_gyro->alive) {
+ _vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
+ _vm->_lucerna->showrw();
+ if (_vm->_gyro->demo)
+ _vm->_basher->get_demorec();
+ return;
+ }
+ case Common::KEYCODE_BACKSPACE:
+ _vm->_parser->handleBackspace();
+ break;
+ case Common::KEYCODE_RETURN:
+ _vm->_parser->handleReturn();
+ break;
+ }
_vm->_lucerna->showrw();
if (_vm->_gyro->demo)
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 29f93c7d42..b78c8ce51d 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -1127,16 +1127,19 @@ void Lucerna::gameover() {
_vm->_gyro->dna.user_moves_avvy = false;
- sx = _vm->_trip->tr[1].x;
- sy = _vm->_trip->tr[1].y;
+ sx = _vm->_trip->tr[0].x;
+ sy = _vm->_trip->tr[0].y;
- _vm->_trip->tr[1].done();
- _vm->_trip->tr[1].init(12, true, _vm->_trip); /* 12 = Avalot falls */
- _vm->_trip->tr[1].step = 0;
- _vm->_trip->tr[1].appear(sx, sy, 0);
+ _vm->_trip->tr[0].done();
+ _vm->_trip->tr[0].init(12, true, _vm->_trip); /* 12 = Avalot falls */
+ _vm->_trip->tr[0].step = 0;
+ _vm->_trip->tr[0].appear(sx, sy, 0);
_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
+
/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
+ warning("STUB: Timeout::avalot_falls()");
+
_vm->_gyro->alive = false;
}
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 8cf0ffff35..6b21a99f8a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -329,6 +329,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
blockread(f, mem[0xa000 * st + (fv * 80)], xl);
}
bit = getpixel(0, 0);*/
+
warning("STUB: Scrolls::block_drop()");
f.close();
@@ -360,7 +361,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
if ((1 <= use_icon) && (use_icon <= 34))
lx += halficonwidth;
-
_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
@@ -377,9 +377,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
- /*_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
- _vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly, lightgray);
- _vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);*/
/*setfillstyle(1, 8);
pieslice(mx - lx - 31, my - ly, 360, 180, 15);
@@ -390,10 +387,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
- /*_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
- _vm->_graphics->drawBar(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7, red);
- _vm->_graphics->drawBar(mx - lx - 15, my - ly, mx - lx - 14, my + ly, red);
- _vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);*/
ex = mx - lx;
ey = my - ly;
@@ -425,29 +418,30 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
for (b = 0; b <= _vm->_gyro->scrolln; b++) {
- switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
- case kControlCenter: {
- centre = true;
- _vm->_gyro->scroll[b].deleteLastChar();
- }
- break;
- case kControlLeftJustified: {
- centre = false;
- _vm->_gyro->scroll[b].deleteLastChar();
- }
- break;
- case kControlQuestion: {
- //settextjustify(1, 1);
- dix = mx + lx;
- diy = my + ly;
- _vm->_gyro->scroll[b].setChar(' ', 0);
- groi = *_vm->_graphics->getPixel(0, 0);
- // inc(diy,14);
- _vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
- _vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+ if (!_vm->_gyro->scroll[b].empty())
+ switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
+ case kControlCenter: {
+ centre = true;
+ _vm->_gyro->scroll[b].deleteLastChar();
+ }
+ break;
+ case kControlLeftJustified: {
+ centre = false;
+ _vm->_gyro->scroll[b].deleteLastChar();
+ }
+ break;
+ case kControlQuestion: {
+ //settextjustify(1, 1);
+ dix = mx + lx;
+ diy = my + ly;
+ _vm->_gyro->scroll[b].setChar(' ', 0);
+ groi = *_vm->_graphics->getPixel(0, 0);
+ // inc(diy,14);
+ _vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
+ _vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
+ }
+ break;
}
- break;
- }
if (centre)
say(320 - _vm->_gyro->scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->scroll[b]);
@@ -586,9 +580,9 @@ void Scrolls::calldrivers() {
if (_vm->_gyro->buffer[fv] == kControlRegister)
param = 0;
else
- if (('0' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < '9'))
+ if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
param = _vm->_gyro->buffer[fv] - 48;
- else if (('A' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < 'Z'))
+ else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
param = _vm->_gyro->buffer[fv] - 55;
mouthnext = false;
@@ -748,7 +742,8 @@ void Scrolls::calldrivers() {
mouthnext = true;
break;
case kControlInsertSpaces:
- for (nn = 0; nn < 9; nn++) _vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + ' ';
+ for (nn = 0; nn < 9; nn++)
+ _vm->_gyro->scroll[_vm->_gyro->scrolln] += ' ';
break;
default: { // Add new char.
if (_vm->_gyro->scroll[_vm->_gyro->scrolln].size() == 50) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index e23114dccb..692d7320f3 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -625,11 +625,13 @@ void Timeout::winning() {
}
void Timeout::avalot_falls() {
- if (_vm->_trip->tr[1].step < 5) {
- _vm->_trip->tr[1].step += 1;
+ if (_vm->_trip->tr[0].step < 5) {
+ _vm->_trip->tr[0].step += 1;
set_up_timer(3, procavalot_falls, reason_falling_over);
} else
- _vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+ //_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
+
+ warning("STUB: Timeout::avalot_falls()");
}
void Timeout::spludwick_goes_to_cauldron() {
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 26530a5cb7..dcdd807b3b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -426,13 +426,14 @@ triptype *triptype::done() {
uint16 soa;
/* nds:=num div seq;*/
+ totalnum--;
_info.xw = _info.xl / 8;
if ((_info.xl % 8) > 0)
_info.xw += 1;
- for (aa = 1; aa <= /*nds*seq*/ a.num; aa++) {
+ for (aa = 0; aa < /*nds*seq*/ a.num; aa++) {
totalnum--;
- free(_info.mani[totalnum]);
- free(_info.sil[totalnum]); /* <<- Width of a siltype. */
+ delete _info.mani[totalnum];
+ delete _info.sil[totalnum];
}
quick = false;