diff options
author | Willem Jan Palenstijn | 2012-11-30 23:22:00 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2012-11-30 23:22:51 +0100 |
commit | 89a330cb5d405596236576ca9516d0027c3f899a (patch) | |
tree | 7dea30487521f54fa1587ad1d1aebba44aeba2b5 | |
parent | f2fe1b775a4e344b51ada17415e125998a582efd (diff) | |
download | scummvm-rg350-89a330cb5d405596236576ca9516d0027c3f899a.tar.gz scummvm-rg350-89a330cb5d405596236576ca9516d0027c3f899a.tar.bz2 scummvm-rg350-89a330cb5d405596236576ca9516d0027c3f899a.zip |
DREAMWEB: Add some debugging output to emergencyPurge
-rw-r--r-- | engines/dreamweb/object.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index ecd38f2abe..bee3a6d511 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -1129,24 +1129,25 @@ void DreamWebEngine::incRyanPage() { } void DreamWebEngine::emergencyPurge() { - while (true) { - if (_vars._exFramePos + 4000 < kExframeslen) { - // Not near frame end - if (_vars._exTextPos + 400 < kExtextlen) - return; // notneartextend - } + debug(2, "Ex memory: frames %d/%d, text %d/%d", _vars._exFramePos, kExframeslen, _vars._exTextPos, kExtextlen); + while (_vars._exFramePos + 4000 >= kExframeslen || + _vars._exTextPos + 400 >= kExtextlen) + { purgeAnItem(); + debug(2, "Ex memory after purging: frames %d/%d, text %d/%d", _vars._exFramePos, kExframeslen, _vars._exTextPos, kExtextlen); } } void DreamWebEngine::purgeAnItem() { const DynObject *extraObjects = _exData; + for (uint i = 0; i < kNumexobjects; ++i) { if (extraObjects[i].mapad[0] == 0 && (extraObjects[i].objId[0] == 255 || extraObjects[i].objId[0] == 2) && extraObjects[i].initialLocation != _realLocation) { + debug(1, "Purging ex object %d", i); deleteExObject(i); return; } @@ -1154,10 +1155,13 @@ void DreamWebEngine::purgeAnItem() { for (uint i = 0; i < kNumexobjects; ++i) { if (extraObjects[i].mapad[0] == 0 && extraObjects[i].objId[0] == 255) { + debug(1, "Purging ex object %d", i); deleteExObject(i); return; } } + + error("Out of Ex object memory"); } void DreamWebEngine::dropError() { |