aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2013-08-09 03:02:28 +0200
committeruruk2013-08-09 03:02:28 +0200
commit626d8aa8c14f09fc735a50a368fe76130a0e1e87 (patch)
treefb14de1432e84724990940c41935353612627de2
parentad199c4929c9e0e3a3be9097b21338d3617c6f1b (diff)
downloadscummvm-rg350-626d8aa8c14f09fc735a50a368fe76130a0e1e87.tar.gz
scummvm-rg350-626d8aa8c14f09fc735a50a368fe76130a0e1e87.tar.bz2
scummvm-rg350-626d8aa8c14f09fc735a50a368fe76130a0e1e87.zip
AVALANCHE: Implement switching between rooms (Trip::fliproom(), Lucerna::enterroom()), implement drawing multiple sprites to the screen (Trip::call_andexors()).
-rw-r--r--engines/avalanche/graphics.cpp2
-rw-r--r--engines/avalanche/lucerna2.cpp22
-rw-r--r--engines/avalanche/trip6.cpp27
3 files changed, 29 insertions, 22 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index c7774ed362..d6e1eac612 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -97,8 +97,6 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
}
void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
- drawPicture(_background, 0, 10); // TODO: Remove it later, implement otherwise!!! Now it only works with one sprite on the screen.
-
/* First we make the pixels of the spirte blank. */
for (byte qay = 0; qay < sprite.yl; qay++)
for (byte qax = 0; qax < sprite.xl; qax++)
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 740fa8c8e0..a35cc1246c 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -103,11 +103,9 @@ void Lucerna::draw_also_lines() {
_vm->_graphics->_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
_vm->_graphics->_magics.frameRect(Common::Rect(0, 45, 639, 161), 15);
- for (ff = 0; ff < 50; ff++) {
- if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/) {
+ for (ff = 0; ff < 50; ff++)
+ if (_vm->_gyro->lines[ff].x1 != 32767 /*maxint*/)
_vm->_graphics->_magics.drawLine(_vm->_gyro->lines[ff].x1, _vm->_gyro->lines[ff].y1, _vm->_gyro->lines[ff].x2, _vm->_gyro->lines[ff].y2, _vm->_gyro->lines[ff].col);
- }
- }
switch (squeaky_code) {
case 1 :
@@ -434,14 +432,14 @@ void Lucerna::enterroom(byte x, byte ped) {
if (! _vm->_gyro->dna.talked_to_crapulus) {
_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
- _vm->_trip->tr[2].init(8, false, _vm->_trip); /* load Crapulus */
+ _vm->_trip->tr[1].init(8, false, _vm->_trip); /* load Crapulus */
if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
- _vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
- _vm->_trip->tr[2].walkto(5); /* Walks up to greet you. */
+ _vm->_trip->apped(1, 3); /* Start on the right-hand side of the screen. */
+ _vm->_trip->tr[1].walkto(4); /* Walks up to greet you. */
} else {
- _vm->_trip->apped(2, 5); /* Starts where he was before. */
- _vm->_trip->tr[2].face = 3;
+ _vm->_trip->apped(1, 4); /* Starts where he was before. */
+ _vm->_trip->tr[1].face = 3;
}
_vm->_trip->tr[2].call_eachstep = true;
@@ -450,9 +448,9 @@ void Lucerna::enterroom(byte x, byte ped) {
} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
if (_vm->_gyro->dna.crapulus_will_tell) {
- _vm->_trip->tr[2].init(8, false, _vm->_trip);
- _vm->_trip->apped(2, 2);
- _vm->_trip->tr[2].walkto(4);
+ _vm->_trip->tr[1].init(8, false, _vm->_trip);
+ _vm->_trip->apped(1, 1);
+ _vm->_trip->tr[1].walkto(3);
_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
_vm->_gyro->dna.crapulus_will_tell = false;
}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index dcdd807b3b..510d6e5b1f 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -219,7 +219,7 @@ void triptype::walk() {
tc = _tr->checkfeet(x, x + _info.xl, oy[_tr->_vm->_gyro->cp], y, _info.yl) - 1;
// -1 is becouse the modified array indexes of magics[] compared to Pascal .
- if ((tc != 0) & (!_tr->_vm->_gyro->doing_sprite_run)) {
+ if ((tc != 255) & (!_tr->_vm->_gyro->doing_sprite_run)) {
switch (_tr->_vm->_gyro->magics[tc].op) {
case _tr->_vm->_gyro->exclaim: {
bounce();
@@ -1358,7 +1358,7 @@ void Trip::call_andexors() {
do {
ok = true;
for (fv = 0; fv < 4; fv++) {
- if (((order[fv] != 0) && (order[fv + 1] != 0))
+ if (((order[fv] != -1) && (order[fv + 1] != -1))
&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
/* Swap them! */
temp = order[fv];
@@ -1369,6 +1369,17 @@ void Trip::call_andexors() {
}
} while (!ok);
+ // We redraw the background only if we have at least one moving character.
+ bool drawBG = false;
+ for (fv = 0; fv < 5; fv++) {
+ if (order[fv] > -1) {
+ drawBG = true;
+ break;
+ }
+ }
+ if (drawBG)
+ _vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
+
for (fv = 0; fv < 5; fv++) {
if (order[fv] > -1)
tr[order[fv]].andexor();
@@ -1560,8 +1571,8 @@ void Trip::fliproom(byte room, byte ped) {
if (!_vm->_gyro->alive) {
/* You can't leave the room if you're dead. */
- tr[1].ix = 0;
- tr[1].iy = 0; /* Stop him from moving. */
+ tr[0].ix = 0;
+ tr[0].iy = 0; /* Stop him from moving. */
return;
}
@@ -1572,7 +1583,7 @@ void Trip::fliproom(byte room, byte ped) {
if ((_vm->_gyro->dna.jumpstatus > 0) && (_vm->_gyro->dna.room == r__insidecardiffcastle)) {
/* You can't *jump* out of Cardiff Castle! */
- tr[1].ix = 0;
+ tr[0].ix = 0;
return;
}
@@ -1585,7 +1596,7 @@ void Trip::fliproom(byte room, byte ped) {
getsetclear();
- for (fv = 2; fv <= numtr; fv++) {
+ for (fv = 1; fv < numtr; fv++) {
if (tr[fv].quick)
tr[fv].done();
} /* Deallocate sprite */
@@ -1594,10 +1605,10 @@ void Trip::fliproom(byte room, byte ped) {
_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
_vm->_lucerna->enterroom(room, ped);
- apped(1, ped);
+ apped(0, ped - 1);
_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
- _vm->_gyro->dna.rw = tr[1].face;
+ _vm->_gyro->dna.rw = tr[0].face;
_vm->_lucerna->showrw();
for (fv = 0; fv <= 1; fv++) {