Commit graph

148 commits

Author SHA1 Message Date
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp 37132ab887 Pass LevelSharedRobotInfoState in fvi_query 2022-07-09 13:39:29 +00:00
Kp 0dfd462c64 Change fvi_query to pass LevelUniqueObjectState if checking objects
Remove the definition of FQ_CHECK_OBJS and all uses of it.  Add a new
fvi_query member d_level_unique_object_state *LevelUniqueObjectState.
If object checking is enabled, pass &LevelUniqueObjectState in that
member.  If object checking is disabled, pass nullptr in that member.

Change fvi_sub to use this member to decide whether to perform object
checking.
2022-07-09 13:39:29 +00:00
Kp 4ab619b7c2 Restructure use of fvi_query
- Make all members constant, and pass an anonymous temporary fvi_query
  to find_vector_intersection.
- Change `p0`/`p1` to `const vms_vector &`, since the positions are
  mandatory.  Callers can no longer pass `nullptr` or an uninitialized
  value here.
- Change `thisobjnum` to `icobjptridx_t`.  Calls to fvi_sub built an
  objptridx at need, so moving it to the caller allows it to be
  constructed once per find_vector_intersection call.
- Move `flags` and `rad` out of fvi_query, since calls to fvi_sub may
  use other values than the ones in fvi_query.  This prepares for
  passing fvi_query to fvi_sub.
2022-07-09 13:39:29 +00:00
Kp a8e7f6ad59 Use enum class for find_vector_intersection result 2022-05-24 02:32:58 +00:00
Kp 2fe9a16613 Use dedicated type for mask of segment side numbers 2022-02-19 14:52:17 +00:00
Kp fbe3bbd0fa Use enum sidenum_t in more places 2022-01-09 15:25:42 +00:00
Kp 2fbddf7a5a Use enum class for tmapinfo_flags 2021-11-01 03:37:20 +00:00
Kp 0044c010ad Use structured bindings for create_abs_vertex_lists 2021-11-01 03:37:20 +00:00
Kp 49dee72766 Preserve type of vm_vec_mag return value
Defer converting to `fix` until necessary.
2021-09-19 10:53:48 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +00:00
Kp 47c33cbd55 Use enum class for WALL_IS_DOORWAY_FLAG
This reduces the size of the debug information substantially.
2020-12-19 16:13:26 +00:00
Kp 61f186bc18 Use enum class for texture1_value 2020-09-11 03:08:02 +00:00
Kp de4efc4f46 Qualify more uses of shared_segment members 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 7ad8d8c28b Rename object::movement_type to movement_source
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member.  Avoid the disagreement by renaming the
member.
2020-08-10 03:45:13 +00:00
Kp 5245b1c4a3 Rename object::control_type to control_source
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member.  Avoid the disagreement by renaming the
member.

Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/532>
2020-08-10 03:45:13 +00:00
Kp 38cddb0289 Use enum class for object movement_type 2020-08-10 03:45:13 +00:00
Kp 9e2543ecbf Use enum class for object control_type 2020-08-06 03:47:56 +00:00
Kp a4f2edfaa9 Move LevelSharedVertexState into d_level_shared_segment_state 2020-05-17 23:35:25 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +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 c93e7f44c3 Move object::last_pos to LevelUniqueObjectState
Only the console player's last position needs to be remembered across
frames.  Copy the console player's position out before processsing
object movement.  For all other objects, retain a temporary for use by
the position recovery code.
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 8997f622bd is_proximity_bomb_or_smart_mine*: s/smart/player_smart/g
As documented in zico's commit 38fabd7c49, robot smart mines have a
different ID number than player smart mines.  Rename the test functions
to clarify that they only recognize player smart mines, but not robot
smart mines.

git grep -l is_proximity_bomb_or_smart_mine | xargs sed -i -e 's/is_proximity_bomb_or_smart_mine/is_proximity_bomb_or_player_smart_mine/g'
2019-08-15 01:34:22 +00:00
Kp 04b50757c5 Explicitly test for nullptr in do_physics_align_object
clang-check warns about a potential binding a reference to nullptr in
the case that a segment has 0 sides.  While this is silly and
impossible, a related failure mode would occur if vm_vec_dot never
indicated a side as good.  This should be impossible, but the test for
nullptr is cheap, so add it to silence the checker.
2019-08-06 02:59:41 +00:00
Kp 1008ab397e Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
Kp 12403a78f7 Pass vcvertptr to sphere_intersects_wall 2019-02-02 18:36:39 +00:00
Kp ffb5e8821c Flatten use of sphere_intersects_wall 2019-02-02 18:36:39 +00:00
Kp e864542862 Work around broken clang -Wuninitialized warning
clang warns for using an uninitialized array during the
member-initialization-list, before the union constructor would have done
nothing.  clang permits using the still-uninitialized array in the
constructor body, after the union constructor has done nothing.
The same code is generated both before and after this commit, but the
old code produces a warning and the new code is silent.

```
similar/main/physics.cpp:282:5: error: field 'a' is uninitialized when used here [-Werror,-Wuninitialized]
        e(a.begin())
```
2019-01-01 04:54:35 +00:00
Kp 1f18db3c39 Move TmapInfo to d_level_unique_tmap_info_state 2018-12-30 00:43:59 +00:00
Kp e84a65edc6 Move Robot_info into LevelSharedRobotInfoState 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 46644b4e91 Move Dl_indices into d_level_shared_destructible_light_state 2018-12-30 00:43:58 +00:00
Kp 1a5844e218 Move Vertices out of global scope 2018-12-30 00:43:57 +00:00
Kp 2f537133e8 Use vcobjidx_t for fvi ignore_obj_list
Enforce that callers provide vcobjidx_t, instead of permitting any type
compatible with objnum_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 e9c9943470 Pass context to update_object_seg 2018-10-08 03:58:48 +00:00
Kp f7ad4d9b1a Pass segments to find_point_seg 2018-09-19 02:13:30 +00:00
Kp 8bbdeedeb2 Consolidate stuck object state
Move it to a structure.  Make all the modifiers methods.  Change all
callers of those methods to pass the structure.  This makes the stuck
object handling free of direct access to global game data.
2018-08-04 17:52:57 +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 fb68e7f9ec Eliminate use of side * 2018-06-24 05:06:15 +00:00
Kp 6d0d68d188 Split some segment uses based on shared vs unique
Leave `sides` in `shared_segment` to minimize churn.  Parts of it must
move to `unique_segment` before this project finishes.
2018-06-24 05:06:14 +00:00
Kp 53a1d5f9ce Pass vertex factory to compute_segment_center 2018-03-12 03:43:47 +00:00
Kp ad8fd0f871 Pass valptridx factories to obj_relink 2018-03-12 03:43:46 +00:00
Kp b4899aafac Pass vcvertptr to get_seg_masks 2017-08-11 23:43:54 +00:00
Kp 5eec2a5ce5 Use valptridx for Vertices 2017-08-11 23:43:54 +00:00