Only one caller exists, and that caller alway passes a non-nullptr
value. Switch to a reference and remove the unused special case to
handle a nullptr input.
Most uses pass an orientation matrix. All sites are deterministic about
whether a matrix is passed. Make the matrix mandatory for sites that
passed it, and split out a separate version of g3_start_instance_matrix
for the 2 sites which do not provide orientation.
Function bm_load does not exist in current tip, 0.58.1-d2x, 0.51-d2x,
nor various early snapshots of D2X (not D2X-Rebirth, just D2X).
Attempting to enable STATION_ENABLED fails without this function. Since
it seems to have been absent for at least 10 years (0.51-d2x tagged Feb
2007), and possibly more than 16 years (D2X snapshots from 2001), it
seems reasonable to assume no one has used this code in any open source
release. Remove it.
This backports into Descent 1 the special-case that loads a Vulcan
cannon when it is dropped. It also fixes a longstanding bug that a
robot that drops more than one of the powerup would fill only one of
them.
Many of these locals are wasteful, since they are always sized to the
biggest buffer required. This is the minimal and safe solution. Future
work will tune them to the correct size.
(a+i) form assumes that a can be used as the left hand side of
operator+(). This is true for pointers, and for C arrays that degrade
into pointers, but not for C++ std::array. Switch to the explicit
syntax.
git grep -lz 'multibuf+' | xargs -0 sed -i -e 's/(\s*multibuf\s*+\s*\(\w\+\),/(\&multibuf[\1],/g'
Remove the `basic_` prefix from valptridx<T>::basic_ptr, ::basic_idx,
and ::basic_ptridx. Since the public names are typedef aliases of these
classes, these class names appear frequently in debug information and
error messages. The `basic_` prefix is unnecessary. Remove it.
git grep -lz '\<basic_\(ptr\|ptridx\|idx\)\>' -- common/include/ | xargs -0 sed -i -e 's/\<basic_\(ptr\|ptridx\|idx\)\>/\1/g'
Little endian systems stored sound as a `uint32_t`, but sent only the
lowest byte. Store only that byte, since the destination was unaligned
and was the last field in the message.
LTO allows the compiler to prove variable values that non-LTO mode
cannot prove. The workaround for the gcc-7 __builtin_constant_p
quirk incorrectly caused LTO on older gcc to report __builtin_constant_p
as unsupported. Fix this by adding a stub asm() statement to hide the
value of the input parameter from the compiler.
Fixes: 1ed7cec714 ("Tighten __builtin_constant_p check to handle gcc-7")
On Windows, the hook function blocks until the user dismisses the
message box. Print the message before opening the message box so that
it is available on the console, if one exists.
Players keep reporting errors that trace to the game rejecting invalid
data from user-made maps. In this case, asymmetric connectivity in
_Descent Vignettes_[1] level _Stalactite Volcano_ (level 15 in Descent,
level 14 in Descent 2) caused an exception when trying to render part of
the first big room.
The debug build shipped with function `check_segment_connections` to
detect some types of connectivity errors. Expose this function to
release builds, and call it for user-made maps. It already checked for
asymmetric segment links. Extend that to hotfix those links by breaking
the asymmetric connection. Log an URGENT class message when this
happens, so that users are aware that the level was modified at load.
Move the `NDEBUG` guards into `check_segment_connections` so that
non-debug builds check only for segment symmetry, but do not check for
normals and face count errors.
[1] http://www.enspiar.com/dmdb/viewMission.php?id=724
```
sha1sum vignette.hog vignette.msn
3cd659e6dd5927b41157dfb7d1dd87d90e781f01 vignette.hog
1f7d140ffab11816364040dd6da71a1568393a16 vignette.msn
stat -c '%s %Y %n' vignette.hog vignette.msn
5717889 1251643308 vignette.hog
956 1250212930 vignette.msn
```
Reported-by: MegaDescent <http://forum.dxx-rebirth.com/showthread.php?tid=970>
Revert to the user's chosen resolution, not to 0x0, which would then be
coerced to the minimum resolution. When the text says revert, it should
revert, not just pick a size.
Change the "OK" label to say "Revert to NxM" for the resolution it is
reverting to.
Tighten input validation so that a blank width or blank height produce
the correct error message, rather than being coerced to 0, then
rejecting 0 as too small.
Early implementations of integer_sequence used a naive implementation
that required one level of template depth per additional integer in the
sequence. Rebirth uses a private alternate implementation named
make_tree_index_sequence that requires only log(N) steps for an
N-element index_sequence. Recent versions of gcc ship a log(N) version
of integer_sequence. Probe for that version and, if found, use it
instead of the private implementation, on the theory that the compiler
writers did at least as good a job as I did, and possibly better if they
were able to leverage compiler implementation details.