diff options
author | uruk | 2013-07-19 23:36:58 +0200 |
---|---|---|
committer | uruk | 2013-07-19 23:36:58 +0200 |
commit | 459a8ce2f5cbc88d1347249b6459dcc78a693495 (patch) | |
tree | e958470993fa4e238ca2fb353c90155987d139a0 /engines/avalanche/graph.cpp | |
parent | ef77a84c83fb1baab98e91f3e90783d01539efec (diff) | |
download | scummvm-rg350-459a8ce2f5cbc88d1347249b6459dcc78a693495.tar.gz scummvm-rg350-459a8ce2f5cbc88d1347249b6459dcc78a693495.tar.bz2 scummvm-rg350-459a8ce2f5cbc88d1347249b6459dcc78a693495.zip |
AVALANCHE: Partially implement Graph::drawSprite().
Diffstat (limited to 'engines/avalanche/graph.cpp')
-rw-r--r-- | engines/avalanche/graph.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp index 5c12884291..bbe7e5e992 100644 --- a/engines/avalanche/graph.cpp +++ b/engines/avalanche/graph.cpp @@ -75,9 +75,25 @@ void Graph::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) { } void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) { - /* These 2 lines are here SOLELY for testing purposes. */ - Common::Rect r(x, y, x + sprite.xl, y + sprite.yl); - _surface.frameRect(r, magenta); + + for (byte qay = 0; qay < sprite.yl; qay++) { + byte *mask = new byte[sprite.xl]; + + 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) + *getPixel(x + qax, y + qay) = 255; + } + + delete[] mask; + } + +/* + for (fv = 5; fv <= sprite.size - 2; fv ++) + aa[fv] = aa[fv] ^ (*sprite.mani[picnum])[fv]; +*/ + warning("STUB: Graph::drawSprite()"); } @@ -99,9 +115,9 @@ void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) { for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way. for (uint16 x = 0; x < pictureWidth; x += 8) { byte pixel = source[i++]; - for (byte i = 0; i < 8; i++) { - byte pixelBit = (pixel >> i) & 1; - *(byte *)picture.getBasePtr(x + 7 - i, y) += (pixelBit << plane); + for (byte bit = 0; bit < 8; bit++) { + byte pixelBit = (pixel >> bit) & 1; + *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); } } |