Commit Graph

13 Commits

Author SHA1 Message Date
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
David Fioramonti
51c11efbbc COMMON: Cos/Sin Table switch internal structure so at() is faster
A new internal table has been added so that no if checks need to
be performed for the at() lookup.

The old table can still be accessed using getTable or atLegacy().

at() and atLegacy() return the same values, but at() is faster.
2018-08-25 23:51:40 +02:00
David Fioramonti
9cfc70e7fe COMMON: allow cos/sin number of points to be more flexible
Previously, the cos/sin table had to be a power of 2, but there
are many use cases where the number of points is not necessarily
a power of 2 so this change the constructor so it now takes
in the number of points rather than the number of points as the
exponent of a power of 2.

The restriction is that the size must be divisible by 4.
2018-08-18 16:30:57 +02:00
David Fioramonti
650e26b6ab COMMON: Add at() index function to cosine/sine table
The cos/sin table class now has an at() function for indexing
safely into its internal array.

This allows the checking and computing of the correct
indexes to be done internally.

The indexing in allows cos/sine of 0 to 2pi to be
obtained.

The values returned by getTable are the same as before.

Comments that describe the values that the table
contains has been modified to line up with what
the code is doing.
2018-07-25 10:18:32 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel
4efc9b152c 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.
2013-06-08 21:47:52 +02:00
Johannes Schickel
21f87070af COMMON: Fix regression in SineTable creation.
This is a regression from f4ba8a6485. The
commit replaced the static cosine and sine tables with dynamically created
ones. In the process of that a copy&paste error happened which made the sine
table use the layout of the cosine table. This commit now changes the
dynamically created sine tables to conform to the layout of the previous
static tables.
2013-06-08 21:47:51 +02:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
D G Turner
f4ba8a6485 COMMON: Replaced static Sine and Cosine tables with dynamic generated.
This removes the large static tables from the binary (which saves 500K
to 1Mb of binary size) and replaced them with a class which generates
the required tables as needed in RAM. This has been tested with QDM2
and shows no obvious performance degredation and Memprof shows no
significant rise in RAM usage.
2012-04-14 11:18:55 +01:00
D G Turner
1809b9173c COMMON: Minor reduction of sine/cosine table size (8 bytes...). 2012-04-13 10:16:48 +01:00
Littleboy
da60ff3ded JANITORIAL: Fix MSVC warnings
- Conversion from double to float
 - Unary minus operator applied to unsigned type
 - ARRAYSIZE redefinition
2011-07-19 14:12:07 -04:00
Matthew Hoops
6334ec413f COMMON: Move cosine/sine tables out of header files
Access is now restricted to using the getSineTable()/getCosineTable() helper functions.
2011-07-19 00:45:16 -04:00