diff options
Diffstat (limited to 'engines/sci/graphics/gui32.cpp')
-rw-r--r-- | engines/sci/graphics/gui32.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp index 1f6e21d20e..eb44432da5 100644 --- a/engines/sci/graphics/gui32.cpp +++ b/engines/sci/graphics/gui32.cpp @@ -44,7 +44,7 @@ namespace Sci { SciGui32::SciGui32(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCache *cache, Cursor *cursor) - : _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor) { + : _s(state), _screen(screen), _palette(palette), _cache(cache), _cursor(cursor), _highPlanePri(0) { _compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen); } @@ -231,6 +231,9 @@ void SciGui32::deleteScreenItem(reg_t object) { void SciGui32::addPlane(reg_t object) { _planes.push_back(object); + byte planePri = GET_SEL32V(_s->_segMan, object, priority) & 0xF; + if (planePri > _highPlanePri) + _highPlanePri = planePri; } void SciGui32::updatePlane(reg_t object) { @@ -240,9 +243,18 @@ void SciGui32::deletePlane(reg_t object) { for (uint32 planeNr = 0; planeNr < _planes.size(); planeNr++) { if (_planes[planeNr] == object) { _planes.remove_at(planeNr); - return; + break; } } + + // Recalculate highPlanePri + _highPlanePri = 0; + + for (uint32 planeNr = 0; planeNr < _planes.size(); planeNr++) { + byte planePri = GET_SEL32V(_s->_segMan, _planes[planeNr], priority) & 0xF; + if (planePri > _highPlanePri) + _highPlanePri = planePri; + } } void SciGui32::frameOut() { |