Commit graph

10273 commits

Author SHA1 Message Date
Kp 9898d136f1 Fix fortification crash loading missions with long filenames
The highest-level tracking code assumed filenames would always fit in a
char[9].  This was true on DOS, but has not been true in Rebirth for
many years.  Builds without fortification caused silent memory
corruption in this case.

Refuse to create highest-level entries if they would cause corruption.
Log a diagnostic telling the user that this happened.
2019-03-09 23:39:16 +00:00
Kp 42a2e3ab0b Avoid crash loading polymodels with invalid subcalls
Truncate the model at the first error.  This allows the level to load,
but makes some or all of the model invisible.
2019-03-06 05:03:48 +00:00
Kp 8f2bec3fde Remove bogus assertion in wall_hit_process
Fixes: 8764cad457 ("Use `unsigned` in more prototypes")
2019-03-06 05:03:48 +00:00
Kp 106de25617 Cache visited_segment_bitarray_t reference in apply_light_to_segment 2019-03-03 00:31:09 +00:00
Kp c992155ff1 Remove useless texture writeback in validate_segment_side 2019-03-03 00:31:09 +00:00
Kp 8764cad457 Use unsigned in more prototypes 2019-03-03 00:31:09 +00:00
Kp 3edef3c64b Move robot_create out of line
It is not used enough to justify its presence in a header.
2019-03-03 00:31:09 +00:00
Kp 699030606e Move Effects to d_level_unique_effects_clip_state 2019-03-03 00:31:09 +00:00
Kp 5dc630b58f Move Last_buddy_message_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 5da35845d9 Move Buddy_last_player_path_created to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 5b503c22a6 Move Escort_last_path_created to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp bc62ae694b Move Last_come_back_message_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 7e61451792 Move Last_time_buddy_gave_hint to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp 7577a3e408 Move Escort_special_goal to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp d46fd99425 Move Buddy_last_missile_time to d_unique_buddy_state 2019-03-03 00:31:09 +00:00
Kp b1e19ac667 Move Buddy_last_seen_player to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp bd1cce0cc3 Move Buddy_sorry_time to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp ee584f1f37 Move Last_buddy_polish_path_tick to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 9e3c5ec272 Move Last_buddy_key to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp b34e7bae24 Move Buddy_gave_hint_count to d_unique_buddy_state
Fix original bug that buddy was limited to 5 hints per program run, not
5 per boss as it probably should have been.

Due to savegame format limitations, this still is not right.  Reloading
the game should restore Buddy_gave_hint_count to its value at save time,
but will not.
2019-03-03 00:31:08 +00:00
Kp 58d59da9d2 Move Escort_goal_object to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 926afe73d5 Move Looking_for_marker to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp ace3313dc3 Move Buddy_messages_suppressed to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp c3cead4319 Move Escort_goal_index to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp c02bee26d6 Move Buddy_allowed_to_talk to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 420464549b Move Buddy_objnum to d_unique_buddy_state 2019-03-03 00:31:08 +00:00
Kp 1008ab397e Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
Kp a36eb1d52c Only use update_laser_weapon_info for quad laser change
Regular laser level changes are already tracked and handled separately.
2019-03-03 00:31:08 +00:00
Kp 5d99ec361d Simplify copy_defaults_to_robot
Write the shields once at the end.
2019-03-03 00:31:07 +00:00
Kp ca1ed8602f Add test for gcc bug #82541 2019-02-11 01:53:44 +00:00
Kp fec16daca4 Generate unique starfield per level 2019-02-02 18:36:39 +00:00
Kp 7bcbaae230 Tighten protection against grs_bitmap bm_data confusion
Bitmaps based on grs_main_bitmap own their data.  Bitmaps based on
grs_bitmap do not.  Adjust prototypes to prevent initializing a
grs_main_bitmap with data it will not own.
2019-02-02 18:36:39 +00:00
Kp ba442b99bd Fix potential memory leak in grs_main_bitmap move-assignment 2019-02-02 18:36:39 +00:00
Kp 8dcf4f99e0 Suppress cooperative start report if not multiplayer coop
The value is only correct when the game is cooperative multiplayer.
Hide it when it would be incorrect.
2019-02-02 18:36:39 +00:00
Kp 47a6f744d8 Factor out vms_quaternion_from_matrix division 2019-02-02 18:36:39 +00:00
Kp 92fdacfb60 Simplify do_cheat_menu
Reduce redundant player object lookups.
2019-02-02 18:36:39 +00:00
Kp ad6b857cf2 Move most laser_info fields to dcx 2019-02-02 18:36:39 +00:00
Kp 4e1bbc0759 Improve Windows exception strings 2019-02-02 18:36:39 +00:00
Kp 1037b2c296 Flip sense of boss_intersects_wall
This saves a boolean negation passing the result up.
2019-02-02 18:36:39 +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 d7e85e0cff Move Boss_gate_segs, Boss_teleport_segs to d_level_shared_boss_state 2019-02-02 18:36:39 +00:00
Kp 05244122bd Tighten input for set_segment_depths 2019-02-02 18:36:39 +00:00
Kp 20ecff4e4b Coerce RELEASE CT_SLEW to CT_NONE
Release builds should never have an object in CT_SLEW state.  If they
do, they abort the program.  This is an extreme reaction.  Change the
logic to report the problem, then coerce the type to CT_NONE and try to
resume operation.
2019-02-02 18:36:39 +00:00
Kp 84fa2cde4a Move Num_fuelcenters to d_level_unique_fuelcenter_state 2019-02-02 18:36:39 +00:00
Kp 943e0a8b5f Move Station to d_level_unique_fuelcenter_state 2019-02-02 18:36:39 +00:00
Kp 919580eaa9 Move RobotCenters to d_level_shared_robotcenter_state 2019-02-02 18:36:39 +00:00
Kp 7558795edd Fix sharepath confusion when building both targets
Processing sharepath in SConf is incorrect, because targets can share a
build directory (and therefore an SConf run), but not share a sharepath.
Move sharepath handling out of SConf.  Move DXX_USE_SHAREPATH handling
from CGameArg to GameArg, since one game can be built with a sharepath
while the other is built without.
2019-01-20 05:36:56 +00:00
Kp 0b319e2736 Print an error to the console when saving a game fails 2019-01-20 05:36:55 +00:00
Kp 5d12f62d77 Omit p3_{u,v,l} from OpenGL builds
These are write-only for OpenGL.  All reads are in SDL-only code.
Remove them to save 3 ints of space in every g3s_point.
2019-01-01 04:54:35 +00:00