diff options
author | uruk | 2013-09-05 21:45:07 +0200 |
---|---|---|
committer | uruk | 2013-09-05 21:45:07 +0200 |
commit | 3f822be0ab155883eebfe16839044bce46dbecb3 (patch) | |
tree | 6576eec44d566d59c7dfd96a1096880a3049369a /engines | |
parent | 3b10b079f7da6dab9a6d1f86aa46d33408ac5761 (diff) | |
download | scummvm-rg350-3f822be0ab155883eebfe16839044bce46dbecb3.tar.gz scummvm-rg350-3f822be0ab155883eebfe16839044bce46dbecb3.tar.bz2 scummvm-rg350-3f822be0ab155883eebfe16839044bce46dbecb3.zip |
AVALANCHE: Silence Valgrind warnings.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/avalanche.cpp | 30 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 17 |
2 files changed, 24 insertions, 23 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 605932be57..06ac30e449 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -701,22 +701,24 @@ Common::Error AvalancheEngine::run() { do { runAvalot(); + // Needed for later implementation!!! Don't remove these comments!!! + //if (dosexitcode != 77) quit(); // Didn't stop for us. - switch (_storage._operation) { - case kRunShootemup: - run("seu.avx", kJsb, kBflight, kNormal); - break; - case kRunDosshell: - dosShell(); - break; - case kRunGhostroom: - run("g-room.avx", kJsb, kNoBflight, kNormal); - break; - case kRunGolden: - run("golden.avx", kJsb, kBflight, kMusical); - break; - } + //switch (_storage._operation) { + //case kRunShootemup: + // run("seu.avx", kJsb, kBflight, kNormal); + // break; + //case kRunDosshell: + // dosShell(); + // break; + //case kRunGhostroom: + // run("g-room.avx", kJsb, kNoBflight, kNormal); + // break; + //case kRunGolden: + // run("golden.avx", kJsb, kBflight, kMusical); + // break; + //} } while (false); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index f7067c6bc6..eeb15ddb31 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -222,24 +222,24 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) { // This function mimics Pascal's getimage(). // The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1. - uint16 pictureWidth = file.readUint16LE() + 1; - uint16 pictureHeight = file.readUint16LE() + 1; + uint16 width = file.readUint16LE() + 1; + uint16 height = file.readUint16LE() + 1; ::Graphics::Surface picture; // We make a Surface object for the picture itself. - - picture.create(pictureWidth, pictureHeight, ::Graphics::PixelFormat::createFormatCLUT8()); + picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8()); // Produce the picture. We read it in row-by-row, and every row has 4 planes. - for (byte y = 0; y < pictureHeight; y++) + for (byte y = 0; y < height; y++) for (int8 plane = 3; plane >= 0; plane--) // The planes are in the opposite way. - for (uint16 x = 0; x < pictureWidth; x += 8) { + for (uint16 x = 0; x < width; x += 8) { byte pixel = file.readByte(); for (byte bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; - *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); + if (pixelBit != 0) + *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane); } } - + return picture; } @@ -249,7 +249,6 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String &text // and we read the picture plane-by-plane. ::Graphics::Surface picture; - picture.create(width, height, ::Graphics::PixelFormat::createFormatCLUT8()); for (byte plane = 0; plane < 4; plane++) |