[Scummvm-cvs-logs] scummvm master -> beb1f5b316b2d00bc02bf9c4f674278dc71aba7a
bluegr
md5 at scummvm.org
Sat Jan 7 17:57:38 CET 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
beb1f5b316 AGI: Fix bug #3451122 - "AGI-FANMADE: Nick's Quest hangs ScummVM upon starting"
Commit: beb1f5b316b2d00bc02bf9c4f674278dc71aba7a
https://github.com/scummvm/scummvm/commit/beb1f5b316b2d00bc02bf9c4f674278dc71aba7a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-01-07T08:56:23-08:00
Commit Message:
AGI: Fix bug #3451122 - "AGI-FANMADE: Nick's Quest hangs ScummVM upon starting"
Changed paths:
engines/agi/checks.cpp
engines/agi/picture.h
diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp
index c3b31f6..6244765 100644
--- a/engines/agi/checks.cpp
+++ b/engines/agi/checks.cpp
@@ -113,6 +113,22 @@ int AgiEngine::checkPriority(VtEntry *v) {
water = 1;
+ // Check if any picture is loaded before checking for priority below.
+ // If no picture has been loaded, the priority buffer won't be initialized,
+ // thus the check below will always fail. This case causes an infinite loop
+ // in the fanmade game Nick's Quest (bug #3451122), as the game attempts to
+ // draw a sprite (view 4, floating Nick) before it loads any picture. This
+ // causes the checks below to always fail, and the engine keeps readjusting
+ // the sprite's position in fixPosition() forever, as there is no valid
+ // position to place it (the default visual and priority screen is set to
+ // zero, i.e. unconditional black). To remedy this situation, we always
+ // return true here if no picture has been loaded and no priority screen
+ // has been set up.
+ if (!_game._vm->_picture->isPictureLoaded()) {
+ warning("checkPriority: no picture loaded");
+ return pass;
+ }
+
p0 = &_game.sbuf16c[v->xPos + v->yPos * _WIDTH];
for (i = 0; i < v->xSize; i++, p0++) {
diff --git a/engines/agi/picture.h b/engines/agi/picture.h
index f2a6586..45a9520 100644
--- a/engines/agi/picture.h
+++ b/engines/agi/picture.h
@@ -115,6 +115,8 @@ public:
putVirtPixel(x, y);
}
+ bool isPictureLoaded() { return _data != NULL; }
+
private:
uint8 *_data;
uint32 _flen;
More information about the Scummvm-git-logs
mailing list