* FloatToInt() should now round correctly ot nearest, even for
negative numbers
* Log2() now calls log2f() instead of log10()*3.321 - no idea what the
previous code was about, I doubt it's faster (and the ASM code uses
something like log2, too).
* FastLog2() (for integers) now uses __builtin_clz() when building with
GCC/clang - the resulting ASM should be pretty similar to the inline
ASM below. I wonder why that function takes signed ints, log2(-1) in
reality is an irrational number (but the function returns 31)..
Also, both the inline ASM and my version return 0 for Log2(0), but
INT_MIN would be closer to the truth
* commented out FastMaxLog2(), it's unused.
* implemented _rotl() using a fast(er) trick from
http://blog.regehr.org/archives/1063
Set the ENABLE_EXPORTS property on the main executables, which adds
linker flag -rdynamic if the compiler supports it. This ensures symbols
are available for dynamic objects (such as shared libEntitiesMPD.so) to
use.
- Detect FreeBSD.
- Set both PLATFORM_UNIX and PLATFORM_FREEBSD. The latter is required to
distinguish FreeBSD from other unixoid platforms like Linux.
- On FreeBSD 3rd party libs are installed to /usr/local, we need to add
/usr/local/include as include directory.
- Add linker options for FreeBSD. FreeBSD has no -ldl.
CMakeLists.txt: Modified to link system wide SDL2 libraries and link to
system wide headers
SplashScreen.cpp: commented out as its post SDL2.0.4 >> SDL_WINDOW_SKIP_TASKBAR
If you have...
void myfunc(char buf[16]) {
printf("%d\n", (int) sizeof (buf));
}
...this will print sizeof (char *) instead of 16, so this fixes a piece of
code that assumed the latter instead of the former.
Touches a lot of code to remove long constants like "1L", so this patch is
large and ugly, but I think it makes all those Clamp() calls look nicer in
the long run.
Most of the game is 64-bit clean, since we can build without assembly code
now. I've marked the things that are obviously still wrong with STUBBED lines.
That being said: a 64-bit build can already run the demos mostly correctly,
so we're actually almost there!
There are a few obvious things that are obviously wrong, to be fixed.