Make the listbox handlers and all sub-handlers (when_selected callbacks) return a window_event_result. Makes code more readable and removes one use of window_close, making it easier to inform event system if a window closes in future.
Return window_event_result::deleted if Game_wind was closed somewhere in response to an event handled by game_handler, so in future the event code can use that instead of window_exists to avoid tripping up.
gcc permits strlen("") in a constexpr context, but clang prohibits it.
Kreator reports that this broke the OS X build. Use sizeof(), which
produces approximately the same result and works in both compilers.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/251>
Fixes: 63ca86698e ("Added communication for tracker written by A Future Pilot")
Kreator reports that clang warns that `i` may be uninitialized in
write_key_text. This is a valid warning, but gcc does not generate it.
Refactor write_key_text to eliminate the warning and simplify the code.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/252>
Fixes: 20776fcfbc ("Use range_for/vcwallptr for write_key_text")
Some custom levels attempt to use texture overrides that reference
textures that are not yet paged in. It is not legal to access the data
of a paged-out texture, but ogl_loadbmtexture_f attempted to access it
anyway, causing a crash. Page in the texture before calling
ogl_loadbmtexture_f. Old versions of the engine would have cached
garbage data when this happened.
Reported-by: kreator <https://github.com/dxx-rebirth/dxx-rebirth/issues/228>
Fixes: 3c20c24ac0 ("Disable piggy_bitmap_page_out_all")
Mako88 reports that e335cdacb3 broke
reading historical high score files.
Code analysis shows that the size of the high score file must match the
size of struct all_scores, but this was not enforced anywhere. Commit
e335cdacb3 changed the size of struct
all_scores. Restore it to its previous size, and add a static_assert to
break the build if anyone tries to change it again.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/241>
Fixes: e335cdacb3 ("Reverted 81d7db279b and rather removed the terminator byte from string length in nm_set_item_input(). This also fixes possible 9 character length for pilot callsigns. Had to fix up COOL_SAYING_LEN as it was not considering the termintor but considering the original D2 source, this was a mess to begin with (def = 50, text string = 60, input field len = 45). Made score saying 50 characters as this seems to be the maximum witdth without overlapping.")
Mako88 reports that 2a19da88d4 changed
robot movement. That commit reordered the operations in a way that
tends to truncate small values prematurely. Restore the original order
of operations.
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/247>
Fixes: 2a19da88d4 ("Pass object_base &to move_towards_vector")
multi_do_reappear is overloaded to be used both on ghosts and on live
players. This causes a diagnostic because the *_id checks expect
exactly one type: either test for ghost or test for player, but not test
for and accept both. Open code the type check to support both.