[Scummvm-git-logs] scummvm master -> 28731c24f70f5511bb1aa5c7b69a56bd71242b85

rvanlaar noreply at scummvm.org
Fri Sep 16 18:46:09 UTC 2022


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:
28731c24f7 DIRECTOR: revert 1b6e233 Let Cast class manage ...


Commit: 28731c24f70f5511bb1aa5c7b69a56bd71242b85
    https://github.com/scummvm/scummvm/commit/28731c24f70f5511bb1aa5c7b69a56bd71242b85
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-09-16T20:35:13+02:00

Commit Message:
DIRECTOR: revert 1b6e233 Let Cast class manage ...

registering the archive

Resource forks were closed when switching to a different movie.
Those resource forks need to stay available.

In this case for cursors for Star Trek: The Next Generation Interactive Technical Manual

This reverts commit 1b6e2335b39f2296991ad201b78a03d901c5169b.

Changed paths:
    engines/director/cast.cpp
    engines/director/movie.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 4348bfbea45..63b52493f08 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -93,9 +93,6 @@ Cast::~Cast() {
 
 	if (_castArchive) {
 		_castArchive->close();
-
-		g_director->_openResFiles.erase(_castArchive->getPathName());
-
 		delete _castArchive;
 		_castArchive = nullptr;
 	}
@@ -222,9 +219,6 @@ void Cast::setArchive(Archive *archive) {
 	} else {
 		_macName = archive->getFileName();
 	}
-
-	// Register the resfile so that Cursor::readFromResource can find it
-	g_director->_openResFiles.setVal(archive->getPathName(), archive);
 }
 
 void Cast::loadArchive() {
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 7e9e1c3e2fe..821061565d1 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -95,6 +95,10 @@ Movie::Movie(Window *window) {
 Movie::~Movie() {
 	// _movieArchive is shared with the cast, so the cast will free it
 	delete _cast;
+
+	if (_sharedCast)
+		g_director->_openResFiles.erase(_sharedCast->getArchive()->getPathName());
+
 	delete _sharedCast;
 	delete _score;
 }
@@ -281,6 +285,8 @@ void Movie::clearSharedCast() {
 	if (!_sharedCast)
 		return;
 
+	g_director->_openResFiles.erase(_sharedCast->getArchive()->getPathName());
+
 	delete _sharedCast;
 
 	_sharedCast = nullptr;
@@ -307,6 +313,9 @@ void Movie::loadSharedCastsFrom(Common::String filename) {
 	_sharedCast = new Cast(this, 0, true);
 	_sharedCast->setArchive(sharedCast);
 	_sharedCast->loadArchive();
+
+	// Register the resfile so that Cursor::readFromResource can find it
+	g_director->_openResFiles.setVal(sharedCast->getPathName(), sharedCast);
 }
 
 CastMember *Movie::getCastMember(CastMemberID memberID) {




More information about the Scummvm-git-logs mailing list