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

bluegr noreply at scummvm.org
Fri Mar 18 00:10:03 UTC 2022


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:
e45531608f CHEWY: Stop currently playing speech when starting a new one
c319db520a CHEWY: Proper initialization of resource fields
b20f2e34c2 CHEWY: Patch invalid speech sample - fixes missing speech


Commit: e45531608f3820f2ec8984bbde13f5b700749232
    https://github.com/scummvm/scummvm/commit/e45531608f3820f2ec8984bbde13f5b700749232
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-18T02:09:40+02:00

Commit Message:
CHEWY: Stop currently playing speech when starting a new one

Changed paths:
    engines/chewy/sound.cpp


diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index 0bf762c5017..6423eceb1eb 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -152,6 +152,9 @@ void Sound::setMusicVolume(uint volume) {
 }
 
 void Sound::playSpeech(int num, bool waitForFinish) {
+	if (isSpeechActive())
+		stopSpeech();
+
 	// Get the speech data
 	SoundChunk *sound = _speechRes->getSound(num);
 	size_t size = sound->size;


Commit: c319db520a2237af77db89ac6bc9847cf2857c73
    https://github.com/scummvm/scummvm/commit/c319db520a2237af77db89ac6bc9847cf2857c73
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-18T02:09:41+02:00

Commit Message:
CHEWY: Proper initialization of resource fields

Changed paths:
    engines/chewy/resource.cpp
    engines/chewy/resource.h


diff --git a/engines/chewy/resource.cpp b/engines/chewy/resource.cpp
index dffc771f300..dc7cf731449 100644
--- a/engines/chewy/resource.cpp
+++ b/engines/chewy/resource.cpp
@@ -62,15 +62,19 @@ Resource::Resource(Common::String filename) {
 		_encrypted = true;
 
 	_chunkCount = _stream.readUint16LE();
+	_chunkList.reserve(_chunkCount);
 
 	for (uint i = 0; i < _chunkCount; i++) {
 		Chunk cur;
 		cur.size = _stream.readUint32LE();
 
-		if (!isText)
+		if (!isText) {
 			cur.type = (ResourceType)_stream.readUint16LE();
-		else
+			cur.num = 0;
+		} else {
+			cur.type = kResourceUnknown;
 			cur.num = _stream.readUint16LE();
+		}	
 
 		cur.pos = _stream.pos();
 
diff --git a/engines/chewy/resource.h b/engines/chewy/resource.h
index cb746dc0738..4237f5317fb 100644
--- a/engines/chewy/resource.h
+++ b/engines/chewy/resource.h
@@ -36,6 +36,7 @@
 namespace Chewy {
 
 enum ResourceType {
+	kResourceUnknown = -1,
 	kResourcePCX = 0,		// unused
 	kResourceTBF = 1,		// background art, contained in TGPs
 	kResourceTAF = 2,


Commit: b20f2e34c2d6e075193f65bcd72678097d0c2a34
    https://github.com/scummvm/scummvm/commit/b20f2e34c2d6e075193f65bcd72678097d0c2a34
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-18T02:09:41+02:00

Commit Message:
CHEWY: Patch invalid speech sample - fixes missing speech

Changed paths:
    engines/chewy/resource.cpp


diff --git a/engines/chewy/resource.cpp b/engines/chewy/resource.cpp
index dc7cf731449..b4ebd8a9d7f 100644
--- a/engines/chewy/resource.cpp
+++ b/engines/chewy/resource.cpp
@@ -43,6 +43,7 @@ Resource::Resource(Common::String filename) {
 	uint32 header = _stream.readUint32BE();
 	bool isText = (header == headerTxtDec || header == headerTxtEnc);
 	bool isSprite = (header == headerSprite);
+	bool isSpeech = filename.contains("speech.tvp");
 
 	if (header != headerGeneric && !isSprite && !isText)
 		error("Invalid resource - %s", filename.c_str());
@@ -78,6 +79,15 @@ Resource::Resource(Common::String filename) {
 
 		cur.pos = _stream.pos();
 
+		// WORKAROUND: Patch invalid speech sample
+		if (isSpeech && i == 2277 && cur.size == 57028) {
+			cur.size = 152057;
+			_stream.skip(cur.size);
+			_chunkList.push_back(cur);
+			_chunkList.push_back(cur);
+			continue;
+		}
+
 		_stream.skip(cur.size);
 		_chunkList.push_back(cur);
 	}




More information about the Scummvm-git-logs mailing list