aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2013-07-30 01:48:21 +0200
committeruruk2013-07-30 01:48:21 +0200
commit2857f5aad2c4a024c97e43da67d056a2f7a22def (patch)
tree8566fbe79e3209fc28af6efed67c6628500fbe8d
parent9855cb8f1f6b8e6d6a61f5bf018e3e03b2c4280d (diff)
downloadscummvm-rg350-2857f5aad2c4a024c97e43da67d056a2f7a22def.tar.gz
scummvm-rg350-2857f5aad2c4a024c97e43da67d056a2f7a22def.tar.bz2
scummvm-rg350-2857f5aad2c4a024c97e43da67d056a2f7a22def.zip
AVALANCHE: Revise Graphics::drawSprite(), repair Trip::apped().
-rw-r--r--engines/avalanche/graphics.cpp18
-rw-r--r--engines/avalanche/trip6.cpp2
2 files changed, 7 insertions, 13 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 957468044c..0574705044 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -86,20 +86,14 @@ 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) {
- /* First we make the pixels of the spirte blank. */
- for (byte qay = 0; qay < sprite.yl; qay++) {
- byte *mask = new byte[sprite.xl];
+ drawPicture(_background, 0, 10); // TODO: Remove it later, implement otherwise!!! Now it only works with one sprite on the screen.
- for (byte qax = 0; qax < sprite.xl; qax++) {
- byte count = qax / 8;
- mask[qax] = ((*sprite.sil[picnum])[qay][count] >> ((7 - qax % 8)) & 1);
- if (mask[qax] == 0)
+ /* 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++)
+ if (((*sprite.sil[picnum])[qay][qax / 8] >> ((7 - qax % 8)) & 1) == 0)
*getPixel(x + qax, y + qay) = 0;
- }
-
- delete[] mask;
- }
-
+
/* Then we draw the picture to the blank places. */
uint16 i = 0; // Because the original siltype starts at 5!!! See Graphics.h for definition.
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index d7823c3639..d9b33ac95b 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1093,7 +1093,7 @@ void Trip::rwsp(byte t, byte r) {
}
void Trip::apped(byte trn, byte np) {
- tr[trn].appear(tr[trn].x - tr[trn]._info.xl / 2, tr[trn].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
+ tr[trn].appear(_vm->_gyro->peds[np].x - tr[trn]._info.xl / 2, _vm->_gyro->peds[np].y - tr[trn]._info.yl, _vm->_gyro->peds[np].dir);
rwsp(trn, _vm->_gyro->peds[np].dir);
}