[Scummvm-cvs-logs] scummvm master -> 5f3ddae421c473fc7e1a02f9c068900c12147b2a

bluegr bluegr at gmail.com
Tue Jul 2 02:54:12 CEST 2013


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:
72a523059f SAGA: Fix odd memcmp() conditions, as reported by clang
5f3ddae421 MT-32: Sync with the latest changes in munt


Commit: 72a523059f4a3c8c4baa77f504b3adecb87d3359
    https://github.com/scummvm/scummvm/commit/72a523059f4a3c8c4baa77f504b3adecb87d3359
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-07-01T17:53:09-07:00

Commit Message:
SAGA: Fix odd memcmp() conditions, as reported by clang

Thanks to LordHoto for pointing those out - they followed the incorrect
paradigm of previous code

Changed paths:
    engines/saga/sndres.cpp



diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp
index 49d2475..ca843af 100644
--- a/engines/saga/sndres.cpp
+++ b/engines/saga/sndres.cpp
@@ -249,11 +249,11 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
 
 		if (!memcmp(header, "Creative", 8)) {
 			resourceType = kSoundVOC;
-		} else if (!memcmp(header, "RIFF", 4) != 0) {
+		} else if (!memcmp(header, "RIFF", 4)) {
 			resourceType = kSoundWAV;
-		} else if (!memcmp(header, "FORM", 4) != 0) {
+		} else if (!memcmp(header, "FORM", 4)) {
 			resourceType = kSoundAIFF;
-		} else if (!memcmp(header, "ajkg", 4) != 0) {
+		} else if (!memcmp(header, "ajkg", 4)) {
 			resourceType = kSoundShorten;
 		}
 


Commit: 5f3ddae421c473fc7e1a02f9c068900c12147b2a
    https://github.com/scummvm/scummvm/commit/5f3ddae421c473fc7e1a02f9c068900c12147b2a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-07-01T17:53:09-07:00

Commit Message:
MT-32: Sync with the latest changes in munt

This syncs our code with munt commits 258cd89 and 17b40a6

Changed paths:
    audio/softsynth/mt32/Part.cpp
    audio/softsynth/mt32/Partial.cpp
    audio/softsynth/mt32/Synth.cpp
    audio/softsynth/mt32/Synth.h
    audio/softsynth/mt32/TVA.cpp



diff --git a/audio/softsynth/mt32/Part.cpp b/audio/softsynth/mt32/Part.cpp
index 62ba346..8840431 100644
--- a/audio/softsynth/mt32/Part.cpp
+++ b/audio/softsynth/mt32/Part.cpp
@@ -175,6 +175,7 @@ void Part::refresh() {
 		patchCache[t].reverb = patchTemp->patch.reverbSwitch > 0;
 	}
 	memcpy(currentInstr, timbreTemp->common.name, 10);
+	synth->newTimbreSet(partNum, patchTemp->patch.timbreGroup, currentInstr);
 	updatePitchBenderRange();
 }
 
