From c424c22f19a050b1a2ee421e80172f7dda571dac Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 11 May 2012 12:54:06 +0300 Subject: [PATCH] SCI: Fix bug #3040625 - "SCI: ECOQUEST French/German: Speech balloon graphic glitch" This bug is caused by the fact that the sprites in that scene and the speech bubble share the same priority, so we compensate for that with a workaround --- engines/sci/graphics/view.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index a77bcccc527..4e5c4da8b25 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -720,6 +720,19 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const bitmap += (clipRect.top - rect.top) * celWidth + (clipRect.left - rect.left); + // WORKAROUND: EcoQuest French and German draw the fish and anemone sprites + // with priority 15 in scene 440. Afterwards, a dialog is shown on top of + // these sprites with priority 15 as well. This is undefined behavior + // actually, as the sprites and dialog share the same priority, so in our + // implementation the sprites get drawn incorrectly on top of the dialog. + // Perhaps this worked by mistake in SSCI because of subtle differences in + // how sprites are drawn. We compensate for this by resetting the priority + // of all sprites that have a priority of 15 in scene 440 to priority 14, + // so that the speech bubble can be drawn correctly on top of them. Fixes + // bug #3040625. + if (g_sci->getGameId() == GID_ECOQUEST && g_sci->getEngineState()->currentRoomNumber() == 440 && priority == 15) + priority = 14; + if (!_EGAmapping) { for (y = 0; y < height; y++, bitmap += celWidth) { for (x = 0; x < width; x++) {