Commit graph

8839 commits

Author SHA1 Message Date
Chris Taylor 9d7b7dc160 Make hostage_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on.
2016-10-27 17:31:26 +08:00
Chris Taylor 06632e73e8 Make centers_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on.
2016-10-27 17:15:31 +08:00
Chris Taylor 66de1a1823 Make sure if a UI_DIALOG handler returns window_event_result::close or window_event_result::deleted, it will be passed onto window_send_event 2016-10-27 17:12:17 +08:00
Chris Taylor 787dbbbf72 Make window_send_event return window_event_result::deleted if window successfully closed
This will be used to inform the event system in future, in removing calls to window_exists. This applies to if the handler returns a window_event_result::close (which is and should be instead of the handler calling window_close itself, at least in most cases).
2016-10-27 16:51:21 +08:00
Chris Taylor 2d587de8dc Make call_default_handler return a window_event_result
Make call_default_handler return a window_event_result to inform the event system in future, particularly if a window was closed.
2016-10-27 16:36:24 +08:00
Chris Taylor 48e9061960 Make the listbox handlers return a window_event_result
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.
2016-10-27 15:22:41 +08:00
Chris Taylor 2613545712 Return window_event_result::deleted if Game_wind closed
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.
2016-10-27 12:24:02 +08:00
Kp 8b62870245 Fix clang build of udp_tracker_reqgames
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")
2016-10-26 01:58:05 +00:00
Kp c21e1e22e0 Refactor write_key_text
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")
2016-10-26 01:58:04 +00:00
Kp 791af89351 Use return type auto-deduction in socket call wrappers 2016-10-25 01:44:35 +00:00
Kp a3aa3da3d5 Switch socket_array_dispatch_t to match only array<uint8_t, N> 2016-10-25 01:44:35 +00:00
Kp 692dfffe58 Use array<> for net_udp_noloss_validate_mdata buf 2016-10-25 01:44:35 +00:00
Kp d7087cc59d Convert net_udp_send_pdata to array<> 2016-10-23 20:33:14 +00:00
Kp f14cbd1c00 Use minimal size buffer for net_udp_send_endlevel_packet guest buffer 2016-10-23 20:33:14 +00:00
Kp 4b539c0545 Use minimal size buffer for net_udp_send_endlevel_packet host buffer 2016-10-23 20:33:14 +00:00
Kp ffa53eb3c4 Page in textures before caching them
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")
2016-10-23 20:33:14 +00:00
Kp 49ff176e12 Protect RAIIsocket::s 2016-10-23 20:33:14 +00:00
Kp a0d614e6b0 Use clamp_symmetric_value in kconfig_read_controls
Avoid open-coding the test.
2016-10-21 02:16:48 +00:00
Kp a8a41aa2ff Move git version into Python class 2016-10-21 02:16:47 +00:00
Kp ddc16dac8b Use range_for in multi_check_for_killgoal_winner 2016-10-21 02:16:47 +00:00
Kp 5c872830a1 Remove unused message MULTI_KILL 2016-10-21 02:16:47 +00:00
Kp cca7fc7848 Revert high-score cool_saying size
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.")
2016-10-20 02:11:39 +00:00
Kp 8341c88300 Move move_towards_vector division into helper
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")
2016-10-20 02:11:39 +00:00
Kp d955eda96f Fix fullscreen checkbox handling
Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/224>
Fixes: 7128141c55 ("Use enum for newmenu item type")
2016-10-18 02:26:30 +00:00
Kp 27d0a79acd Factor out reporting errors caused by bad levels 2016-10-17 03:49:32 +00:00
Kp c006d068d8 Restructure PHYSFSX read helpers into template function 2016-10-17 03:49:31 +00:00
Kp 779738fa80 Add special handling for multi_do_reappear get_ghost_id
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.
2016-10-15 21:17:02 +00:00
Kp e4e74fe09c Pass vcsegptridx to pae_aux 2016-10-15 21:17:02 +00:00
Kp d6ccaf9dec Defer show_partial_environ until after adding -g,-O2 2016-10-15 17:51:48 +00:00
Kp 2d54a0c57d Fix infinite recursion when newmenu_scroll has only one valid item 2016-10-15 17:51:47 +00:00
Kp aae5279bfd Initialize Stuck_objects for D1 2016-10-15 00:53:22 +00:00
Kp f46b5a0210 Pass player_info to hud_show_cloak_invuln 2016-10-15 00:53:22 +00:00
Kp 2d4936b6ef Pass player_info to hud_show_keys 2016-10-15 00:53:22 +00:00
Kp bf11f9f63f Pass player_info to hud_get_primary_weapon_fontcolor 2016-10-15 00:53:21 +00:00
Kp 1a3939469b Pass player_info to hud_show_weapons 2016-10-15 00:53:21 +00:00
Kp 11754d6163 Pass player_info to hud_show_afterburner 2016-10-15 00:53:21 +00:00
Kp 3a52fe0952 Pass player_info to hud_show_energy 2016-10-15 00:53:21 +00:00
Kp 6a885069b0 Remove spurious resets of player::net_killed_total 2016-10-15 00:53:21 +00:00
Kp 5e8bcb853d Move window creation events out of window::window
Avoid running arbitrary creation handlers while a constructor is
in-progress.
2016-10-15 00:53:21 +00:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp d903a5db3b Pass powerup_flags to exists_fuelcen_in_mine 2016-10-15 00:53:20 +00:00
Kp a1b5d93740 Pass powerup_flags to escort_get_goal_segment 2016-10-15 00:53:20 +00:00
Kp e5cd034f74 Pass powerup_flags to exists_in_mine 2016-10-15 00:53:20 +00:00
Kp 03b0222896 Fold escort_set_goal_object calls to exists_in_mine 2016-10-15 00:53:20 +00:00
Kp ad35460eb0 Pass player_info to add_bonus_points_to_score 2016-10-15 00:53:20 +00:00
Kp 25f5fc231a Pass player_info to add_points_to_score 2016-10-15 00:53:19 +00:00
Kp 248dd5c309 Move player::hostages_rescued_total to player_info 2016-10-15 00:53:19 +00:00
Kp f21abc94cb Move player::hostages_on_board to player_info 2016-10-15 00:53:19 +00:00
Kp e721fc56da Move player::last_score to player_info 2016-10-15 00:53:19 +00:00
Kp ecb91955ae Move player::score to player_info 2016-10-15 00:53:19 +00:00