aboutsummaryrefslogtreecommitdiff
path: root/common/sinetables.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-06-08 21:28:27 +0200
committerJohannes Schickel2013-06-08 21:47:52 +0200
commit4efc9b152c89aafe8a8b4f47c7f0d3d9db945df8 (patch)
tree40b56644fcdf3729ee0747af1f584a8cf454e59f /common/sinetables.cpp
parent21f87070afa31f30593e85a9ddd5fcb84c292ec8 (diff)
downloadscummvm-rg350-4efc9b152c89aafe8a8b4f47c7f0d3d9db945df8.tar.gz
scummvm-rg350-4efc9b152c89aafe8a8b4f47c7f0d3d9db945df8.tar.bz2
scummvm-rg350-4efc9b152c89aafe8a8b4f47c7f0d3d9db945df8.zip
COMMON: Save memory by allocating only required entries in Cosine-/SineTable.
The tables only contain (2^bitPrecision)/2 entries. The code allocated twice as many entries previously.
Diffstat (limited to 'common/sinetables.cpp')
-rw-r--r--common/sinetables.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/sinetables.cpp b/common/sinetables.cpp
index 2198dbfd1a..7338166d39 100644
--- a/common/sinetables.cpp
+++ b/common/sinetables.cpp
@@ -34,7 +34,7 @@ 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*i/m) for 0<=i<m/4,
// followed by m/2<=i<3m/4