Every user now uses inheritance and a virtual function override. Make
callback_handler pure virtual, delete its body, and then delete the
member variables that existed only for use in that body. Remove the
constructor parameters that initialized those variables, and update all
derived classes accordingly.
The requirement to call send_creation_events from outside the
constructor makes the presence of a helper function convenient. Rename
ui_create_dialog to window_create, and move it to window.h.
This reverts commit 2bed74b056. The host
authority functionality, though important, is less important than basic
stability. Exposing the game window during this period causes various
problems, since drawing the window runs game logic:
- On escape from the final level of a mission, the player escapes the mine
twice.
- The game window is freed prematurely during the cleanup after finishing the
mission. This later leads to a use-after-free while trying to return to the
main menu.
- Game sounds continue to play in the background while the kmatrix window is
open.
- There is a brief flash of a game after exiting the kmatrix window, before the
next level initializes completely and the player warps to the correct start
spot.
Remove the logic to expose the game window during this fragile time. If this
breaks the host authority code, that will need to be fixed differently.
Fixes: 2bed74b056 ("During kmatrix bring up Game_wind againso the host can still follow the game - becomes necessary later with host-authority functions")
For gcc bug #10138 [1], gcc-11 gained a new way to show a
-Wmaybe-uninitialized warning. When an uninitialized array is passed by
`const T *` to a function, gcc-11 assumes the array is an input to the
function, and warns accordingly. This is often useful, but is incorrect
for the Rebirth partial_range code. In this code, the pointer is only
passed so that the eventual exception can print the memory address of
the affected array. The called function does not dereference the
pointer, and so cannot be influenced by any uninitialized values in the
underlying array.
Change the report function to take the array address in a `uintptr_t`,
and cast it back for printing. This silences the gcc-11 warning, while
preserving the previous semantics in the code.
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10138
Previously, if SDL_AllocRW failed, then the handle would not be saved
into an SDL_RWops (since that object was not created), but it would also
not be closed immediately.
`const auto &&` deduces a type that is always const, which breaks the
SDL-only build. Use cg3s_point explicitly, so that the type is const
for OpenGL and mutable for SDL-only.
Fixes: ec6a78c481 ("Use enum class for marker index types")