| 1 |
/* Libvisual-plugins - Standard plugins for libvisual |
| 2 |
* |
| 3 |
* Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit <[email protected]> |
| 4 |
* |
| 5 |
* Authors: Dennis Smit <[email protected]> |
| 6 |
* |
| 7 |
* $Id: table.c,v 1.4 2006/01/22 13:25:26 synap Exp $ |
| 8 |
* |
| 9 |
* This program is free software; you can redistribute it and/or modify |
| 10 |
* it under the terms of the GNU General Public License as |
| 11 |
* published by the Free Software Foundation; either version 2 |
| 12 |
* of the License, or (at your option) any later version. |
| 13 |
* |
| 14 |
* This program is distributed in the hope that it will be useful, |
| 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
* GNU General Public License for more details. |
| 18 |
* |
| 19 |
* You should have received a copy of the GNU General Public License |
| 20 |
* along with this program; if not, write to the Free Software |
| 21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 |
*/ |
| 23 |
|
| 24 |
#include <math.h> |
| 25 |
|
| 26 |
#include "common.h" |
| 27 |
#include "table.h" |
| 28 |
|
| 29 |
float _oink_table_sin[OINK_TABLE_NORMAL_SIZE]; |
| 30 |
float _oink_table_cos[OINK_TABLE_NORMAL_SIZE]; |
| 31 |
float _oink_table_sinlarge[OINK_TABLE_LARGE_SIZE]; |
| 32 |
float _oink_table_coslarge[OINK_TABLE_LARGE_SIZE]; |
| 33 |
|
| 34 |
void _oink_table_init (void) |
| 35 |
{ |
| 36 |
float adder; |
| 37 |
int i; |
| 38 |
|
| 39 |
adder = 0; |
| 40 |
for (i = 0; i < OINK_TABLE_NORMAL_SIZE; i++) |
| 41 |
{ |
| 42 |
_oink_table_sin[i] = sin (adder); |
| 43 |
_oink_table_cos[i] = cos (adder); |
| 44 |
|
| 45 |
adder += ((PI * 2) / OINK_TABLE_NORMAL_SIZE); |
| 46 |
} |
| 47 |
|
| 48 |
adder = 0; |
| 49 |
for (i = 0; i < OINK_TABLE_LARGE_SIZE; i++) |
| 50 |
{ |
| 51 |
_oink_table_sinlarge[i] = sin (adder); |
| 52 |
_oink_table_coslarge[i] = cos (adder); |
| 53 |
|
| 54 |
adder += ((PI * 2) / OINK_TABLE_LARGE_SIZE); |
| 55 |
} |
| 56 |
} |
| 57 |
|