many unused functions and variables are now commented out
You'll still get tons of warnings, which should mostly fall in one of
the following categories:
1. Unnecessary variables or values generated from .es scripts
2. Pointers assigned to from functions with side-effects: DO NOT REMOVE!
Like CEntity *penNew = CreateEntity_t(...); - even if penNew isn't
used, CreateEntity() must be called there!
Fixed -Wreorder warnings (hopefully the last?), also several potentially
uninitialized variables.
In SetupPixelFormat_OGL() Assert if gap_iDepthBits ends up being 0.
Small adjustments to cmake warning settings for gcc/clang
the builtins are only used when using GCC or clang, of course, otherwise
the usual shifting is done.
Them being inline functions instead of macros increases type safety
and gets rid of problems with signed shifts.
Changed two places in the code that swapped bytes in 32bit ints to use
BYTESWAP32_unsigned() instead - in case of PrepareTexture() this has
probably even fixed issues with signed shifts
bswap_32() is a function specific to Linux, unavailable on FreeBSD and
OS X. Instead of messing with other platform specific functions, #ifdef
and so on provide a fast inline implementation.
* td_pulObjects is explicitly set to NULL in the constructor - before
only td_ulObject was set to NONE (0), so on 64bit half of
td_pulObjects bytes would remain garbage
* only check td_ulObject for NONE if td_ctFrames <= 1 (until now it
would frequently check it for NONE even if td_ctFrames > 1, if
td_pulObjects was != NULL)
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.
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.
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.
I dislike having to do this, but Clang sees them as unused and removes them
from the object file, causing linking to fail.
The real solution here is to remove all the assembly code because it's 2016
and this game doesn't have to run on 133MHz Pentium now. :)