aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-02-18 15:47:17 +0100
committeruruk2014-02-18 15:47:17 +0100
commit2e56baeca0ad9067f73a03c81a161e05acda7abe (patch)
treecf5f59fa222bf3b17b64523e8c96f3b076b11a40 /engines
parent72c40dbd47b8684358432567cd20cbd3b9af92b8 (diff)
downloadscummvm-rg350-2e56baeca0ad9067f73a03c81a161e05acda7abe.tar.gz
scummvm-rg350-2e56baeca0ad9067f73a03c81a161e05acda7abe.tar.bz2
scummvm-rg350-2e56baeca0ad9067f73a03c81a161e05acda7abe.zip
AVALANCHE: Rework GraphicManager::loadPictureSign().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/graphics.cpp11
-rw-r--r--engines/avalanche/graphics.h2
2 files changed, 6 insertions, 7 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 367ca27c09..cde0f5de9a 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -826,22 +826,21 @@ Graphics::Surface GraphicManager::loadPictureRaw(Common::File &file, uint16 widt
return picture;
}
-Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, int xl, int yl) {
+Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, uint16 width, uint16 height) {
// I know it looks very similar to the other loadPicture methods, but in truth it's the combination of the two.
- uint16 width = xl * 8;
- uint16 height = yl;
+ width *= 8;
Graphics::Surface picture; // We make a Surface object for the picture itself.
picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
// Produce the picture. We read it in row-by-row, and every row has 4 planes.
- for (int yy = 0; yy < height; yy++) {
+ for (int y = 0; y < height; y++) {
for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order.
- for (uint16 xx = 0; xx < width; xx += 8) {
+ for (uint16 x = 0; x < width; x += 8) {
byte pixel = file.readByte();
for (int bit = 0; bit < 8; bit++) {
byte pixelBit = (pixel >> bit) & 1;
- *(byte *)picture.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
+ *(byte *)picture.getBasePtr(x + 7 - bit, y) += (pixelBit << plane);
}
}
}
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 34f6498fca..1da875b330 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -180,7 +180,7 @@ private:
// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
- Graphics::Surface loadPictureSign(Common::File &file, int xl, int yl); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim.
+ Graphics::Surface loadPictureSign(Common::File &file, uint16 width, uint16 height); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim.
void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);