aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/screen.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2015-06-09 23:22:52 +0200
committerWillem Jan Palenstijn2015-06-10 07:14:15 +0200
commit6aaee559dc7f26240678421043baa865608b7d58 (patch)
treeb8ca18ff884e5a30c6083c88f60f6f0a515aadef /engines/sherlock/screen.cpp
parent866d7a27d8b0ea28a533f75774dd9ee16c288d38 (diff)
downloadscummvm-rg350-6aaee559dc7f26240678421043baa865608b7d58.tar.gz
scummvm-rg350-6aaee559dc7f26240678421043baa865608b7d58.tar.bz2
scummvm-rg350-6aaee559dc7f26240678421043baa865608b7d58.zip
SHERLOCK: 3DO intro: implement fade from white
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r--engines/sherlock/screen.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index de9bf51f46..99e09b4f8b 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -233,7 +233,6 @@ void Screen::verticalTransition() {
void Screen::fadeIntoScreen3DO(int speed) {
Events &events = *_vm->_events;
- Common::Rect changedRect;
uint16 *currentScreenBasePtr = (uint16 *)getPixels();
uint16 *targetScreenBasePtr = (uint16 *)_backBuffer->getPixels();
uint16 *currentScreenPtr = NULL;
@@ -315,6 +314,49 @@ void Screen::fadeIntoScreen3DO(int speed) {
} while ((pixelsChanged) && (!_vm->shouldQuit()));
}
+void Screen::blitFrom3DOcolorLimit(uint16 limitColor) {
+ uint16 *currentScreenPtr = (uint16 *)getPixels();
+ uint16 *targetScreenPtr = (uint16 *)_backBuffer->getPixels();
+ uint16 currentScreenPixel = 0;
+
+ uint16 screenWidth = this->w();
+ uint16 screenHeight = this->h();
+ uint16 screenX = 0;
+ uint16 screenY = 0;
+
+ uint16 currentScreenPixelRed = 0;
+ uint16 currentScreenPixelGreen = 0;
+ uint16 currentScreenPixelBlue = 0;
+
+ uint16 limitPixelRed = limitColor & 0xF800;
+ uint16 limitPixelGreen = limitColor & 0x07E0;
+ uint16 limitPixelBlue = limitColor & 0x001F;
+
+ for (screenY = 0; screenY < screenHeight; screenY++) {
+ for (screenX = 0; screenX < screenWidth; screenX++) {
+ currentScreenPixel = *targetScreenPtr;
+
+ currentScreenPixelRed = currentScreenPixel & 0xF800;
+ currentScreenPixelGreen = currentScreenPixel & 0x07E0;
+ currentScreenPixelBlue = currentScreenPixel & 0x001F;
+
+ if (currentScreenPixelRed < limitPixelRed)
+ currentScreenPixelRed = limitPixelRed;
+ if (currentScreenPixelGreen < limitPixelGreen)
+ currentScreenPixelGreen = limitPixelGreen;
+ if (currentScreenPixelBlue < limitPixelBlue)
+ currentScreenPixelBlue = limitPixelBlue;
+
+ *currentScreenPtr = currentScreenPixelRed | currentScreenPixelGreen | currentScreenPixelBlue;
+ currentScreenPtr++;
+ targetScreenPtr++;
+ }
+ }
+
+ // Too much considered dirty at the moment
+ addDirtyRect(Common::Rect(0, 0, screenWidth, screenHeight));
+}
+
void Screen::restoreBackground(const Common::Rect &r) {
if (r.width() > 0 && r.height() > 0) {
Common::Rect tempRect = r;