~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to common/sinetables.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-08-10 00:50:36 UTC
  • mfrom: (1.2.22)
  • Revision ID: package-import@ubuntu.com-20140810005036-wls6i0dsxqfxu70g
Tags: 1.7.0+dfsg-1
* New upstream release [July 2014].
  - remove old/obsolete patches.
  + added new "drop1test.patch" to disable problematic test.
  + build with "--disable-eventrecorder" to avoid FTBFS in tests.
  + added "libjpeg-dev" and "libfaad-dev" to Build-Depends.
* Install all arch-independent files (themes, game data, etc.).
* Build-time re-compression of "classic" theme.
* Added "debian/gbp.conf".
* Standards-Version to 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * modify it under the terms of the GNU General Public License
9
9
 * as published by the Free Software Foundation; either version 2
10
10
 * of the License, or (at your option) any later version.
11
 
 
 
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
 * GNU General Public License for more details.
16
 
 
 
16
 *
17
17
 * You should have received a copy of the GNU General Public License
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
34
34
 
35
35
        int m = 1 << _bitPrecision;
36
36
        double freq = 2 * M_PI / m;
37
 
        _table = new float[m];
 
37
        _table = new float[m / 2];
38
38
 
39
 
        // Table contains sin(2*pi*x/n) for 0<=x<=n/4,
40
 
        // followed by its reverse
41
 
        for (int i = 0; i <= m / 4; i++)
 
39
        // Table contains sin(2*pi*i/m) for 0<=i<m/4,
 
40
        // followed by m/2<=i<3m/4
 
41
        for (int i = 0; i < m / 4; i++)
42
42
                _table[i] = sin(i * freq);
43
43
 
44
 
        for (int i = 1; i < m / 4; i++)
45
 
                _table[m / 2 - i] = _table[i];
 
44
        for (int i = 0; i < m / 4; i++)
 
45
                _table[m / 4 + i] = -_table[i];
46
46
}
47
47
 
48
48
SineTable::~SineTable() {