@@ -207,7 +208,6 @@ void RhythmPart::setTimbre(TimbreParam * /*timbre*/) {
 
 void Part::setTimbre(TimbreParam *timbre) {
 	*timbreTemp = *timbre;
-	synth->newTimbreSet(partNum, timbre->common.name);
 }
 
 unsigned int RhythmPart::getAbsTimbreNum() const {
@@ -533,7 +533,6 @@ void Part::playPoly(const PatchCache cache[4], const MemParams::RhythmTemp *rhyt
 #if MT32EMU_MONITOR_PARTIALS > 1
 	synth->printPartialUsage();
 #endif
-	synth->partStateChanged(partNum, true);
 	synth->polyStateChanged(partNum);
 }
 
@@ -614,9 +613,6 @@ void Part::partialDeactivated(Poly *poly) {
 		freePolys.prepend(poly);
 		synth->polyStateChanged(partNum);
 	}
-	if (activePartialCount == 0) {
-		synth->partStateChanged(partNum, false);
-	}
 }
 
 //#define POLY_LIST_DEBUG
diff --git a/audio/softsynth/mt32/Partial.cpp b/audio/softsynth/mt32/Partial.cpp
index a0aec90..b80a028 100644
--- a/audio/softsynth/mt32/Partial.cpp
+++ b/audio/softsynth/mt32/Partial.cpp
@@ -87,7 +87,6 @@ void Partial::deactivate() {
 	if (poly != NULL) {
 		poly->partialDeactivated(this);
 	}
-	synth->partialStateChanged(this, tva->getPhase(), TVA_PHASE_DEAD);
 #if MT32EMU_MONITOR_PARTIALS > 2
 	synth->printDebug("[+%lu] [Partial %d] Deactivated", sampleNum, debugPartialNum);
 	synth->printPartialUsage(sampleNum);
diff --git a/audio/softsynth/mt32/Synth.cpp b/audio/softsynth/mt32/Synth.cpp
index b7af992..1e1be06 100644
--- a/audio/softsynth/mt32/Synth.cpp
+++ b/audio/softsynth/mt32/Synth.cpp
@@ -201,25 +201,12 @@ void ReportHandler::printDebug(const char *fmt, va_list list) {
 		printf("\n");
 }
 
-void Synth::partStateChanged(int partNum, bool isPartActive) {
-	reportHandler->onPartStateChanged(partNum, isPartActive);
-}
-
 void Synth::polyStateChanged(int partNum) {
 	reportHandler->onPolyStateChanged(partNum);
 }
 
-void Synth::partialStateChanged(const Partial * const partial, int oldPartialPhase, int newPartialPhase) {
-	for (int i = 0; i < MT32EMU_MAX_PARTIALS; i++) {
-		if (getPartial(i) == partial) {
-			reportHandler->onPartialStateChanged(i, oldPartialPhase, newPartialPhase);
-			break;
-		}
-	}
-}
-
-void Synth::newTimbreSet(int partNum, char patchName[]) {
-	reportHandler->onProgramChanged(partNum, patchName);
+void Synth::newTimbreSet(int partNum, Bit8u timbreGroup, const char patchName[]) {
+	reportHandler->onProgramChanged(partNum, timbreGroup, patchName);
 }
 
 void Synth::printDebug(const char *fmt, ...) {
diff --git a/audio/softsynth/mt32/Synth.h b/audio/softsynth/mt32/Synth.h
index 56e88e6..b85e7ae 100644
--- a/audio/softsynth/mt32/Synth.h
+++ b/audio/softsynth/mt32/Synth.h
@@ -249,10 +249,10 @@ protected:
 	virtual void onNewReverbMode(Bit8u /* mode */) {}
 	virtual void onNewReverbTime(Bit8u /* time */) {}
 	virtual void onNewReverbLevel(Bit8u /* level */) {}
-	virtual void onPartStateChanged(int /* partNum */, bool /* isActive */) {}
+	virtual void onPartStateChanged(int /* partNum */, bool /* hasActiveNonReleasingPolys */) {}
 	virtual void onPolyStateChanged(int /* partNum */) {}
 	virtual void onPartialStateChanged(int /* partialNum */, int /* oldPartialPhase */, int /* newPartialPhase */) {}
-	virtual void onProgramChanged(int /* partNum */, char * /* patchName */) {}
+	virtual void onProgramChanged(int /* partNum */, int /* bankNum */, const char * /* patchName */) {}
 };
 
 class Synth {
@@ -370,10 +370,8 @@ private:
 
 	void printPartialUsage(unsigned long sampleOffset = 0);
 
-	void partStateChanged(int partNum, bool isPartActive);
 	void polyStateChanged(int partNum);
-	void partialStateChanged(const Partial * const partial, int oldPartialPhase, int newPartialPhase);
-	void newTimbreSet(int partNum, char patchName[]);
+	void newTimbreSet(int partNum, Bit8u timbreGroup, const char patchName[]);
 	void printDebug(const char *fmt, ...);
 
 public:
diff --git a/audio/softsynth/mt32/TVA.cpp b/audio/softsynth/mt32/TVA.cpp
index 65e5256..5438471 100644
--- a/audio/softsynth/mt32/TVA.cpp
+++ b/audio/softsynth/mt32/TVA.cpp
@@ -34,9 +34,6 @@ TVA::TVA(const Partial *usePartial, LA32Ramp *useAmpRamp) :
 }
 
 void TVA::startRamp(Bit8u newTarget, Bit8u newIncrement, int newPhase) {
-	if (newPhase != phase) {
-		partial->getSynth()->partialStateChanged(partial, phase, newPhase);
-	}
 	target = newTarget;
 	phase = newPhase;
 	ampRamp->startRamp(newTarget, newIncrement);
@@ -46,9 +43,6 @@ void TVA::startRamp(Bit8u newTarget, Bit8u newIncrement, int newPhase) {
 }
 
 void TVA::end(int newPhase) {
-	if (newPhase != phase) {
-		partial->getSynth()->partialStateChanged(partial, phase, newPhase);
-	}
 	phase = newPhase;
 	playing = false;
 #if MT32EMU_MONITOR_TVA >= 1






More information about the Scummvm-git-logs mailing list