[Scummvm-git-logs] scummvm master -> 96cd5947faf983a24cdf381109635fe157bcaaec

sev- sev at scummvm.org
Thu Jul 1 22:04:17 UTC 2021


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:
96cd5947fa SAGA2: Simplify music playback API


Commit: 96cd5947faf983a24cdf381109635fe157bcaaec
    https://github.com/scummvm/scummvm/commit/96cd5947faf983a24cdf381109635fe157bcaaec
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-02T00:03:46+02:00

Commit Message:
SAGA2: Simplify music playback API

Changed paths:
    engines/saga2/audio.cpp
    engines/saga2/audiosys.h
    engines/saga2/noise.cpp


diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp
index 338e0417a9..d04847924b 100644
--- a/engines/saga2/audio.cpp
+++ b/engines/saga2/audio.cpp
@@ -96,8 +96,10 @@ void audioInterface::playMe(void) {
 	audio->queue.playNext();
 }
 
-void audioInterface::queueMusic(soundSegment s, decoderSet *, int16 loopFactor, sampleLocation where) {
+void audioInterface::playMusic(soundSegment s, int16 loopFactor, sampleLocation where) {
 	warning("STUB: audioInterface::queueMusic()");
+
+
 }
 
 void audioInterface::stopMusic(void) {
diff --git a/engines/saga2/audiosys.h b/engines/saga2/audiosys.h
index 58ae0e0a64..b3375c0ce8 100644
--- a/engines/saga2/audiosys.h
+++ b/engines/saga2/audiosys.h
@@ -245,7 +245,7 @@ public:
 	void playMe(void);
 
 	// music calls
-	void queueMusic(soundSegment s, decoderSet *, int16 loopFactor = 1, sampleLocation where = Here);
+	void playMusic(soundSegment s, int16 loopFactor = 1, sampleLocation where = Here);
 	void stopMusic(void);
 	soundSegment currentMusic(void) {
 		return playing;    // ID of music currently playing
diff --git a/engines/saga2/noise.cpp b/engines/saga2/noise.cpp
index b9eb3dc389..5820956ca1 100644
--- a/engines/saga2/noise.cpp
+++ b/engines/saga2/noise.cpp
@@ -439,25 +439,8 @@ void playMusic(uint32 s) {
 
 	currentMidi = s;
 
-	Common::SeekableReadStream *stream = loadResourceToStream(musicRes, s, "music data");
-	Common::DumpFile out;
-
-	Common::String path = Common::String::format("./dumps/mus%s.mus", tag2strP(s));
-
-	if (out.open(path, true)) {
-		int size = musicRes->getSize(s, "music data");
-		byte *buf = (byte *)malloc(size);
-		stream->read(buf, size);
-		out.write(buf, size);
-		out.flush();
-		out.close();
-	}
-
-	delete stream;
-
-
 	if (hResCheckResID(musicRes, s)) {
-		audio->queueMusic(s, musicDec, 0);
+		audio->playMusic(s, 0);
 	} else
 		audio->stopMusic();
 }




More information about the Scummvm-git-logs mailing list