Restrict the Eps precision change only to Pandora platform
fix Inverted Right and Middle button on certain case with SDL
Added some Failsafe. Fixed a crash in the new game intro cinematic (when Boss of TFE die and Sam goes to the UFO) on the Pandora
Some Pandora fine-tunning
Tried some asynchronus input method, but doesn't seems to works
Quoting Clang:
"reference cannot be bound to dereferenced null pointer in well-defined
C++ code; comparison may be assumed to always evaluate to false"
Conflicts:
Sources/CMakeLists.txt
except for EntitiesMP/Fish.es which I'm not sure about, and in
Computer.cpp the weird "if (_iActiveMessage < _acmMessages.Count()==0)"
construct whichs intention I didn't fully grasp, either.
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
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
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.
This was a _ton_ of changes, made 15 years ago, so there are probably some
problems to work out still.
Among others: Engine/Base/Stream.* was mostly abandoned and will need to be
re-ported.
Still, this is a pretty good start, and probably holds a world record for
lines of changes or something. :)