aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-06 18:59:39 +0000
committerMartin Kiewitz2010-01-06 18:59:39 +0000
commitedc7fcf121bf56052858498d3168c344c00d7442 (patch)
tree4ea0519f9a717f8e371bff39da92a06f9d93f746 /engines/sci/graphics
parent11d9f150106cbcc6be196902f3970badb8de70f5 (diff)
downloadscummvm-rg350-edc7fcf121bf56052858498d3168c344c00d7442.tar.gz
scummvm-rg350-edc7fcf121bf56052858498d3168c344c00d7442.tar.bz2
scummvm-rg350-edc7fcf121bf56052858498d3168c344c00d7442.zip
SCI: sync displayScreen with framebuffer after successful video playback (fixes background vanishing in mainmenu of gk1demo)
svn-id: r47089
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gui.cpp4
-rw-r--r--engines/sci/graphics/gui.h2
-rw-r--r--engines/sci/graphics/screen.cpp7
-rw-r--r--engines/sci/graphics/screen.h1
4 files changed, 14 insertions, 0 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index b11be4ceb7..8eb83495fa 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -821,6 +821,10 @@ int16 SciGui::getCelCount(GuiResourceId viewId, int16 loopNo) {
return _gfx->getView(viewId)->getLoopInfo(loopNo)->celCount;
}
+void SciGui::syncWithFramebuffer() {
+ _screen->syncWithFramebuffer();
+}
+
reg_t SciGui::portraitLoad(Common::String resourceName) {
return NULL_REG;
}
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index c5b1ad1892..293c41da70 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -145,6 +145,8 @@ public:
virtual int16 getLoopCount(GuiResourceId viewId);
virtual int16 getCelCount(GuiResourceId viewId, int16 loopNo);
+ virtual void syncWithFramebuffer();
+
virtual reg_t portraitLoad(Common::String resourceName);
virtual void portraitShow(Common::String resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
virtual void portraitUnload(uint16 portraitId);
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index fce6827d43..a78b049e5e 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -91,6 +91,13 @@ void Screen::copyFromScreen(byte *buffer) {
g_system->unlockScreen();
}
+void Screen::syncWithFramebuffer() {
+ Graphics::Surface *screen = g_system->lockScreen();
+
+ memcpy(_displayScreen, screen->pixels, _displayPixels);
+ g_system->unlockScreen();
+}
+
void Screen::copyRectToScreen(const Common::Rect &rect) {
if (!_upscaledHires) {
g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, rect.left, rect.top, rect.width(), rect.height());
diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h
index 447eb31d38..ba8d906631 100644
--- a/engines/sci/graphics/screen.h
+++ b/engines/sci/graphics/screen.h
@@ -55,6 +55,7 @@ public:
void copyToScreen();
void copyFromScreen(byte *buffer);
+ void syncWithFramebuffer();
void copyRectToScreen(const Common::Rect &rect);
void copyRectToScreen(const Common::Rect &rect, int16 x, int16 y);