[Scummvm-git-logs] scummvm master -> 55522a39b59656685fe3cba8fa41b2d247ac69d1

sluicebox noreply at scummvm.org
Tue Oct 22 06:19:46 UTC 2024


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:
55522a39b5 SCI: Remove unused check from SoundCommandParser


Commit: 55522a39b59656685fe3cba8fa41b2d247ac69d1
    https://github.com/scummvm/scummvm/commit/55522a39b59656685fe3cba8fa41b2d247ac69d1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-10-21T23:18:54-07:00

Commit Message:
SCI: Remove unused check from SoundCommandParser

CID 1563851

Changed paths:
    engines/sci/sound/soundcmd.cpp
    engines/sci/sound/soundcmd.h


diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index d40760787c0..b5a983ed97a 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -68,11 +68,7 @@ reg_t SoundCommandParser::kDoSoundInit(EngineState *s, int argc, reg_t *argv) {
 	return s->r_acc;
 }
 
-int SoundCommandParser::getSoundResourceId(reg_t obj) {
-	if (obj.getSegment() == 0) {
-		return -1;
-	}
-
+uint16 SoundCommandParser::getSoundResourceId(reg_t obj) {
 	uint16 resourceId = readSelectorValue(_segMan, obj, SELECTOR(number));
 
 	// Modify the resourceId for the Windows versions that have an alternate MIDI soundtrack, like SSCI did.
@@ -143,7 +139,7 @@ void SoundCommandParser::initSoundResource(MusicEntry *newSound) {
 }
 
 void SoundCommandParser::processInitSound(reg_t obj) {
-	int resourceId = getSoundResourceId(obj);
+	uint16 resourceId = getSoundResourceId(obj);
 
 	// Check if a track with the same sound object is already playing
 	MusicEntry *oldSound = _music->getSlot(obj);
@@ -211,7 +207,7 @@ void SoundCommandParser::processPlaySound(reg_t obj, bool playBed, bool restorin
 			error("Failed to initialize uninitialized sound slot");
 	}
 
-	int resourceId;
+	uint16 resourceId;
 	if (!restoring)
 		resourceId = getSoundResourceId(obj);
 	else
diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h
index 93678827d5c..0c014f96a81 100644
--- a/engines/sci/sound/soundcmd.h
+++ b/engines/sci/sound/soundcmd.h
@@ -119,7 +119,7 @@ private:
 	void processInitSound(reg_t obj);
 	void processDisposeSound(reg_t obj);
 	void processUpdateCues(reg_t obj);
-	int getSoundResourceId(reg_t obj);
+	uint16 getSoundResourceId(reg_t obj);
 	
 	/**
 	 * Returns true if the sound is already playing and shouldn't be interrupted.




More information about the Scummvm-git-logs mailing list