Commit Graph

16 Commits

Author SHA1 Message Date
Johannes Schickel
ec6f00ed1d COMMON: Make Rad<->Deg conversion use float constants.
Since we take a float parameter and return a float value we will also just
work on float values all the way. This silences some float conversion
warnings.
2014-06-02 01:00:15 +02:00
Johannes Schickel
854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
D G Turner
26a9b528da COMMON: Move definition of math constants to scummsys header.
This should have no effect on common/math.h as scummsys is included at
the top anyway, but this will fix compilation on some toolchains when
strict ANSI language compliance is enabled i.e. -std=c++11, rather than
-std=gnu11.

This causes an issue as a side effect is to set a guard which disables
various non-standard defines in the system headers i.e. the M_PI and
M_SQRT1_2 constant definitions in the MinGW x86_64 toolchain on
buildbot.

By moving this into scummsys.h after the point of system math.h
inclusion, we can ensure that M_PI etc. are always present.
2013-07-31 06:18:58 +01:00
Christoph Mallon
a64b5e2a77 ALL: Use GCC_ATLEAST(). 2012-03-17 20:09:49 +01:00
Bertrand Augereau
ff98725172 COMMON: intLog2 uses _BitScanReverse on MSVC 2011-08-19 01:05:37 +02:00
Johannes Schickel
950faa4143 COMMON: Limited gcc specific intLog2 to gcc 3.4 or newer.
Older gcc versions did not include __builtin_clz, which made the PS2 port
fail to compile, since it uses 3.2.2.
2011-07-24 20:18:21 +02:00
Johannes Schickel
a1bfbe65ba COMMON: Add an optimized intLog2 implementation for gcc using __builtin_clz.
This is done as discussed here:
54f25aa843
2011-07-24 19:54:49 +02:00
Johannes Schickel
b609100a56 COMMON: Let intLog2 return an int instead of uint32, since it should return -1 for 0. 2011-07-24 19:53:48 +02: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
D G Turner
54f25aa843 COMMON: Renamed Integer Log2 function from log2 to intLog2.
This avoids naming collisions with system libraries on some platforms
i.e. DS, DC where the log2 is realised by macro.
2011-07-19 02:29:13 +01:00
Matthew Hoops
26d15ce675 COMMON: Fix comment 2011-07-18 11:53:47 -04:00
Matthew Hoops
87b4ef5547 COMMON: Update code from eos 2011-07-18 10:28:10 -04:00
Matthew Hoops
c4d3a86010 COMMON: Remove USE_BINK checks from header files 2011-07-18 10:13:50 -04:00
Matthew Hoops
a50abde1b1 BUILD: Allow for disabling Bink support 2011-07-13 12:08:26 -04:00
Matthew Hoops
7dc7271316 COMMON: Remove unused vector2orientation function 2011-07-03 13:32:05 -04:00
Matthew Hoops
1d4ec6f1d1 COMMON: Add some simple math utilities
Based on eos' code
2011-07-02 15:15:04 -04:00