aboutsummaryrefslogtreecommitdiff
path: root/engines/groovie/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/groovie/graphics.cpp')
-rw-r--r--engines/groovie/graphics.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index b85277fac7..e0c198f377 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -63,7 +63,7 @@ void GraphicsMan::update() {
// Clear the buffer when ending the fade out
if (_fading == 2)
- _foreground.fillRect(Common::Rect(640, 320), 0);
+ _foreground.fillRect(Common::Rect(640, _foreground.h), 0);
}
}
@@ -74,6 +74,22 @@ void GraphicsMan::update() {
}
}
+void GraphicsMan::switchToFullScreen(bool fullScreen) {
+ _foreground.free();
+ _background.free();
+
+ if (fullScreen) {
+ _foreground.create(640, 480, _vm->_pixelFormat);
+ _background.create(640, 480, _vm->_pixelFormat);
+ } else {
+ _vm->_system->fillScreen(0);
+ _foreground.create(640, 320, _vm->_pixelFormat);
+ _background.create(640, 320, _vm->_pixelFormat);
+ }
+
+ _changed = true;
+}
+
void GraphicsMan::change() {
_changed = true;
}
@@ -84,7 +100,7 @@ void GraphicsMan::mergeFgAndBg() {
countf = (byte *)_foreground.getPixels();
countb = (byte *)_background.getPixels();
- for (i = 640 * 320; i; i--) {
+ for (i = 640 * _foreground.h; i; i--) {
if (255 == *(countf)) {
*(countf) = *(countb);
}
@@ -94,7 +110,10 @@ void GraphicsMan::mergeFgAndBg() {
}
void GraphicsMan::updateScreen(Graphics::Surface *source) {
- _vm->_system->copyRectToScreen(source->getPixels(), 640, 0, 80, 640, 320);
+ if (!isFullScreen())
+ _vm->_system->copyRectToScreen(source->getPixels(), source->pitch, 0, 80, 640, 320);
+ else
+ _vm->_system->copyRectToScreen(source->getPixels(), source->pitch, 0, 0, 640, 480);
change();
}