[Scummvm-cvs-logs] scummvm master -> bb7930cf9c0adf8e64b1245655ada2ec1d5910ef

bluegr bluegr at gmail.com
Sun Mar 3 15:11:07 CET 2013


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:
bb7930cf9c MT-32: Avoid using sinf() (which is C99) in favor of sin()


Commit: bb7930cf9c0adf8e64b1245655ada2ec1d5910ef
    https://github.com/scummvm/scummvm/commit/bb7930cf9c0adf8e64b1245655ada2ec1d5910ef
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-03-03T06:10:02-08:00

Commit Message:
MT-32: Avoid using sinf() (which is C99) in favor of sin()

Changed paths:
    audio/softsynth/mt32/LegacyWaveGenerator.cpp
    audio/softsynth/mt32/Tables.cpp



diff --git a/audio/softsynth/mt32/LegacyWaveGenerator.cpp b/audio/softsynth/mt32/LegacyWaveGenerator.cpp
index 139c892..d315fb4 100644
--- a/audio/softsynth/mt32/LegacyWaveGenerator.cpp
+++ b/audio/softsynth/mt32/LegacyWaveGenerator.cpp
@@ -172,7 +172,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi
 
 		// Correct resAmp for cutoff in range 50..66
 		if ((cutoffVal >= 128.0f) && (cutoffVal < 144.0f)) {
-			resAmp *= sinf(FLOAT_PI * (cutoffVal - 128.0f) / 32.0f);
+			resAmp *= sin(FLOAT_PI * (cutoffVal - 128.0f) / 32.0f);
 		}
 
 		// Produce filtered square wave with 2 cosine waves on slopes
@@ -222,7 +222,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi
 			}
 
 			// Resonance sine WG
-			resSample *= sinf(FLOAT_PI * relWavePos / cosineLen);
+			resSample *= sin(FLOAT_PI * relWavePos / cosineLen);
 
 			// Resonance sine amp
 			float resAmpFadeLog2 = -0.125f * resAmpDecayFactor * (relWavePos / cosineLen); // seems to be exact
@@ -243,7 +243,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi
 
 			// To ensure the output wave has no breaks, two different windows are appied to the beginning and the ending of the resonance sine segment
 			if (relWavePos < 0.5f * cosineLen) {
-				float syncSine = sinf(FLOAT_PI * relWavePos / cosineLen);
+				float syncSine = sin(FLOAT_PI * relWavePos / cosineLen);
 				if (relWavePos < 0.0f) {
 					// The window is synchronous square sine here
 					resAmpFade *= syncSine * syncSine;
diff --git a/audio/softsynth/mt32/Tables.cpp b/audio/softsynth/mt32/Tables.cpp
index ffd784a..743820b 100644
--- a/audio/softsynth/mt32/Tables.cpp
+++ b/audio/softsynth/mt32/Tables.cpp
@@ -82,7 +82,7 @@ Tables::Tables() {
 
 	// There is a logarithmic sine table inside the LA32 chip. The table contains 13-bit integer values.
 	for (int i = 1; i < 512; i++) {
-		logsin9[i] = Bit16u(0.5f - LOG2F(sinf((i + 0.5f) / 1024.0f * FLOAT_PI)) * 1024.0f);
+		logsin9[i] = Bit16u(0.5f - LOG2F(sin((i + 0.5f) / 1024.0f * FLOAT_PI)) * 1024.0f);
 	}
 
 	// The very first value is clamped to the maximum possible 13-bit integer






More information about the Scummvm-git-logs mailing list