Commit graph

11822 commits

Author SHA1 Message Date
raptor 85a617386f Packaging changes:
- Split out builds in order to trigger them separately
- Anchor macdylibbundler to a specific revision
2022-08-10 09:25:08 -06:00
raptor 0e03692ec3 Packages for Windows, Linux, and macOS. Uses Github's Actions 2022-08-01 09:39:41 -06:00
Kreeblah 1c8ff1ac0f
Fix gl.h include location for macOS 2022-06-24 23:06:27 -07:00
Kp d1ed53ebd9 Initialize IPv4/IPv6 broadcast addresses statically
These were computed by passing hardcoded inputs to a lookup function.
Initialize the structure at compile time instead.
2022-06-19 23:35:18 +00:00
Kp d1968fce82 Move num_active_udp_changed into netgame_list_game_menu 2022-06-19 23:35:18 +00:00
Kp 27f18be3ca Move num_active_udp_games into netgame_list_game_menu 2022-06-19 23:35:18 +00:00
Kp a1bdd81d41 Exclude unused code from D2 non-editor build
gamedata_read_tbl is only called if (D1 || (D2 && EDITOR)).  Exclude
defining it for (D2 && !EDITOR).  From there, also exclude defining or
reading the alias list, which is only written by a function
called by gamedata_read_tbl.

Reported-by: heftig <https://github.com/dxx-rebirth/dxx-rebirth/issues/642>
2022-06-11 15:00:02 +00:00
Kp 2f78951b02 Change underlying_value to use a deleted function for the bad case
This produces a better error message than a static_assert failure, since
gcc points directly to the call which resolved to the deleted overload.
When the caller is correct, this produces the same result as the prior
version.
2022-06-11 15:00:02 +00:00
Kp 1f263e30ae Update minimum supported tool versions in INSTALL.markdown 2022-06-11 15:00:02 +00:00
Kp 522c696af0 Remove unnecessary members in splitpath_t
splitpath_t is designed for MS-DOS paths, even though Rebirth now runs
on many platforms that never used DOS conventions.  Most of the members
of splitpath_t are unused on all platforms.  Remove them, and switch to
returning an initialized version of the structure.
2022-06-11 15:00:02 +00:00
Arne de Bruijn 0a5ecd77c6 Fix exit briefing animation speed
Undo change in e973dc0 which set the change animation direction delay
for every frame.
2022-06-06 10:15:27 +02:00
Kp 5545b32fee Do not reset_rear_view if dead when crossing exit trigger
Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/637>
Fixes: 8faed77f5f ("Properly record the event of reset_rear_view() while switching levels to make it work right when rewinding as well; Properly record Countdown seconds for each newdemo frame instead of second change to get display showing up right while playback and still preserving backwards compability; Suspend Game_wind when playing endlevel movie while demo playback")
2022-06-05 17:44:53 +00:00
Kp 346906ae9f Simplify UPID_QUIT_JOINING
The host only needs to check the source address.  Remove the check on
the callsign, and shrink the message accordingly.
2022-06-05 17:44:53 +00:00
Kp 68453cd86f Remove redundant net_udp_welcome_player checks
This loop is run once before the `if()` test, then again at the top of
both the true and false branches of the `if`.  Remove the runs inside
the conditional, since they should produce the same result as the run
that occurs before the conditional.
2022-06-05 17:44:53 +00:00
Kp 9816475706 Pass Object array to object_goto_next_viewer 2022-06-05 17:44:53 +00:00
Kp e66da397a5 Add dummy 'file' key to executable entry in compilation database
clang rejects the entire database if any entry lacks a 'file' key,
regardless of whether the entry is used.

Fixes: bc6d043f5d ("Extend SConstruct compilation_database support to cover Program()")
2022-06-05 17:44:53 +00:00
Kp c5de47b51e Add const qualifiers to some net_udp functions 2022-06-05 17:44:53 +00:00
Kp 3d7cb4abc7 Remove force_dump_ai_objects_all
It rotted because it is only ever used when PARALLAX is defined.  No one
has reported it broken, so remove it.
2022-06-05 17:44:53 +00:00
Kp 0faa33d3df Harden bm_read_player_ship against invalid model numbers
Eliminate an unnecessary internal copy.  Terminate the search early if
an invalid model number is used.
2022-06-05 17:44:53 +00:00
Kp 504e950b75 Simplify bm_read_player_ship last_model_num handling
The existing handling always wrote to slot 0, but did so in a convoluted
way.  The variable names suggest this was not intended, but no one has
ever reported it as broken, and some otherwise valid data files may
depend on this quirk.
2022-06-05 17:44:53 +00:00
Kp 1b13274a5e Combine D1/D2 bm_read_player_ship call to load_polygon_model
D1 and D2 used logically equivalent code, but it was not the same text,
so the unification project split this with a `#ifdef`.  Since the code
does the same thing in both games, combine it into a non-guarded
statement.
2022-06-05 17:44:53 +00:00
Kp 5be32a05c6 Reorder check_line_to_line to eliminate useless copy
Instead of copying the input v1/v2 into det.uvec, pass a reference for
v1/v2 directly to calc_det_value.
2022-06-05 17:44:53 +00:00
Kp 9071675a0d Pass calc_det_value vectors separately
Pass 3 vectors rf/u instead of one vms_matrix.  This may make the code
slightly worse in the short term, but it makes a later change clearer.
2022-06-05 17:44:52 +00:00
Kp bfe7f2bb19 Reorder fvi_sub object type tests
Two tests in series examined the object for a type of OBJ_ROBOT.  Fold
the test together.

