aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pegasus/graphics.cpp')
-rw-r--r--engines/pegasus/graphics.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index 634b0eb0cc..7748c266f5 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -44,7 +44,6 @@ GraphicsManager::GraphicsManager(PegasusEngine *vm) : _vm(vm) {
_frontLayer = kMaxAvailableOrder;
_firstDisplayElement = _lastDisplayElement = 0;
_workArea.create(640, 480, _vm->_system->getScreenFormat());
- _modifiedScreen = false;
_curSurface = &_workArea;
_erase = false;
_updatesEnabled = true;
@@ -152,8 +151,6 @@ void GraphicsManager::removeDisplayElement(DisplayElement *oldElement) {
}
void GraphicsManager::updateDisplay() {
- bool screenDirty = false;
-
if (!_dirtyRect.isEmpty()) {
// Fill the dirty area with black if erase mode is enabled
if (_erase)
@@ -167,29 +164,18 @@ void GraphicsManager::updateDisplay() {
// but it should work fine for now.
if (bounds.intersects(_dirtyRect) && runner->validToDraw(_backLayer, _frontLayer)) {
runner->draw(bounds);
- screenDirty = true;
}
}
// Copy only the dirty rect to the screen
- if (screenDirty)
- g_system->copyRectToScreen((byte *)_workArea.getBasePtr(_dirtyRect.left, _dirtyRect.top), _workArea.pitch, _dirtyRect.left, _dirtyRect.top, _dirtyRect.width(), _dirtyRect.height());
+ g_system->copyRectToScreen((byte *)_workArea.getBasePtr(_dirtyRect.left, _dirtyRect.top), _workArea.pitch, _dirtyRect.left, _dirtyRect.top, _dirtyRect.width(), _dirtyRect.height());
// Clear the dirty rect
_dirtyRect = Common::Rect();
}
- if (_updatesEnabled && (screenDirty || _modifiedScreen))
+ if (_updatesEnabled)
g_system->updateScreen();
-
- _modifiedScreen = false;
-}
-
-void GraphicsManager::clearScreen() {
- Graphics::Surface *screen = g_system->lockScreen();
- screen->fillRect(Common::Rect(0, 0, 640, 480), g_system->getScreenFormat().RGBToColor(0, 0, 0));
- g_system->unlockScreen();
- _modifiedScreen = true;
}
DisplayElement *GraphicsManager::findDisplayElement(const DisplayElementID id) {
@@ -214,10 +200,6 @@ void GraphicsManager::doFadeInSync(const TimeValue time, const TimeScale scale,
_updatesEnabled = true;
}
-void GraphicsManager::markCursorAsDirty() {
- _modifiedScreen = true;
-}
-
void GraphicsManager::newShakePoint(int32 index1, int32 index2, int32 maxRadius) {
int32 index3 = (index1 + index2) >> 1;