Commit 47a6f744d split out redundant code, but accidentally stored
temporaries in a `signed short` instead of a `fix` as they should have
been. This truncated some values, causing odd results whenever
quaternions were used. Fix the problem by storing the intermediate
results in a `fix`.
Fixes: 47a6f744d8 ("Factor out vms_quaternion_from_matrix division")
Reported-by: Ninjared <https://forum.dxx-rebirth.com/showthread.php?tid=1113>
Remove the fallback to Boost.Begin. C++14 is now the minimum supported
standard, and any conforming C++14 compiler should have a working C++11
std::begin.
Descent 1 mangles colors during `g3_init_polygon_model`, so this must
not be called on polygons not designed for mangling. Rearrange the
logic to allow Descent 1 to verify that polygon models are well-formed
without using the functions that mangle the colors.
Fixes: 42a2e3ab0b ("Avoid crash loading polymodels with invalid subcalls")
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/416>
The highest-level tracking code assumed filenames would always fit in a
char[9]. This was true on DOS, but has not been true in Rebirth for
many years. Builds without fortification caused silent memory
corruption in this case.
Refuse to create highest-level entries if they would cause corruption.
Log a diagnostic telling the user that this happened.
Fix original bug that buddy was limited to 5 hints per program run, not
5 per boss as it probably should have been.
Due to savegame format limitations, this still is not right. Reloading
the game should restore Buddy_gave_hint_count to its value at save time,
but will not.
Bitmaps based on grs_main_bitmap own their data. Bitmaps based on
grs_bitmap do not. Adjust prototypes to prevent initializing a
grs_main_bitmap with data it will not own.
Processing sharepath in SConf is incorrect, because targets can share a
build directory (and therefore an SConf run), but not share a sharepath.
Move sharepath handling out of SConf. Move DXX_USE_SHAREPATH handling
from CGameArg to GameArg, since one game can be built with a sharepath
while the other is built without.
- Raise the player limit to 8.
- Remove the logic that forces player counts up/down when switching
between cooperative and deathmatch game modes.
- Add heuristics to add start positions for the extra players, since
standard maps will not have the required number of starts.
Add experimental support for using ADL MIDI instead of SDL for music
playback. Support for ADL MIDI contributed by Github user jpcima. This
feature is minimally supported by the core Rebirth team, but is included
as a courtesy so that users need not patch in support separately.
Suggested-by: jpcima <https://github.com/dxx-rebirth/dxx-rebirth/pull/408>
Add configuration file entries for number of chips, bank index, and
whether to use ADL MIDI. Currently, there is no GUI for this.
Interested users must enable it via direct configuration file editing.
A menu interface will come later.
- Use the Windows type `HMODULE` on Windows, and define a local alias to
it on non-Windows. This makes the code slightly clearer about the
nature of the value `handle`.
- Move the `dlopen` emulation into the anonymous namespace to encourage
inlining, since the wrappers are trivial name/signature compatibility
functions.
- Move the error reporting out of the template function, so that it is
not redundantly instantiated for each type used with the template.
Global data will default to nullptr, so the initialization is
unnecessary. Some compilers may store the pointer in `.data` when it is
initialized to any value.