Switch from formatting the strings each time they are drawn to format
them once and save them in scores_menu. Change the drawing logic to
draw from those saved strings. Change the reset logic to reinitialize
those strings instead of recreating the entire menu.
Previously, the guidebot menu was given the full screen dimensions and
drew on only part of them, allowing the rest of the screen to be visible
due to not repainting it. Change to make the escort_menu window the
size that the user sees.
Most callers do not need it, and it is only vaguely related to the
purpose of measuring a particular string. For those callers that need
it, lift it out.
Some targets only ever use GUI warn functions. On those targets:
- initialize `warn_func` to `msgbox_warning` at compile time
- remove the runtime initialize of warn_func in main
On targets which do not call `clear_warn_func`, preprocess out its
declaration and definition.
Taken together, these changes allow some targets not to define
`warn_printf`.
On x86_64-w64-mingw32, `uint_fast32_t` is `unsigned int`. Use the
appropriate format macro for it, instead of writing `lu` and expecting
that `uint_fast32_t` will be `unsigned long`.
gcc-7 warns if a structured binding defines a variable, and then does
not use it. Suppress the warning, since the binding is needed in the
non-editor build.
1024 is excessive. 128 leaves 25 bytes unused on Trainee (the longest
difficulty string, tied with Hotshot) at time 0:00:00. A player who
reached double-digit hours for both time on level and time in game would
need 2 bytes more. A player who rescued 100 hostages would need another
2 bytes.
The existing code checks that w.m_ptr is not nullptr before using it.
clang's flow analysis is unable to prove that w.m_ptr does not become
nullptr after it was first checked, even though `w` is const. This
causes clang to include calls to null_pointer_exception::report, which
is not instantiated for wall. That in turn causes a link error.
Rewrite the code to let clang see that the value tested is the value
used, and that no nullptr dereference can happen here.