diff options
author | Strangerke | 2013-06-26 23:11:34 +0200 |
---|---|---|
committer | Strangerke | 2013-06-26 23:11:34 +0200 |
commit | 6e2d567bca53b6ffee771b4105e2e73dbd73f5b4 (patch) | |
tree | 9880f0c496263ffb6928248d495ce4172dabed18 /common/sinetables.cpp | |
parent | ac387835e4527c1814919093b4e4bc9798d5742d (diff) | |
parent | 6716fa39a6fb2a3925576288c256688c5aadd7e9 (diff) | |
download | scummvm-rg350-6e2d567bca53b6ffee771b4105e2e73dbd73f5b4.tar.gz scummvm-rg350-6e2d567bca53b6ffee771b4105e2e73dbd73f5b4.tar.bz2 scummvm-rg350-6e2d567bca53b6ffee771b4105e2e73dbd73f5b4.zip |
Merge branch 'master' of https://github.com/scummvm/scummvm into mortevielle
Conflicts:
engines/engines.mk
Diffstat (limited to 'common/sinetables.cpp')
-rw-r--r-- | common/sinetables.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/sinetables.cpp b/common/sinetables.cpp index a6ec99469d..7338166d39 100644 --- a/common/sinetables.cpp +++ b/common/sinetables.cpp @@ -34,15 +34,15 @@ SineTable::SineTable(int bitPrecision) { int m = 1 << _bitPrecision; double freq = 2 * M_PI / m; - _table = new float[m]; + _table = new float[m / 2]; - // Table contains sin(2*pi*x/n) for 0<=x<=n/4, - // followed by its reverse - for (int i = 0; i <= m / 4; i++) + // Table contains sin(2*pi*i/m) for 0<=i<m/4, + // followed by m/2<=i<3m/4 + for (int i = 0; i < m / 4; i++) _table[i] = sin(i * freq); - for (int i = 1; i < m / 4; i++) - _table[m / 2 - i] = _table[i]; + for (int i = 0; i < m / 4; i++) + _table[m / 4 + i] = -_table[i]; } SineTable::~SineTable() { |