bmread.cpp uses PRIuFAST32, so it should include inttypes.h to get the
definition of this macro. Some platforms happened to include inttypes.h
as an implementation detail, but for portability, it needs to be
included explicitly in this file.
Reported-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/678#issuecomment-1304962448>
The documentation for `strcpy` states in part:
```
The strings may not overlap
```
However, for this use, the strings do overlap. Switch to `std::move`,
which is documented to handle this so long as the destination iterator
is outside the source range, which it will be for this use.
Previously, the `strcpy` would preserve the `:`, but overwrite the ` `.
This is probably not what the player wants, since the first `": "` in
the line can direct a message to specific recipients, but a bare `":"`
will not. As a result, the old system would send the first part
privately, but then mangle the directed-message prefix such that
subsequent parts were sent publicly. Switch to preserve the trailing
space so that the `": "` retains its special meaning in subsequent
messages.
`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`.
Commit 0512ea8d65 changed the value of the tracker_ upid codes when
they were converted from `#define` statements with explicit values to
`enum` members with implicit values. The tracker program is maintained
separately, and continues to use the old values, so games with this
commit use the wrong numbers when requesting service from the tracker.
Switch the upid codes back to their previous values, and add a warning
comment about the special compatibility concerns for tracker upid
codes, relative to game-to-game codes.
Fixes: 0512ea8d65 ("Use enum class for upid")
The cockpit graphic is not scaled in the SDL build, so it is only
meaningful to show when the game window dimensions match the graphic's
dimensions. Prior to 4a8d7c7574, this worked, because the
`initial_large_game_screen_mode` was the same as the graphic's
dimensions. That commit changed `initial_large_game_screen_mode` to
prefer a larger screen resolution for new users. It should have
retained the original dimensions for this test. Make that change here.
Fixes: 4a8d7c7574 ("Default to 1024x768 for new users, not 640x480")
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.
Per the header comments, passing nullptr for source or destination
copies the entire region. Use that instead of explicitly requesting the
entire region. This should be more efficient, since it bypasses the
source rectangle clipping code that SDL would otherwise run.
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.
gcc reports:
```
ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second
```
Fix the ambiguity by using an unsigned integer constant.
Change from rewriting the object in place to byte-swap it, then copying
the byte-swapped values into the long term object to instead copy the
values into the object and perform byte-swapping as needed during the
copy.
Commit 5b7fb9c402 incorrectly removed the trailing null from
`g_descent_version`. Add an explicit null, since list initialization
does not imply a null.
Fixes: 5b7fb9c402 ("Reduce use of quotes for passing vers_id defines")
Commit e385ff1c3b switched various sites to use projection to extract
a value and avoid use of a predicate. Two of the converted sites need
to use a predicate in order to test for a value being unequal to a
constant, rather than testing for equality as e385ff1c3b did.
Fixes: e385ff1c3b ("Use std::ranges::find_if instead of std::find_if")
Commit 37132ab887 rearranged the special rules around robot-vs-robot
vector intersection based on an obsolete comment from Descent 1. In
Descent 2, robot-vs-robot collisions are always disabled, so that the
thief bot does not damage itself when flying past other robots.
Reported-by: Glumduk <https://github.com/dxx-rebirth/dxx-rebirth/issues/665>
Fixes: 37132ab887 ("Pass LevelSharedRobotInfoState in fvi_query")