diff options
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 15 |
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; |