Also changed all "if (this==NULL) return;"s.
Fixes some -Wtautological-undefined-compare warnings.
Quoting Clang:
"'this' pointer cannot be null in well-defined C++ code; comparison may
be assumed to always evaluate to false"
Thanks @SLAwww
(The first parameter to _assert is actually the message, not the
expression to evaluate, so "false &&" doesn't belong in there.)
Conflicts:
Sources/EntitiesMP/Summoner.es
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
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.
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. :)