diff options
author | Matthew Hoops | 2010-06-14 16:58:15 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-06-14 16:58:15 +0000 |
commit | 303c7b0a8dd0fb120f1fa1ec0abb03b27912e8a5 (patch) | |
tree | d6904e339f7cfcecb80e6a25e130c7d98b8db469 | |
parent | 60eced7a81c37d3db7c5fffee2d34463f8313e9d (diff) | |
download | scummvm-rg350-303c7b0a8dd0fb120f1fa1ec0abb03b27912e8a5.tar.gz scummvm-rg350-303c7b0a8dd0fb120f1fa1ec0abb03b27912e8a5.tar.bz2 scummvm-rg350-303c7b0a8dd0fb120f1fa1ec0abb03b27912e8a5.zip |
Ignore and remove invalid plane and item objects in kFrameout. Fixes loading in-game in GK1.
svn-id: r49663
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 3cc5ca5447..d794fad39e 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -126,6 +126,14 @@ void GfxFrameout::kernelFrameout() { for (uint32 planeNr = 0; planeNr < _planes.size(); planeNr++) { planeObject = _planes[planeNr]; + + // Remove any invalid planes + if (!_segMan->isObject(planeObject)) { + _planes.remove_at(planeNr); + planeNr--; + continue; + } + planePriority = readSelectorValue(_segMan, planeObject, SELECTOR(priority)); if (planePriority == -1) // Plane currently not meant to be shown @@ -161,6 +169,14 @@ void GfxFrameout::kernelFrameout() { itemEntry = itemData; for (uint32 itemNr = 0; itemNr < _screenItems.size(); itemNr++) { itemObject = _screenItems[itemNr]; + + // Remove any invalid items + if (!_segMan->isObject(itemObject)) { + _screenItems.remove_at(itemNr); + itemNr--; + continue; + } + itemPlane = readSelector(_segMan, itemObject, SELECTOR(plane)); if (planeObject == itemPlane) { // Found an item on current plane |