Commit graph

8839 commits

Author SHA1 Message Date
Kp 65de22e4be Replace Int3 with con_printf(CON_URGENT) when loading bogus trigger 2016-10-08 23:24:22 +00:00
Kp af09257e2d Blank out most of object_rw when saving OBJ_NONE objects 2016-10-08 23:24:21 +00:00
Kp 5114b8f8b6 Fix object corruption loading save game
Saved games dump robot ai_local state for all objects, regardless of
whether the object is a robot.  Loading a game restored all ai_local
values, regardless of whether the object was a robot on restore.  This
caused memory corruption in objects that were not robots when the
`ctype.`_T_ for that object was large enough to overlap
`ctype.ai_info.ail`.

Fix this by loading the ai_local into a junk buffer when the object is
not a robot.  It would be better to skip over the bogus ai_local
entirely, but the structure of ai_local_read_swap makes that difficult.
Use the easy fix for now.
2016-10-08 23:24:21 +00:00
Kp b195b3077b Switch DXX_HAVE_POISON_VALGRIND to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 0ad0a57fea Switch DXX_HAVE_POISON_OVERWRITE to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 03dbc96103 Switch DXX_HAVE_POISON to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp 1d09ca32ad Remove spurious 'u' after DXX_PRI_size_type uses 2016-10-08 18:02:34 +00:00
Kp d6f48dbd91 Prevent crash when level specifies invalid wall number
Kreator reports that "Pyramids of Luxoran" crashes due to a valptridx
sanity check.  The level incorrectly attempts to open a wall on a
segment/side which has no wall.

