[Scummvm-git-logs] scummvm branch-2-7 -> efb36f05234293432fddb9aafc0b4198b5867270

sev- noreply at scummvm.org
Wed Jan 25 23:13:02 UTC 2023


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

Summary:
a455bbc0e3 DIRECTOR: Enhance printed Cast info, show full path when it is specified
efb36f0523 DIRECTOR: Properly load external sound cast members


Commit: a455bbc0e3333b62d1fcd4b0de8c8696f0384091
    https://github.com/scummvm/scummvm/commit/a455bbc0e3333b62d1fcd4b0de8c8696f0384091
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-26T00:12:20+01:00

Commit Message:
DIRECTOR: Enhance printed Cast info, show full path when it is specified

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 65ea9d08dc7..e0bbc9f8e9e 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -1535,6 +1535,10 @@ Common::String Cast::formatCastSummary(int castId = -1) {
 			*it, castTypeToString(castMember->_type).c_str(),
 			castMemberInfo ? castMemberInfo->name.c_str() : ""
 		);
+
+		if (castMemberInfo && !castMemberInfo->fileName.empty())
+			result += ", filename=\"" + castMemberInfo->directory + g_director->_dirSeparator + castMemberInfo->fileName + "\"";
+
 		if (!info.empty()) {
 			result += ", ";
 			result += info;


Commit: efb36f05234293432fddb9aafc0b4198b5867270
    https://github.com/scummvm/scummvm/commit/efb36f05234293432fddb9aafc0b4198b5867270
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-26T00:12:36+01:00

Commit Message:
DIRECTOR: Properly load external sound cast members

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index e0bbc9f8e9e..82dd3dadb42 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -765,29 +765,29 @@ void Cast::loadSoundData(int key, SoundCastMember *soundCast) {
 		sndData = _castArchive->getResource(tag, sndId);
 	}
 
-	if (sndData != nullptr) {
-		if (sndData->size() == 0) {
-			// audio file is linked, load from the filesystem
-			Common::String filename = _castsInfo[key]->fileName;
+	if (sndData == nullptr || sndData->size() == 0) {
+		// audio file is linked, load from the filesystem
+		Common::String filename = _castsInfo[key]->fileName;
 
-			if (!_castsInfo[key]->directory.empty())
-				filename = _castsInfo[key]->directory + g_director->_dirSeparator + _castsInfo[key]->fileName;
+		if (!_castsInfo[key]->directory.empty())
+			filename = _castsInfo[key]->directory + g_director->_dirSeparator + _castsInfo[key]->fileName;
 
-			AudioFileDecoder *audio = new AudioFileDecoder(filename);
-			soundCast->_audio = audio;
-		} else {
-			SNDDecoder *audio = new SNDDecoder();
-			audio->loadStream(*sndData);
-			soundCast->_audio = audio;
-			soundCast->_size = sndData->size();
-			if (_version < kFileVer400) {
-				// The looping flag wasn't added to sound cast members until D4.
-				// In older versions, always loop sounds that contain a loop start and end.
-				soundCast->_looping = audio->hasLoopBounds();
-			}
+		warning("Filename is: %s", filename.c_str());
+
+		AudioFileDecoder *audio = new AudioFileDecoder(filename);
+		soundCast->_audio = audio;
+	} else {
+		SNDDecoder *audio = new SNDDecoder();
+		audio->loadStream(*sndData);
+		soundCast->_audio = audio;
+		soundCast->_size = sndData->size();
+		if (_version < kFileVer400) {
+			// The looping flag wasn't added to sound cast members until D4.
+			// In older versions, always loop sounds that contain a loop start and end.
+			soundCast->_looping = audio->hasLoopBounds();
 		}
-		delete sndData;
 	}
+	delete sndData;
 }
 
 void Cast::loadCastMemberData() {




More information about the Scummvm-git-logs mailing list