From 95ce29ac7470435dbec167df526cf4ff38fc8805 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 15 May 2015 20:44:12 -0400 Subject: SHERLOCK: Fix random pixel transitions, and make it the default fade style --- engines/sherlock/screen.cpp | 2 +- engines/sherlock/sherlock.cpp | 3 +++ engines/sherlock/surface.cpp | 7 +++++++ engines/sherlock/surface.h | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index 38bbb93800..cbf18f146f 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -217,7 +217,7 @@ void Screen::randomTransition() { if (offset < (SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCREEN_HEIGHT)) *((byte *)getPixels() + offset) = *((const byte *)_backBuffer->getPixels() + offset); - if (idx != 0 && (idx % 100) == 0) { + if (idx != 0 && (idx % 300) == 0) { // Ensure there's a full screen dirty rect for the next frame update if (_dirtyRects.empty()) addDirtyRect(Common::Rect(0, 0, this->w, this->h)); diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp index 95da79d988..81d461b161 100644 --- a/engines/sherlock/sherlock.cpp +++ b/engines/sherlock/sherlock.cpp @@ -129,6 +129,9 @@ Common::Error SherlockEngine::run() { if (shouldQuit()) break; + // Clear the screen + _screen->clear(); + // Reset UI flags _ui->reset(); diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp index 2dfbdef77f..36e625794c 100644 --- a/engines/sherlock/surface.cpp +++ b/engines/sherlock/surface.cpp @@ -172,4 +172,11 @@ bool Surface::clip(Common::Rect &srcBounds, Common::Rect &destBounds) { return true; } +/** + * Clear the screen + */ +void Surface::clear() { + fillRect(Common::Rect(0, 0, this->w, this->h), 0); +} + } // End of namespace Sherlock diff --git a/engines/sherlock/surface.h b/engines/sherlock/surface.h index d4a1584968..b2a759aa8d 100644 --- a/engines/sherlock/surface.h +++ b/engines/sherlock/surface.h @@ -53,6 +53,8 @@ public: void fillRect(int x1, int y1, int x2, int y2, byte color); void fillRect(const Common::Rect &r, byte color); + + void clear(); }; } // End of namespace Sherlock -- cgit v1.2.3