diff options
author | uruk | 2013-07-20 10:55:19 +0200 |
---|---|---|
committer | uruk | 2013-07-20 10:55:19 +0200 |
commit | 137d33414499584a61640159570768dade068883 (patch) | |
tree | 7db2b5e91a1fd1b8bf7d6d03a513ad58b45b1a9f | |
parent | 097572193fd29324a582b18d6b7d80ff643c6776 (diff) | |
download | scummvm-rg350-137d33414499584a61640159570768dade068883.tar.gz scummvm-rg350-137d33414499584a61640159570768dade068883.tar.bz2 scummvm-rg350-137d33414499584a61640159570768dade068883.zip |
AVALANCHE: Finish implementation of Graph::drawSprite().
-rw-r--r-- | engines/avalanche/graph.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp index 2f5b377cbb..7c9d09edc5 100644 --- a/engines/avalanche/graph.cpp +++ b/engines/avalanche/graph.cpp @@ -89,12 +89,17 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) delete[] mask; } -/* - for (fv = 5; fv <= sprite.size - 2; fv ++) - aa[fv] = aa[fv] ^ (*sprite.mani[picnum])[fv]; -*/ + uint16 i = 0; // Becouse the original siltype starts at 5!!! See Graph.h for definition. - warning("STUB: Graph::drawSprite()"); + for (byte qay = 0; qay < sprite.yl; qay++) + for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way. + for (uint16 qax = 0; qax < sprite.xl; qax += 8) { + byte pixel = (*sprite.mani[picnum])[i++]; + for (byte bit = 0; bit < 8; bit++) { + byte pixelBit = (pixel >> bit) & 1; + *getPixel(x + qax + 7 - bit, y + qay) += (pixelBit << plane); + } + } } void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) { |