When the user opens the menu via the mouse, grd_curcanv points to a
canvas other than the top level canvas. When the user opens the menu
via the keyboard, grd_curcanv points to the top level canvas. For this
menu, the top level canvas must be used in order to get correct
alignment. Switch the constructor to always use the top level canvas.
Reported-by: dimag0g <https://github.com/dxx-rebirth/dxx-rebirth/issues/564>
Fixes: e45ba0b4a9 ("Make new game menu inherit from newmenu")
Commit 479884288c unintentionally caused the movie window to linger in
the background after a movie was played, which causes a crash when the
window is used later, because part of its state has been cleared.
Use window::track to detect its termination in the usual way, and
eliminate the special logic that tried to track the window by deferring
its deletion. This causes the window to close at the proper time,
thereby avoiding a later crash.
Fixes: 479884288c ("Always delegate to window_create for send_creation_events")
Callers only ever test for whether the movie was skipped, and never
distinguish between a movie that ran to completion versus a movie that
the user interrupted. Combine these two statuses into one value, and
eliminate the logic in RunMovie that picked which of the two to return.
It existed to support the freestanding mve player, which has not been
maintained in years. Even there, the support can be retained by
aligning the name of the function among the source files. mve_main.c
would need to be converted to C++ to enable full support.
Previously, rendering the preferred bomb type could also change it if
the active type was exhausted. This is undesirable, since it depends on
the user to have a HUD mode which causes the bomb type to render.
Switch to only change the active type if the user tries to drop a bomb
while the active type is unavailable. Some call sites already switch
bomb types automatically on depletion. Those sites will still do so.
v0.58.1 did this, but the functionality was accidentally removed in
859b399d20. Restore it.
Fixes: 859b399d20 ("Use mask for Secondary_last_was_super")
std::find_if needs common iterator traits. Add the relevant type
definitions to zip_iterator.
Also add them to d_range, to avoid errors when a range is zipped.
gcc computes a potential value range for game times as [0, 1092] instead
of the [0, 50] that the game uses. This could be reasonable as the code
was before, but even adding an explicit range check before the usage
does not eliminate the warning. Avoid the warning by increasing the
size of the buffer to avoid truncation even if the value were 1092.