aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/graph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/avalanche/graph.cpp')
-rw-r--r--engines/avalanche/graph.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/avalanche/graph.cpp b/engines/avalanche/graph.cpp
index 56a9be00cd..2f5b377cbb 100644
--- a/engines/avalanche/graph.cpp
+++ b/engines/avalanche/graph.cpp
@@ -98,13 +98,11 @@ void Graph::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y)
}
void Graph::drawPicture(const byte *source, uint16 destX, uint16 destY) {
- uint32 i = 0;
+ // The height and the width are stored in 2-2 bytes. We have to add 1 to each becouse Pascal stores the value of them -1.
+ uint16 pictureWidth = READ_LE_UINT16(source) + 1;
+ uint16 pictureHeight = READ_LE_UINT16(source + 2) + 1;
- // The height and the width are stored in 2 bytes.
- uint16 pictureWidth = (source[i++] + 1);
- pictureWidth += (source[i++] << 8);
- uint16 pictureHeight = (source[i++] + 1);
- pictureHeight += (source[i++] << 8);
+ uint32 i = 4;
Graphics::Surface picture; // We make a Surface object for the picture itself.