aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/graphics.cpp
diff options
context:
space:
mode:
authoruruk2014-02-19 17:55:32 +0100
committeruruk2014-02-19 17:55:32 +0100
commitc498e910eb19bcc78fbd35dbf743a09e9a2e0ddb (patch)
treeaa7c51724e22d9098ad67859cd137ce2072ed859 /engines/avalanche/graphics.cpp
parenta3eea23624df66a277802bc1bf828dbf773c5da1 (diff)
downloadscummvm-rg350-c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb.tar.gz
scummvm-rg350-c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb.tar.bz2
scummvm-rg350-c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb.zip
AVALANCHE: Implement ShootEmUp::plotThem() and connected functions.
Diffstat (limited to 'engines/avalanche/graphics.cpp')
-rw-r--r--engines/avalanche/graphics.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index cde0f5de9a..3b4413ab76 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -755,6 +755,31 @@ void GraphicManager::seuDrawPicture(int x, int y, byte which) {
}
/**
+ * @remarks Originally called 'cameo_display'
+ */
+void GraphicManager::seuDrawCameo(int destX, int destY, byte w1, byte w2) {
+ // First we make the pixels of the previous sprite (cameo) blank:
+ uint16 maxX = _seuPictures[w2].w;
+ uint16 maxY = _seuPictures[w2].h;
+
+ if (destX + maxX > _surface.w)
+ maxX = _surface.w - destX;
+
+ if (destY + maxY > _surface.h)
+ maxY = _surface.h - destY;
+
+ for (uint16 y = 0; y < maxY; y++) {
+ for (uint16 x = 0; x < maxX; x++) {
+ if (*(const byte *)_seuPictures[w2].getBasePtr(x, y) != 0)
+ *(byte *)_surface.getBasePtr(x + destX, y + destY) = 0;
+ }
+ }
+
+ // Then we draw the desired sprite:
+ drawPicture(_surface, _seuPictures[w1], destX, destY);
+}
+
+/**
* This function is for skipping the difference between a stored 'size' value associated with a picture
* and the actual size of the pictures when reading them from files for Ghostroom and Shoot em' up.
* It's needed bacuse the original code loaded the pictures to arrays first and only used the useful parts