diff options
author | Bertrand Augereau | 2011-09-01 01:39:12 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-09-01 01:43:57 +0200 |
commit | efd8c41d35a2807ea2026f6966c3efb83de4dc65 (patch) | |
tree | a3a1d5cf81a2b1c2c137d21d33419b3dd3574e9d /engines/dreamweb | |
parent | 6c0b7b6deb994b0d57d8dc858ee10a71cebfc4cb (diff) | |
download | scummvm-rg350-efd8c41d35a2807ea2026f6966c3efb83de4dc65.tar.gz scummvm-rg350-efd8c41d35a2807ea2026f6966c3efb83de4dc65.tar.bz2 scummvm-rg350-efd8c41d35a2807ea2026f6966c3efb83de4dc65.zip |
DREAMWEB: 'frameoutv' know how to clip on the left and upper borders
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/stubs.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index f99f0d6fbb..ede60259a4 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -25,7 +25,7 @@ void clearwork(); void multidump(); void multidump(uint16 x, uint16 y, uint8 width, uint8 height); - void frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); + void frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y); void frameoutnm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); void frameoutbh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); void frameoutfx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index beb2d61f7e..ecc90f172a 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -286,11 +286,23 @@ void DreamGenContext::showpcx() { pcxFile.close(); } -void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y) { // NB : These resilience checks were not in the original engine, but did they result in undefined behaviour // or was something broken during porting to C++? assert(pitch == 320); + if(x < 0) { + assert(width >= -x); + width -= -x; + src += -x; + x = 0; + } + if(y < 0) { + assert(height >= -y); + height -= -y; + src += (-y) * width; + y = 0; + } if(x >= 320) return; if(y >= 200) |