Packed structures cannot be passed by reference, may fail on
alignment-strict architectures, and are bad for performance even on
alignment-tolerant architectures. Using them for anything other than an
abstract layout declaration is a mistake. Remove
__attribute__((packed)).
gcc-5 rejects `constexpr bool DefiningMarkerMessage() const` because
`d_marker_state` is not literal. Later versions of gcc accept this, but
the `constexpr` is not useful here since one term is a runtime variable.
Remove `constexpr`.
Also, modify the definition of `marker_message_text_t` and
`d_marker_state` to encourage the compiler to initialize `MarkerState`
at compile time instead of load time.
Fixes: 49a4ac1c0e ("Move more marker state to d_marker_state")
User roncli reports[1] an original game bug that prevents boss
teleportation from operating correctly if the program is not restarted
between each campaign. This is another case of a global variable being
used improperly. Reset the relevant variables when the boss is
initialized.
[1] https://github.com/dxx-rebirth/dxx-rebirth/issues/366#issuecomment-373199624
`build_colormap_good` only took `used` to clear it. Only one caller
needed it cleared. Move the clear into that caller. Remove the
parameter from all calls.
If !defined(DXX_HAVE_CXX_BUILTIN_FILE_LINE), the default value is
omitted, but the comma between values is still required. The comma was
incorrectly guarded, so it was present only when a default value was
set.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/361>
Fixes: 544fc0f893 ("Add support for increased precision of gamelog timestamps")
- Enable display of subsecond (Linux: microseconds; Windows:
milliseconds) precision on gamelog timestamps.
- Add disabled support for YYYY-MM-DD leaders on gamelog timestamps.
Activate it by defining DXX_CONSOLE_TIME_FORMAT_YMD to true.
- Add disabled support for capturing caller __FILE__, __LINE__ in calls
to con_printf, con_puts. Activate it by defining
DXX_CONSOLE_SHOW_FILE_LINE to true. If captured, write those to
gamelog after the timestamp and before the text. This feature (and
only this feature) requires that DXX_HAVE_CXX_BUILTIN_FILE_LINE be
defined, which is conditional on if the compiler has __builtin_FILE()
and __builtin_LINE(). If the compiler lacks this support, attempts to
enable this feature are ignored.
- Switch to using GetLocalTime on Windows.
The Windows exception handler probes the stack to determine how much can
be safely dumped, up to a fixed maximum number of bytes. A logic error
caused the probe function to start its stack probe lower than intended,
so the eventual dump code logs fewer pre-exception bytes than intended.
Fix that error so that the dump shows more pre-exception bytes.
Also, log the address of the ud2 instruction, so that the effective load
address of the module can be determined. Without this, ASLR makes
reading the dumps needlessly difficult.
Rather than use an inline wrapper and rely on the compiler optimizer to
redirect gr_set_current_canvas(nullptr) to gr_set_default_canvas,
rewrite all relevant calls directly in the source.
git grep -l 'gr_set_current_canvas' | xargs sed -i -e 's:gr_set_current_canvas(\s*NULL\|nullptr\s*);:gr_set_default_canvas();:'