Switch from using a macro to capture __FILE__,__LINE__ to using
__builtin_FILE(),__builtin_LINE(). Make the event an explicit argument,
instead of assuming it is a variable named `event`. Move the
implementation out of line.
Since this should never be invoked, simplify the definition. The new
version is slightly less informative in case a logic error causes it to
be called, but is far shorter and easier to understand.
object_create_muzzle_flash delegated to
object_create_explosion_without_damage, adding one parameter that
callers ought to provide instead. Inline object_create_muzzle_flash into
callers and change them to provide `Vclip`.
Win32 aliases `size_t` to `unsigned int`, causing
`static_cast<size_t>(V)` to be a useless cast when `V` has type
`unsigned int`. Switch to using direct initialization, which is not a
cast and so does not trigger a warning, but does produce the correct
type. This form disallows narrowing, so inputs that might change in
value as a result of the conversion are an error. Since this is a
sanity checking macro, that is a useful safety measure.
Reported-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/678#issue-1437577368>
`object_create_explosion` delegated to
`object_create_explosion_without_damage`, adding one parameter that
callers ought to provide instead. Inline `object_create_explosion` into
callers and change them to provide `Vclip`.
Apple clang is currently version 14, but Apple's libc++ is version 13,
and so lacks even more std::ranges support than previously reported.
Add more stub backports to work around this.
The Rebirth main screen grd_curscreen borrows the memory allocated by
SDL_CreateRGBSurface to store its data. Store the pointer to that
surface inside grd_curscreen and make grd_curscreen responsible for
freeing the surface.
OS X still uses clang-14, which lacks sufficient std::ranges support for
recent Rebirth changes.
- Rewrite uses of std::ranges::SYMBOL to ranges::SYMBOL
- Add a stub header that, on gcc, provides for each SYMBOL a statement
`using std::ranges::SYMBOL;`, to delegate back to the standard library
implementation.
- On clang, define a minimal implementation of the required symbols,
without constraint enforcement. Compile-testing with gcc will catch
constraint violations.
Once OS X clang ships a standard library with the required features,
this stub header will be removed and the uses changed back to their full
names.
Adding `final` can allow gcc to devirtualize a call. Request compiler
warnings wherever `final` would improve this. As of this writing, there
are no places where `final` would be helpful and would also be wrong, so
this is enabled everywhere.
enumerated_bitset expects that typename `E` and `std::size_t` are
distinct types. On some i686 targets, `std::size_t` is an alias for
`unsigned int`, so setting `E = uint32_t` causes `std::size_t` and `E`
to be the same type.
Add a workaround by using `unsigned int` or `unsigned long`, whichever
one `std::size_t` is not. This will become unnecessary once
`playernum_t` becomes an `enum class`.
Reported-by: pkubaj <https://github.com/dxx-rebirth/dxx-rebirth/issues/662>
VR requires glDrawBuffer, which Mesa OpenGL ES does not offer. Default
VR to disabled for OpenGL ES users. Users who want to try it anyway can
still set use_stereo_render=1 in the SCons environment.
std::ranges::range<T> requires that T provide a reasonable `end()`.
cstring_tie did not provide one since it uses private inheritance of
`std::array`. However, it can provide a reasonable one, so define that
here.
The concept std::ranges::range<T> requires that std::ranges::end(T) be
well-formed. An input with a `const` qualified member fails this test,
and causes std::ranges::range<T> to reject an otherwise satisfiable
range.