aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-12-20 12:21:18 +0000
committerFilippos Karapetis2010-12-20 12:21:18 +0000
commit4b836d611fc472be65eb85e4ed0686d6cbd8a69e (patch)
treef1fc3dc9e523c73076ccbe4fa513ced0117fbe05
parentd3340b0d0cad316d6a15af3dee2e3a30bd72f244 (diff)
downloadscummvm-rg350-4b836d611fc472be65eb85e4ed0686d6cbd8a69e.tar.gz
scummvm-rg350-4b836d611fc472be65eb85e4ed0686d6cbd8a69e.tar.bz2
scummvm-rg350-4b836d611fc472be65eb85e4ed0686d6cbd8a69e.zip
SCI: Fixed bug #3037945 - "PQ3 : Graphical Glitch with White Mercedes on Freeway"
svn-id: r54975
-rw-r--r--engines/sci/graphics/paint16.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 3c115f0c8e..9030e1afbe 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -534,7 +534,20 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) {
case SCI_DISPLAY_RESTOREUNDER:
bitsGetRect(argv[0], &rect);
rect.translate(-_ports->getPort()->left, -_ports->getPort()->top);
- bitsRestore(argv[0]);
+ if (g_sci->getGameId() == GID_PQ3 && g_sci->getEngineState()->currentRoomNumber() == 29) {
+ // WORKAROUND: PQ3 calls this without calling the associated
+ // kDisplay(SCI_DISPLAY_SAVEUNDER) call before. Theoretically,
+ // this would result in no rect getting restored. However, we
+ // still maintain a pointer from the previous room, resulting
+ // in invalidated content being restored on screen, and causing
+ // graphics glitches. Thus, we simply don't restore a rect in
+ // that room. The correct fix for this would be to erase hunk
+ // pointers when changing rooms, but this will suffice for now,
+ // as restoring from a totally invalid pointer is very rare.
+ // Fixes bug #3037945.
+ } else {
+ bitsRestore(argv[0]);
+ }
kernelGraphRedrawBox(rect);
// finishing loop
argc = 0;