diff options
author | Matthew Hoops | 2011-10-28 01:43:05 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-10-28 01:43:05 -0400 |
commit | 59f7d432d11f7527a01e04be09c8afaef3d1cb1d (patch) | |
tree | 4812b090b10a16915e6cbb6cf39256efae2c8477 /engines/pegasus | |
parent | 0ec655f410a0b0ed485f7e6235b8054e97891fd8 (diff) | |
download | scummvm-rg350-59f7d432d11f7527a01e04be09c8afaef3d1cb1d.tar.gz scummvm-rg350-59f7d432d11f7527a01e04be09c8afaef3d1cb1d.tar.bz2 scummvm-rg350-59f7d432d11f7527a01e04be09c8afaef3d1cb1d.zip |
PEGASUS: Implement dirty rect erase code (as used by the space chase)
Diffstat (limited to 'engines/pegasus')
-rw-r--r-- | engines/pegasus/graphics.cpp | 13 | ||||
-rw-r--r-- | engines/pegasus/graphics.h | 4 | ||||
-rwxr-xr-x | engines/pegasus/neighborhood/mars/mars.cpp | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp index cc6dcf04a8..06db31f71d 100644 --- a/engines/pegasus/graphics.cpp +++ b/engines/pegasus/graphics.cpp @@ -45,6 +45,7 @@ GraphicsManager::GraphicsManager(PegasusEngine *vm) : _vm(vm) { _workArea.create(640, 480, _vm->_system->getScreenFormat()); _modifiedScreen = false; _curSurface = &_workArea; + _erase = false; } GraphicsManager::~GraphicsManager() { @@ -150,6 +151,10 @@ void GraphicsManager::updateDisplay() { bool screenDirty = false; if (!_dirtyRect.isEmpty()) { + // Fill the dirty area with black if erase mode is enabled + if (_erase) + _workArea.fillRect(_dirtyRect, _workArea.format.RGBToColor(0, 0, 0)); + for (DisplayElement *runner = _firstDisplayElement; runner != 0; runner = runner->_nextElement) { Common::Rect bounds; runner->getBounds(bounds); @@ -320,5 +325,13 @@ void GraphicsManager::shakeTheWorld(TimeValue duration, TimeScale scale) { oldScreen.free(); } + +void GraphicsManager::enableErase() { + _erase = true; +} + +void GraphicsManager::disableErase() { + _erase = false; +} } // End of namespace Pegasus diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h index 18dfd3f262..0e5de47d95 100644 --- a/engines/pegasus/graphics.h +++ b/engines/pegasus/graphics.h @@ -60,6 +60,8 @@ public: void clearScreen(); DisplayElement *findDisplayElement(const tDisplayElementID id); void shakeTheWorld(TimeValue time, TimeScale scale); + void enableErase(); + void disableErase(); // These default to black void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, uint32 color = 0); @@ -71,7 +73,7 @@ protected: private: PegasusEngine *_vm; - bool _modifiedScreen; + bool _modifiedScreen, _erase; Common::Rect _dirtyRect; tDisplayOrder _backLayer, _frontLayer; DisplayElement *_firstDisplayElement, *_lastDisplayElement; diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp index 5c366383b4..a7816180fc 100755 --- a/engines/pegasus/neighborhood/mars/mars.cpp +++ b/engines/pegasus/neighborhood/mars/mars.cpp @@ -2822,6 +2822,8 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) { _canyonChaseMovie.stopDisplaying(); _canyonChaseMovie.releaseMovie(); + _vm->_gfx->enableErase(); + loadLoopSound1("Sounds/Mars/Space Ambient.22K.8.AIFF"); playSpotSoundSync(kShuttleConfiguringIn, kShuttleConfiguringOut); |