some versions of gcc want to inline DitherBitmap(), and this leads to trouble:
Sources/Engine/Graphics/Graphics.cpp:1167: Error: symbol `rowLoopE' is already defined
Sources/Engine/Graphics/Graphics.cpp:1170: Error: symbol `pixLoopEL' is already defined
...
((ULONG*)td_ulObject)[iFr] is fishy - and ULONG td_ulObject already is
in an union with ULONG* td_pulObjects, so use td_pulObjects when
appropriate (i.e. if td_ctFrames>1)
Also fixed some checks accordingly.
The code used to store the world pointer as a console variable
"pwoCurrentWorld" of type INDEX (int32) - that won't work for 64bit, so
I added CShell::SetCurrentWorld() and CShell::GetCurrentWorld() and
store it as a pointer.
ssam expects lib* to be in the Debug subdir, so make cmake put it there,
this way it's easier to copy the binaries to your install/Bin/ dir to
test.
clang gives a lot of -Wlogical-op-parentheses warnings, suppress them.
introduced PLATFORM_32BIT and PLATFORM_64BIT macros, so you can do
#ifdef PLATFORM_64BIT if you need to.
I needed that for CDrawPort::GetID() to properly CRC a pointer.
Also added a sanity check in Engine/Base/Types.h that makes sure that
uintprt_t and size_t have the same size, as the code uses size_t to
store pointers (or cast from pointer to int) all over the place.
Made some "tags" from Engine/Templates/BSP_internal.h size_t instead of
ULONG - they're used to store pointers to identify vertices and such,
so they'd better be big enough to actually store a pointer.
Some more are still missing.
* 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.