diff options
author | Eugene Sandulenko | 2011-06-22 15:36:15 -0700 |
---|---|---|
committer | Eugene Sandulenko | 2011-06-22 15:36:15 -0700 |
commit | 16997e38eea087a6aeb2cad4e8950c58e3e02f7a (patch) | |
tree | bb63ffdece063bc314b387c8edd55bd6e4c276a8 /engines/dreamweb/stubs.cpp | |
parent | 59d3b938d442fdae9709d1633d8ed8101ba95152 (diff) | |
parent | cf12e0499752f9607b50a05d465e1921eaabc242 (diff) | |
download | scummvm-rg350-16997e38eea087a6aeb2cad4e8950c58e3e02f7a.tar.gz scummvm-rg350-16997e38eea087a6aeb2cad4e8950c58e3e02f7a.tar.bz2 scummvm-rg350-16997e38eea087a6aeb2cad4e8950c58e3e02f7a.zip |
Merge pull request #46 from tramboi/master
DREAMWEB: Reversing and reimplementing natively frameoutv
Diffstat (limited to 'engines/dreamweb/stubs.cpp')
-rw-r--r-- | engines/dreamweb/stubs.cpp | 22 |
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 */ |