aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorFilippos Karapetis2013-03-03 16:08:53 +0200
committerFilippos Karapetis2013-03-03 16:10:02 +0200
commitbb7930cf9c0adf8e64b1245655ada2ec1d5910ef (patch)
tree63f1fdf43f78661721b20b98561074589dc1fece /audio
parentb3d52de50f6c6ea9dc47ed5128b4c2ef9fa5fda4 (diff)
downloadscummvm-rg350-bb7930cf9c0adf8e64b1245655ada2ec1d5910ef.tar.gz
scummvm-rg350-bb7930cf9c0adf8e64b1245655ada2ec1d5910ef.tar.bz2
scummvm-rg350-bb7930cf9c0adf8e64b1245655ada2ec1d5910ef.zip
MT-32: Avoid using sinf() (which is C99) in favor of sin()
Diffstat (limited to 'audio')
-rw-r--r--audio/softsynth/mt32/LegacyWaveGenerator.cpp6
-rw-r--r--audio/softsynth/mt32/Tables.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/audio/softsynth/mt32/LegacyWaveGenerator.cpp b/audio/softsynth/mt32/LegacyWaveGenerator.cpp
index 139c89295f..d315fb431b 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 ffd784a4b4..743820b1f8 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