diff options
author | Filippos Karapetis | 2010-02-01 17:04:20 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-02-01 17:04:20 +0000 |
commit | 86408ae3bc08509634bde6c21d64f2dd95c502cd (patch) | |
tree | 6166ebf270a856fae42d67d54020b3e012bc0a32 /engines/sci/graphics | |
parent | 16490ab64e68770860fb1607a36a01d966c7d128 (diff) | |
download | scummvm-rg350-86408ae3bc08509634bde6c21d64f2dd95c502cd.tar.gz scummvm-rg350-86408ae3bc08509634bde6c21d64f2dd95c502cd.tar.bz2 scummvm-rg350-86408ae3bc08509634bde6c21d64f2dd95c502cd.zip |
Added an initial implementation of kGetHighPlanePri
svn-id: r47799
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/gui32.cpp | 16 | ||||
-rw-r--r-- | engines/sci/graphics/gui32.h | 2 |
2 files changed, 16 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() { diff --git a/engines/sci/graphics/gui32.h b/engines/sci/graphics/gui32.h index cdeb7d63e9..e57c972af7 100644 --- a/engines/sci/graphics/gui32.h +++ b/engines/sci/graphics/gui32.h @@ -69,6 +69,7 @@ public: void addPlane(reg_t object); void updatePlane(reg_t object); void deletePlane(reg_t object); + byte getHighPlanePri() { return _highPlanePri; } void frameOut(); void globalToLocal(int16 *x, int16 *y, reg_t planeObj); void localToGlobal(int16 *x, int16 *y, reg_t planeObj); @@ -91,6 +92,7 @@ protected: private: Common::Array<reg_t> _screenItems; Common::Array<reg_t> _planes; + byte _highPlanePri; }; } // End of namespace Sci |