This is necessarily incomplete since it can only check ranges that have
a compile-time static size. However, it catches some simple mistakes,
and imposes no runtime cost, so it is still useful.
For historical reasons, the kcm_* arrays are smaller than the player's
configuration settings. Move the kcm_ arrays to be the first range
passed to zip, so that traversal does not exceed the array.
Fixes: d959eeca8f ("Use zip in kconfig to allow use of range-based for")
When AddressSanitizer is enabled, gcc-10 will warn that strncpy will
truncate the message. This truncation is valid, since it only loses the
terminating null byte, and the next line explicitly supplies a
terminating null. Switch to memcpy to eliminate the warning and produce
simpler code.
Define separate enum values for rotation data in both the high bits,
where it is usually kept, and the low bits, where it is sometimes used
for math or comparisons.
Define an enum value to represent the composite of the index and the
rotation, since the composite is not suitable for use as an array
subscript. Add helper functions to extract the component pieces.
tmap1 cannot be rotated, so checking for it inside
convert_to_d1_tmap_num is wrong. tmap2 can be rotated, and checking for
it outside convert_to_d1_tmap_num is cleaner.
Add a comment in the #include directive to hide it from the PCH scanner,
since this file should not be included in the PCH. It is only used in
one file, and it is included under special circumstances. In
particular, it is included while inside a namespace.
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment. Eventually, segment will be
removed. Adjust references to go through unique_segment to support this
change.
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment. Eventually, segment will be
removed. Adjust references to go through unique_segment to support this
change.
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment. Eventually, segment will be
removed. Adjust references to go through unique_segment to support this
change.
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment. Eventually, segment will be
removed. Adjust references to go through unique_segment to support this
change.
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member. Avoid the disagreement by renaming the
member.
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/532>
This was a leftover from an earlier prototype. gcc-7 warns about it,
but gcc-8 and later silently allow it. Remove it to fix the gcc-7
build, since it is not needed.
Reported-by: Kieltux <https://github.com/dxx-rebirth/dxx-rebirth/issues/531>
Fixes: ec6a78c481 ("Use enum class for marker index types")
Various sites assign GM_GAME_OVER to Game_mode, but no sites test for
it. Its only value would be to clear out other flags, but that can be
done by clearing Game_mode.
In the original code there was a 'Hack to keep sounds from building up...'
which changed a non-forever linked sound to a non-linked sound. Therefore
the forever flag wasn't needed in the demo files. The commit
4a98e796ab removed the hack, which caused
non-forever sounds to start looping on demo playback.
This commit restores the hack as far as demo files are concerned.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/477>
Fixes: 4a98e796ab ("Prevent stacking weapon rotation sounds")