Commit graph

56 commits

Author SHA1 Message Date
Kp 2b8522f8ad Convert uses of vcsegptr_t to shared_segment& where possible 2020-08-24 01:31:28 +00:00
Kp 8e81726ac5 Use enum class for laser_level
Remove stored_laser_level, which existed primarily to enforce type
separate.  `enum class` can do that without the need for a separate
class type.
2020-08-24 01:31:28 +00:00
Kp 038c6aef4d Move d_level_unique_object_state to a separate header
This is required to untangle the cross-inclusion of object.h and
morph.h.
2020-08-10 03:45:14 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 714c13b3c1 Move WallAnims into d_game_shared_state 2020-04-04 19:30:22 +00:00
Kp c9b1b5b1ec Use susegment for WALL_IS_DOORWAY 2019-12-27 02:02:23 +00:00
Kp 5dfd62c4f6 Use susegment for references introduced by valptridx conversion 2019-12-22 05:34:08 +00:00
Kp 30091902af Simplify valptridx types where possible
Switch valptridx::ptr to a reference type.
Switch valptridx::ptridx to a reference type or to ::ptr.

Fix up uses of operator-> accordingly.
2019-12-22 05:34:08 +00:00
Kp 699030606e Move Effects to d_level_unique_effects_clip_state 2019-03-03 00:31:09 +00:00
Kp 1008ab397e Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
Kp 919580eaa9 Move RobotCenters to d_level_shared_robotcenter_state 2019-02-02 18:36:39 +00:00
Kp e84a65edc6 Move Robot_info into LevelSharedRobotInfoState 2018-12-30 00:43:59 +00:00
Kp 03fe3a6696 Move Polygon_models into LevelSharedPolygonModelState 2018-12-30 00:43:59 +00:00
Kp 9be3c8e2e8 Move Walls into d_level_unique_wall_state 2018-12-30 00:43:58 +00:00
Kp 045afc2c56 Prefer const shared_segment & over vcsegptr_t 2018-12-30 00:43:57 +00:00
Kp 706a704c6d Move unique_side to unique_segment 2018-12-13 02:31:38 +00:00
Kp a0ed5cb283 Pass Vclip as context 2018-10-21 00:24:07 +00:00
Kp 75d7eb6dce Skip paging in vclip entries with invalid num_frames
User Nemesis reported an unspecified crash, but never responded to
inquiries to provide more data.  Users Tourmeister and Buff Skeleton
reported a fatal exception thrown while paging in a vclip, with initial
triggering conditions matching the report from Nemesis.  Both
Tourmeister and Buff Skeleton are using v1.0 Descent 2 data.  No one
with more recent data has reported a problem.

Add a try { ... } catch { ... } block to trap the partial_range
exception, log it, and then ignore paging in that vclip.  This should
approximate what 0.58.1 did, assuming that the crash is due to a
negative `num_frames`.  If the crash is due to a large positive
`num_frames`, this change will still prevent the previously reported
crash, but may only move the crash elsewhere.  Various other subsystems
react badly to using a vclip that has not been paged in.

This change is tested not to break an otherwise working game.  It is not
tested to confirm that it produces a working game for users who
experienced a crash without it.

Reported-by: Tourmeister <https://forum.dxx-rebirth.com/showthread.php?tid=943&pid=12159#pid12159>
Reported-by: Buff Skeleton <https://forum.dxx-rebirth.com/showthread.php?tid=943&pid=12290#pid12290>
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/371>
2018-07-18 04:39:28 +00:00
Kp 30a83eec41 Eliminate some uses of valptridx::operator-> 2018-06-24 05:06:15 +00:00
Kp 0fd7e0e4ce Pass context arrays to WALL_IS_DOORWAY 2018-06-24 05:06:15 +00:00
Kp a3871cfefd Tighten eclip::dest_bm_num handling
Instead of testing for -1, test for any out-of-range value.
2018-03-31 21:53:01 +00:00
Kp aa56477742 Propagate objects_in arguments 2017-08-13 20:38:31 +00:00
Kp 20b8a6738c Use range_for in paging_touch_walls 2017-06-17 23:05:16 +00:00
Kp bca7823423 Use range_for+partial_range in paging_touch_model 2017-06-17 23:05:15 +00:00
Kp 4497812674 Use enum for object type 2016-11-20 23:12:00 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 553b313099 Use vwallptr 2016-02-12 04:02:28 +00:00
Kp 2fd6a425b0 Remove highest_valid 2016-02-12 04:02:28 +00:00
Kp b57f08c798 Use partial_const_range 2016-02-12 04:02:28 +00:00
Kp e8c34be843 Use v*ptr* factories with highest_valid 2015-12-22 04:18:51 +00:00
Kp b683b4cc68 Scope weapon type 2015-12-03 03:26:49 +00:00
Kp c0149be92a Use enum class explosion_vclip_stage for get_explosion_vclip 2015-11-15 22:30:41 +00:00
Kp 7034b68357 Manage world time automatically where possible
For all cases where world time nests, use automatic management.  Some
sites disable time in one function and enable it elsewhere.  These are
untouched.
2015-10-09 02:46:09 +00:00
Kp e976a823df Shorten paging_touch_robot_maker 2015-08-22 20:43:03 +00:00
Kp 0f4d38ea6d Shorten paging_touch_robot 2015-08-22 20:43:03 +00:00
Kp 6a50a904a3 Shorten paging_touch_weapon 2015-08-22 20:43:03 +00:00
Kp 9bf8b8212d Shorten paging_touch_model 2015-08-22 20:43:03 +00:00
Kp 6265431fd9 Pass & to paging_touch_vclip 2015-08-22 20:43:03 +00:00
Kp f98e884fdf Use valptr for paging highest_valid 2015-06-13 22:42:18 +00:00
Kp 6b6eaef226 Include polyobj.h from robot.h
Swap the inclusion order since all robots are polyobjects, but not all
polyobjects are robots.
2015-04-02 02:36:57 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp f2fb31a120 Merge 'D1 emulation issues' into unification/master
Requested by btb: https://github.com/dxx-rebirth/dxx-rebirth/pull/38
2015-02-20 03:00:46 +00:00
Kp dc8b88eed4 Convert various loops to range_for 2015-02-14 22:48:27 +00:00
Bradley Bell 28bd4c1650 Enable D1 boss behavior in d2x build.
So we get correct boss behavior when emulating D1, and 3rd party mn2s can include D1 bosses.
2015-02-08 12:26:36 -08:00
Kp 99a4a0ed62 Capture range_for by-value temporaries as const
Modifying a by-value temporary does not affect the underlying container,
so modifying it is almost always a bug.  Require use of a by-reference
capture when modification is desired.

sed -i -e 's/range_for\s*(\s*\(const\s\+\)\?auto\s\+\([[:alpha:]_]\)/range_for (const auto \2/g'
2015-02-05 03:03:49 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp 458f31f70a Propagate for variables in similar/main/paging.cpp 2014-09-26 02:42:10 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp 2246761818 Use object helper to iterate in paging_touch_segment 2014-08-03 03:17:34 +00:00