Add an error check and a con_printf suggesting that the level author
needs to fix the invalid trigger.
2016-10-08 18:02:34 +00:00
Kp 15a405cd4c Pass vcsegidx_t to exists*_in_mine 2016-10-08 03:34:17 +00:00
Kp e36939a30c Pass vcsegidx_t to create_bfs_list 2016-10-08 03:34:17 +00:00
Kp 31d2b5cfb2 Use correct get_*_id function for collide_robot_and_weapon 2016-10-07 02:08:56 +00:00
Kp 635b3f54e3 Downgrade matcen diagnostic from exception to con_printf(CON_URGENT)
Kreator reports that a level from back when Descent was new fails the
test for bogus matcen triggers.  This level cannot be played when that
test throws an exception, so downgrade the exception to a CON_URGENT
message.  This will hopefully deter level authors from creating any new
levels with this problem, but will allow users to play existing levels.
2016-10-06 02:08:07 +00:00
Kp ba2b8c05ba Fix crash on object_guidebot_cannot_reach
escort_get_goal_segment expected exists_in_mine to return object_none or
a valid object.  In some mines, exists_in_mine will return
object_guidebot_cannot_reach, which is neither object_none nor a valid
object.  Exclude reading the segment of the unreachable object.
2016-10-05 03:55:19 +00:00
Chris Taylor 9631d319f6 Allow dcx::UI_DIALOG struct to be subclassed - step 3
Allow dcx::UI_DIALOG struct to be subclassed step 3. This step adds the destructor and makes sure the dialog is only deleted within the main dialog handler if the specific handler didn't return window_event_result::deleted.
2016-10-04 16:09:21 +08:00
Chris Taylor db665d8c33 Allow dcx::UI_DIALOG struct to be subclassed - step 2
Allow dcx::UI_DIALOG struct to be subclassed step 2. Make all the UI_DIALOG handlers return a window_event_result like everyone else.
2016-10-04 15:58:20 +08:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
Chris Taylor 4d9eb4e743 Allow dcx::UI_DIALOG struct to be subclassed - step 1
Allow dcx::UI_DIALOG struct to be subclassed step 1. This step renames and reconfigures untyped_ui_dialog_create in dialog.cpp to be the main constructor. Also adds a template constructor that allows an event handler that takes a subclass of UI_DIALOG.
2016-10-04 11:29:19 +08:00
Chris Taylor d4b85de49b Remove redundant checks for nullptr before deleting dcx::window instances in response to feedback. 2016-10-03 11:21:11 +08:00
Chris Taylor ca35a8091f Declare dcx::window with class keyword to clarify its intended use.
Also removes the need for the private keyword in the definition.
2016-10-03 11:15:22 +08:00
Chris Taylor 708cd027f0 Use member initialisation list for dcx::window constructor in response to feedback. 2016-10-03 11:10:11 +08:00
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00
Kp f386c79389 Add preprocessor hook for selective dsx migration 2016-10-02 19:35:35 +00:00
Kp ec19a6947f Move more symbols to namespace dsx 2016-10-02 19:35:34 +00:00
Kp 53bec35f34 Use range_for for player_ship_read 2016-10-02 19:35:34 +00:00
Kp 261d19332b Remove unnecessary __pack__ on D1 player_ship
The size is the same with and without the __pack__.
2016-10-02 19:35:34 +00:00
Kp 3024bb8bbe Pass object_base &to create_player_appearance_effect 2016-10-02 19:35:34 +00:00
Kp a468e2612b Factor out gr_set_attributes SDL_GL_SetAttribute calls 2016-10-02 19:35:34 +00:00
Kp 0abb7278da Move FPSIndicator to CCfg 2016-10-02 19:35:33 +00:00
Kp 797554f80a Move Multisample to CCfg 2016-10-02 19:35:33 +00:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Chris Taylor f117df9eee Allow dcx::window struct to be subclassed - step 2
Allow dcx::window struct to be subclassed step 2. This step renames and reconfigures window_create in window.cpp to be the main constructor. Also add a template constructor that allows an event handler that takes a subclass of window.
2016-10-02 14:49:22 +08:00
Chris Taylor 15e9f4a383 Allow dcx::window struct to be subclassed - step 1
Allow dcx::window struct to be subclassed step 1. This step moves the definition for the window struct into window.h, keeping all member variables private and declaring the window related functions as 'friends'. This avoids changes to source files that use the window struct at this stage. Also moving some of the simpler functions in window.cpp into the struct definition to inline them. I would prefer to use class methods, so changing some of these to class methods as well.
2016-10-02 14:32:30 +08:00
Kp da4f55f47e Show some environment values before/after sconf runs 2016-10-02 00:34:50 +00:00
Kp 968746c0e8 Pass secondary_weapon_index_t to player_has_secondary_weapon 2016-10-02 00:34:49 +00:00
Kp 603159ec4b Pass secondary_weapon_index_t to do_secondary_weapon_select 2016-10-02 00:34:49 +00:00
Kp b8f58309f0 Reuse computed filename for screenshot 2016-10-02 00:34:49 +00:00
Kp 2289ed473d Unify computing write_bmp output size requirement 2016-10-02 00:34:49 +00:00
Kp b2f744f1f8 Remove unnecessary diminish_palette in pcx_write_bitmap
The variable is never read after that diminish_palette call, whether in
pcx_write_bitmap or in its sole caller.
2016-10-02 00:34:49 +00:00
Kp e11ac102a6 Cache bitmap properties in pcx_write_bitmap 2016-10-02 00:34:49 +00:00
Kp 815a26f32d Expand and cache various uses of get_local_plrobj() 2016-10-02 00:34:48 +00:00
Kp 6c7e64d871 Fold ai_do_actual_firing_stuff calls to ready_to_fire_weapon1 2016-10-02 00:34:48 +00:00
Kp 95988a343c Pass player object to recompute_automap_segment_visibility 2016-10-02 00:34:48 +00:00
Kp 0d5d191671 Pass player object to DropMarker 2016-10-02 00:34:48 +00:00
Kp 67e10d532b Pass player powerup_flags to init_ai_frame 2016-10-02 00:34:48 +00:00
Kp 13f751364d Pass player powerup_flags to make_nearby_robot_snipe 2016-10-02 00:34:48 +00:00
Kp dc7c718b66 Pass player powerup_flags to create_bfs_list 2016-10-02 00:34:47 +00:00
Kp 1dcacefc9c Pass player object to check_trigger 2016-10-02 00:34:47 +00:00
Kp 171e303adb Pass player object to check_trigger_sub 2016-10-02 00:34:47 +00:00
Kp 84e596e1b4 Pass player_info to player_has_powerup 2016-10-02 00:34:47 +00:00
Kp 69b84e418d Pass player_info to pick_up_energy 2016-10-02 00:34:47 +00:00