The next test also examines ->type.  Move that to an else since it
cannot be true if the first test was true.
2022-06-05 17:44:52 +00:00
Kp e180375f97 Pass GameBitmaps to draw_object_blob 2022-06-05 17:44:52 +00:00
Kp cc2f3caa7e Split piggy.h -> fwd-piggy.h 2022-06-05 17:44:52 +00:00
Kp 6228b07b45 Fix check_header_includes=1 build of fvi.h 2022-06-05 17:44:52 +00:00
Kp 6e2ed26659 Pass object to init_player_object 2022-06-05 17:44:52 +00:00
Kp 9f207daf95 Pass player object to reset_player_object 2022-06-05 17:44:52 +00:00
Kp 11a0aae9ee Pass GameBitmaps to piggy_bitmap_page_in 2022-06-05 17:44:52 +00:00
Kp f36a8e015e Disable collecting segment list in see_object
The segment list is written to `hit_data`, but `hit_data` goes out of
scope before the segment list is read back.  Skip collecting it, since
it was effectively write-only on this path.
2022-06-05 17:44:52 +00:00
Kp 33152640bc Remove fvi_info::hit_type
Its value is always readily available as the return value of
find_vector_intersection, so remove the structure member and rely on the
returned value.
2022-06-05 17:44:52 +00:00
Kp 8c4adbc262 Show repaircenters on automap 2022-06-05 17:44:52 +00:00
Kp 33923ab4ca Enable creating repaircenters in the editor
This is untested, but matches the logic used for
fuelcen_create_from_curseg.
2022-06-05 17:44:52 +00:00
Kp be7388a369 Enable repaircenter in D1
The code exists in D2, and the segment special is reserved for both
games.  Include the repaircenter code in D1, also.
2022-06-05 17:44:52 +00:00
Kp 885b0939d6 Defer charging for Omega cannon until blobs are created
If the creation of the Omega cannon blob fails, do not play the sound or
deplete the player's energy.
2022-06-05 17:44:52 +00:00
Kp 69d8dada1c Return next object from obj_detach_one
This allows obj_detach_all to avoid reloading the value from the parent
object each time.
2022-06-05 17:44:52 +00:00
Kp 6bd6a47612 Rework compress_segments to use segment iterators
This removes direct math on segnum_t, which will simplify later use of
`enum class segnum_t`.
2022-06-05 17:44:52 +00:00
Kp 86a32dd0ff Change enum sidenum_t to enum class sidenum_t 2022-06-05 17:44:52 +00:00
Kp 4fd412b2ea Precompute g3_draw_line GL color data 2022-06-05 17:44:52 +00:00
Kp e54338ce4e Combine canvas+color into g3_draw_line_context 2022-06-05 17:44:52 +00:00
Kp a44324abe1 Tighten net_udp player index check 2022-05-29 19:37:58 +00:00
Kp 0de494c2e0 Make thief explode when killed
Commit 1a9fba804d made an incorrect simplification.  It observed that
thief robots are not boss robots and vice versa, and from that changed:

```
	if (is_thief) { drop_stolen_items(); }
	if (is_boss) { start_boss_death_sequence(); }
	else if (death_roll) { start_robot_death_sequence(); }
	else { regular_death(); }
```

to

```
	if (is_thief) { drop_stolen_items(); }
	else if (is_boss) { start_boss_death_sequence(); }
	else if (death_roll) { start_robot_death_sequence(); }
	else { regular_death(); }
```

This was incorrect, because although a thief is not a boss, a thief does
need to proceed through the other non-boss if tests.  This error caused
a thief not to explode on death, and instead continue to fly around and
absorb weapon fire.

Fix the logic error by removing the incorrect `else`, so that a thief
can be tested for is_boss, get false, and then proceed through the
non-boss death logic.

Fixes: 1a9fba804d ("Avoid repeated valptridx dereferences in multibot.cpp")
2022-05-29 18:44:59 +00:00
Kp 092daecb61 Use static_cast<> to convert player_marker_num to game_marker_index
gcc-12 rejects the list initialization syntax.  Switch to static_cast<>,
which generates equivalent code.

Reported-by: dbermond <https://github.com/dxx-rebirth/dxx-rebirth/issues/638>
2022-05-28 21:04:37 +00:00
Kp 12cca97870 Remove unused piggy_new_pigfile local char tempname[20]
gcc-12 warns that the snprintf to initialize `tempname` may be
truncated.  The variable is never used after it is initialized, so
delete the initialization and declaration.
2022-05-28 21:04:37 +00:00
Kp a8e7f6ad59 Use enum class for find_vector_intersection result 2022-05-24 02:32:58 +00:00
Kp d8ab3c9bd3 Remove quadint members low, high
Always access the data through the member `q`.  This makes the code
independent of architecture endian decisions.
2022-05-24 02:32:58 +00:00
Kp e154d37e5e Tighten valptridx::ptridx range checking for pointer_type constructor
Previously, the supplied pointer was converted to an array index, then
passed to valptridx::idx for validation.  If the index_type is smaller
than std::size_t, this would truncate the value before validation.
Certain out-of-range indexes would be in-range after truncation, and
incorrectly not be reported.

Reorder the check to validate the index against the array size before
truncation.
2022-05-24 02:32:58 +00:00
Kp 67705bdd7a Return checkmuldiv result in std::optional 2022-05-24 02:32:58 +00:00
Kp 1f5d72e747 Use native 64-bit math in checkmuldiv 2022-05-24 02:32:58 +00:00