diff options
author | Paul Gilbert | 2014-07-07 21:48:02 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-07-07 21:48:02 -0400 |
commit | 3935a427f94c7619c56976db3c8c4aeca1df500b (patch) | |
tree | 528f34293502cc66a3315f48f53afd0e8f66691a | |
parent | be5ec466b3028f15a8aa51331426b3cd317fe789 (diff) | |
download | scummvm-rg350-3935a427f94c7619c56976db3c8c4aeca1df500b.tar.gz scummvm-rg350-3935a427f94c7619c56976db3c8c4aeca1df500b.tar.bz2 scummvm-rg350-3935a427f94c7619c56976db3c8c4aeca1df500b.zip |
CGE2: Add extra clipping to Bitmap::hide
-rw-r--r-- | engines/cge2/vga13h.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index d7e0552253..a53a1160b8 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -1134,10 +1134,24 @@ void Bitmap::show(V2D pos) { void Bitmap::hide(V2D pos) { xLatPos(pos); - + + // Perform clipping to screen int w = MIN<int>(_w, kScrWidth - pos.x); int h = MIN<int>(_h, kScrHeight - pos.y); + if (pos.x < 0) { + w -= -pos.x; + pos.x = 0; + if (w < 0) + return; + } + if (pos.y < 0) { + h -= -pos.y; + pos.y = 0; + if (h < 0) + return; + } + // Perform copying of screen section for (int yp = pos.y; yp < pos.y + h; yp++) { if (yp >= 0 && yp < kScrHeight) { const byte *srcP = (const byte *)_vm->_vga->_page[2]->getBasePtr(pos.x, yp); |