[Scummvm-git-logs] scummvm master -> b521eb3fd43c77f04e7de59450d132afd881d6fa

sev- sev at scummvm.org
Thu Jan 9 17:16:04 UTC 2020


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0869e02c1b DIRECTOR: Properly reastart movies
b0d31a2afa DIRECTOR: Improve error messages
b521eb3fd4 DIRECTOR: Sanity checks on unsuccessful movie loading


Commit: 0869e02c1be101ef582b3b79ded8ebab4f4dbb7c
    https://github.com/scummvm/scummvm/commit/0869e02c1be101ef582b3b79ded8ebab4f4dbb7c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-09T18:07:23+01:00

Commit Message:
DIRECTOR: Properly reastart movies

Changed paths:
    engines/director/resource.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 4d5f9a9..f422808 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -256,14 +256,21 @@ void DirectorEngine::clearSharedCast() {
 
 	delete _sharedScore;
 
+	_sharedScore = nullptr;
+
 	delete _sharedDIB;
 	delete _sharedSTXT;
 	delete _sharedSound;
 	delete _sharedBMP;
+
+	_sharedDIB = nullptr;
+	_sharedSTXT = nullptr;
+	_sharedSound = nullptr;
+	_sharedBMP = nullptr;
 }
 
 void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
-	if (_sharedScore) {
+	if (_sharedScore && _sharedScore->_movieArchive) {
 		if (_sharedScore->_movieArchive->getFileName().equalsIgnoreCase(filename))
 			return;
 	}
@@ -284,6 +291,8 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
 	if (!shardcst->openFile(filename)) {
 		warning("No shared cast %s", filename.c_str());
 
+		delete shardcst;
+
 		_sharedScore = new Score(this);
 
 		return;


Commit: b0d31a2afa00c8af9cd42891b82d897c95c1afc3
    https://github.com/scummvm/scummvm/commit/b0d31a2afa00c8af9cd42891b82d897c95c1afc3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-09T18:10:11+01:00

Commit Message:
DIRECTOR: Improve error messages

Changed paths:
    engines/director/graphics.cpp
    engines/director/resource.cpp


diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index b1030d0..c552c7c 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -311,7 +311,7 @@ void DirectorEngine::testFonts() {
 
 	Common::MacResManager *fontFile = new Common::MacResManager();
 	if (!fontFile->open(fontName))
-		error("Could not open %s as a resource fork", fontName.c_str());
+		error("testFonts(): Could not open %s as a resource fork", fontName.c_str());
 
 	Common::MacResIDArray fonds = fontFile->getResIDArray(MKTAG('F','O','N','D'));
 	if (fonds.size() > 0) {
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index f422808..2f4f589 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -64,7 +64,7 @@ Archive *DirectorEngine::openMainArchive(const Common::String movie) {
 	_mainArchive = createArchive();
 
 	if (!_mainArchive->openFile(movie))
-		error("Could not open '%s'", movie.c_str());
+		error("openMainArchive(): Could not open '%s'", movie.c_str());
 
 	return _mainArchive;
 }


Commit: b521eb3fd43c77f04e7de59450d132afd881d6fa
    https://github.com/scummvm/scummvm/commit/b521eb3fd43c77f04e7de59450d132afd881d6fa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-09T18:15:23+01:00

Commit Message:
DIRECTOR: Sanity checks on unsuccessful movie loading

Changed paths:
    engines/director/resource.cpp
    engines/director/score.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 2f4f589..1123d92 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -63,8 +63,10 @@ Archive *DirectorEngine::openMainArchive(const Common::String movie) {
 
 	_mainArchive = createArchive();
 
-	if (!_mainArchive->openFile(movie))
-		error("openMainArchive(): Could not open '%s'", movie.c_str());
+	if (!_mainArchive->openFile(movie)) {
+		warning("openMainArchive(): Could not open '%s'", movie.c_str());
+		return nullptr;
+	}
 
 	return _mainArchive;
 }
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 67eb27b..ead9342 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -358,13 +358,13 @@ void Score::loadSpriteImages(bool isSharedCast) {
 
 
 Score::~Score() {
-	if (_surface)
+	if (_surface && _surface->w)
 		_surface->free();
 
-	if (_trailSurface)
+	if (_trailSurface && _trailSurface->w)
 		_trailSurface->free();
 
-	if (_backSurface)
+	if (_backSurface && _backSurface->w)
 		_backSurface->free();
 
 	delete _backSurface;




More information about the Scummvm-git-logs mailing list