aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/stubs.cpp
diff options
context:
space:
mode:
authorBertrand Augereau2011-06-22 23:11:44 +0200
committerBertrand Augereau2011-06-22 23:11:44 +0200
commitcf12e0499752f9607b50a05d465e1921eaabc242 (patch)
treed3eec10babfefa14e510bd7cec00bb7da5002960 /engines/dreamweb/stubs.cpp
parent33ce6e60fd98ea67e1e6606bfc7d693b27359bd7 (diff)
downloadscummvm-rg350-cf12e0499752f9607b50a05d465e1921eaabc242.tar.gz
scummvm-rg350-cf12e0499752f9607b50a05d465e1921eaabc242.tar.bz2
scummvm-rg350-cf12e0499752f9607b50a05d465e1921eaabc242.zip
DREAMWEB: frameoutv becomes a native function
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r--engines/dreamweb/stubs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index eebfbeb0d4..1869f1b109 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -503,4 +503,26 @@ void DreamGenContext::showpcx() {
pcxFile.close();
}
+void DreamGenContext::frameoutv() {
+ uint16 pitch = dx;
+ uint16 width = cx & 0xff;
+ uint16 height = cx >> 8;
+ uint16 stride = pitch - width;
+
+ const uint8* src = ds.ptr(si, width * height);
+ uint8* base = es.ptr(di, stride * height);
+ uint8* dst = base + pitch * bx;
+
+ // NB: Original code assumes non-zero width and height, "for" are unneeded, do-while would suffice but would be less readable
+ for (uint16 y = 0; y < height; ++y) {
+ for (uint16 x = 0; x < width; ++x) {
+ uint8 pixel = *src++;
+ if (pixel)
+ *dst = pixel;
+ ++dst;
+ }
+ dst += stride;
+ }
+}
+
} /*namespace dreamgen */