[Scummvm-git-logs] scummvm master -> 4fd5e2e0d43e151bb2c53d7d99666b3899a939fd
sev-
sev at scummvm.org
Sat Apr 4 15:45:46 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4fd5e2e0d4 DIRECTOR: Persist screen between movies
Commit: 4fd5e2e0d43e151bb2c53d7d99666b3899a939fd
https://github.com/scummvm/scummvm/commit/4fd5e2e0d43e151bb2c53d7d99666b3899a939fd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-04T17:44:29+02:00
Commit Message:
DIRECTOR: Persist screen between movies
Changed paths:
engines/director/director.cpp
engines/director/director.h
engines/director/score.cpp
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 61307c8c01..2491b9014d 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -257,6 +257,12 @@ Common::Error DirectorEngine::run() {
if (!_nextMovie.movie.empty()) {
_lingo->restartLingo();
+ // Persist screen between the movies
+ // TODO: this is a workaround until the rendering pipeline is reworked
+ if (_currentScore && _currentScore->_surface) {
+ _backSurface.copyFrom(*_currentScore->_surface);
+ }
+
delete _currentScore;
_currentScore = nullptr;
diff --git a/engines/director/director.h b/engines/director/director.h
index 5643755390..dd16c40d29 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -29,6 +29,8 @@
#include "common/hashmap.h"
#include "engines/engine.h"
+#include "graphics/managed_surface.h"
+
#include "director/types.h"
namespace Common {
@@ -144,6 +146,8 @@ public:
MovieReference _nextMovie;
Common::List<MovieReference> _movieStack;
+ Graphics::ManagedSurface _backSurface;
+
protected:
Common::Error run() override;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 1463fe2875..14e275f485 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1519,7 +1519,19 @@ void Score::startLoop() {
_backSurface->create(_movieRect.width(), _movieRect.height());
_backSurface2->create(_movieRect.width(), _movieRect.height());
- g_director->_wm->setScreen(_surface);
+ if (_vm->_backSurface.w > 0) {
+ // Persist screen between the movies
+ // TODO: this is a workaround until the rendering pipeline is reworked
+
+ _backSurface2->copyFrom(g_director->_backSurface);
+ _surface->copyFrom(g_director->_backSurface);
+
+ _vm->_backSurface.free();
+ }
+
+ _vm->_backSurface.create(_movieRect.width(), _movieRect.height());
+
+ _vm->_wm->setScreen(_surface);
_trailSurface->clear(_stageColor);
More information about the Scummvm-git-logs
mailing list