Check if the cockpit window textures are still valid when reusing the
previous cockpit data in cockpit_decode_alpha.
This fixes a crash when leaving the graphics options menu while in
the game with cockpit visible, since that calls
ogl_smash_texture_list_internal which invalidates all textures.
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.
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.