After the previous commit, its only purpose is to automatically dismiss
the window after 3 seconds. Users may be surprised by this, and the
automatic dismissal has limited value. Remove it and let the user
remain at the cancel dialog until a decision is made.
The menu operated by kmatrix_poll2 exists only when the containing
kmatrix menu is also open. kmatrix has its own call to
do_protocol_frame, so there is no need for another one here.
Closing the kmatrix window while it is not in the foreground may cause a
use-after-free when it is closed again later, since the event loop can
reenter kmatrix_window::event_handler. Skip the exit logic if the
window is not in the foreground, so that it remains open until it times
out while in the foreground.
Previously, callers chose whether to use a fullscreen background image,
and the newmenu code inferred that callers without a background image
wanted a background box, while those with a background image wanted no
box. Change newmenu_layout to take a parameter specifying the caller's
intent, so that a caller can choose to have any combination of a
background image and a background box.
Calling gr_set_mode invalidates loaded fonts. Avoid a use-after-free by
forcing a cockpit reset, which will reinitialize canvases that reference
the unloaded fonts.
Commit 8a437a759c changed the logic to
always set show_all to 1. This renders the short-circuit logic in
info_display_object_placement irrelevant, as show_all will always force
the information to draw. Remove the variables that were used to decide
whether a redraw was required.
A prior conversion changed the actual rendering to use the argument
cv_font, but still picked which render function to use based on the
flags for the active font. Switch to use only the supplied font.
PHYSFSX_isNewPath retrieves from PhysFS a list of all paths, then
searches them, and frees them at the end. PhysFS can search its own
list without needing the allocations, so delegate the work to it.
->when_selected is always get_absolute_path. Remove the pointer and
replace the indirect calls with a direct reference.
->userdata is always a pointer to the buffer for get_absolute_path to
fill. Change the type from `void *` to an appropriate reference.
The last PhysFS 1 release was in March 2009. The last PhysFS 2 release
was in August 2017, shortly before the release of PhysFS 3 in September
2017. Most distributions have moved to PhysFS 3. Drop support for
PhysFS 1 and PhysFS 2. PhysFS 2 support could be restored if there is
interest.
Remove the use of qsort, since PhysFS sorts the result. The PhysFS sort
is case-sensitive rather than insensitive as the qsort was, but this is
unlikely to matter for most users.
Avoid an unnecessary strlen. The required data can be obtained from the
strchr.
Suppress player files that do not end in `.plr`. PhysFS should not
return such a file, and if it did, later code would likely become
confused. Hide such files from the user.