Commit graph

9045 commits

Author SHA1 Message Date
Kp 6226e5fbbf Remove obsolete operator-(wall *, array<wall, N> &) 2016-11-26 22:51:49 +00:00
Kp 329ff67718 Raise D1 MAX_DOORS to match D2 2016-11-26 22:51:49 +00:00
Kp 66d946f5f7 Use std::find_if in wall_close_door to search ActiveDoors 2016-11-26 22:51:48 +00:00
Kp ecdefd93ad Use std::find_if in wall_open_door to search ActiveDoors 2016-11-26 22:51:48 +00:00
Kp ad806a8251 Reorder newmenu length test to skip key_ascii() call 2016-11-26 22:51:48 +00:00
Kp 46ffb9d3f8 Use remove_if to remove obsolete open doors 2016-11-26 22:51:48 +00:00
Kp ac5ccf0c08 Pass active_door &to wall_close_door_num 2016-11-26 22:51:48 +00:00
Kp 1acee2d4f4 Remove unused wall_close_door 2016-11-26 22:51:48 +00:00
Kp 5c62f63606 Factor out active_door removal 2016-11-26 22:51:47 +00:00
Kp be706e190e Move wall_close_door_num copy loop up
There are two callers for wall_close_door_num.  The editor calls it in a
loop for all doors, so copying each active_door is wasteful since none
will survive the end of the loop.  Move the copy loop into the caller
that removes elements selectively.

This makes no attempt to fix the bugs associated with changing
Num_open_doors while iterating with Num_open_doors as an upper bound.
2016-11-26 22:51:47 +00:00
Kp 16d2a3f866 Fix pch build
Move DXX_VERSION_SEQ from DXXProgram to DXXCommon to make it visible to
DXXArchive.configure_environment().  If pch is enabled, define
DXX_VERSION_SEQ in dxxsconf.h and remove it from the command line.  This
fixes a build failure where gcc ignored ownpch.cpp.gch because it was
built without DXX_VERSION_SEQ, but some files were built with
DXX_VERSION_SEQ.
2016-11-26 22:51:47 +00:00
Kp da50b79fb9 Fix syspch build 2016-11-26 22:51:47 +00:00
Kp 64ac7028e6 Pass active_door &to do_door_{open,close} 2016-11-26 22:51:47 +00:00
Kp 8bd9ec6360 Use range_for in do_door_close 2016-11-26 22:51:47 +00:00
Kp a129a0d570 Add ID for robot earthshaker secondary missile
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/273>
2016-11-26 22:51:47 +00:00
Kp bf662e0bcc Initialize track_goal for homing weapons
Kreator reported an uninitialized value crash when robots fired homing
weapons.  No path assigned a value for track_goal, so it had a default
value of 0 (non-poison builds) or 0xfdfd (poison builds).  Assign it a
value of object_none when the created weapon is a homing weapon.  Leave
it unassigned for non-homing weapons, since those should never examine
track_goal.

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/274>
2016-11-26 22:51:46 +00:00
Kp e56160a021 Print warning for unhandled weapon types 2016-11-26 22:51:46 +00:00
Kp 48ac006c59 Remove obsolete and broken DOOR_DEBUGGING code
This code has been #ifdef'd out since 2002, relied on implicit-int in
its declaration (deprecated in C, forbidden in C++), and has been broken
for years due to vms_vector changes.  Remove it.
2016-11-26 22:51:46 +00:00
Kp f4b7b958cb Revert "Fold escort_set_goal_object calls to exists_in_mine"
This reverts commit 03b0222896.

Commit 03b0222 caused the guidebot to skip over later key goals if an
earlier key goal was unnecessary.  This is incorrect.  Revert it.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/271>
2016-11-21 01:57:08 +00:00
Kp 8817307f23 Create duplicate powerups with movement MT_NONE
zicodxx reported an assertion failure when powerup duplication was
enabled.  Local debugging shows that some levels give preplaced powerups
a movement type of MT_NONE rather than MT_PHYSICS.  Such powerups have
undefined data in their mtype.phys_info branch, which confuses the
physics simulation code.  Powerups only need MT_PHYSICS to bounce away
from their spawn site.  Preplaced powerups never move.

Add assertions that preplaced powerups are MT_NONE.  Change the
duplication call to create the duplicates with movement MT_NONE.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/268>
2016-11-20 23:12:01 +00:00
Kp 0c219e596e Use enum for object movement type 2016-11-20 23:12:00 +00:00
Kp 4497812674 Use enum for object type 2016-11-20 23:12:00 +00:00
Kp e4afb78124 Fix undefined access to ai_info of non-robots
Only robots have ctype.ai_info.  Skip the sniper special case for
objects that are not robots.
2016-11-19 18:09:26 +00:00
Kp 118ba7698a Always initialize Omega_charge in init_player_stats_new_ship
Some gauges views show the current Omega_charge even when the player
does not have an Omega cannon.  Initialize Omega_charge to 0 if the
Omega cannon is not granted.
2016-11-19 18:09:26 +00:00
Kp a70d1ac646 Pass player_info &to omega_charge_frame 2016-11-19 18:09:26 +00:00
Kp 85338cba5e Fix memory corruption starting multiplayer game
Various points in the game code call `hide_menus()`, then later use
`show_menus()` to reverse the effect.  If the forcibly hidden window is
deleted before `show_menus()` is called, the attempt to show it would
write to freed memory.  Add a hook to forget those windows when they are
deleted, so that `show_menus()` does not try to make them visible later.
2016-11-19 18:09:26 +00:00
Kp dc881ec12d Merge pull #266 into master 2016-11-19 18:09:26 +00:00
Kp cb1410dd95 Use valptridx for CloakingWalls 2016-11-19 17:24:54 +00:00
Kp a9d82352b8 Use find_if to search CloakingWalls in start_wall_decloak 2016-11-19 17:24:54 +00:00
Kp 1cebed13e3 Use find_if to search CloakingWalls in start_wall_cloak 2016-11-19 17:24:54 +00:00
Kp ea837408d6 Use remove_if to remove obsolete cloaked walls 2016-11-19 17:24:54 +00:00
Kp 495bf624d2 Shorten collide_weapon_and_controlcen hitobj test 2016-11-19 17:24:54 +00:00
Kp a4edf4817c Cache properties_init bitmap width 2016-11-19 17:24:53 +00:00
Kp 1f929796c3 Fix excess fusion reflection 2016-11-19 17:24:53 +00:00
Kp 8c4d24ea6f Shorten collide_robot_and_weapon hitobj test 2016-11-19 17:24:53 +00:00
Kp e0d24f242b Fix uninitialized signature access
`obj_get_signature()` examines all objects with a type other than
`OBJ_NONE` to find an unused signature.
`load_game_data()`->`read_object()` set an object's type before calling
`obj_get_signature()`, so `obj_get_signature()` would consider the
uninitialized signature of the newly loaded object for exclusion.
Reorder the initialization to compute the signature before the object is
given a type, then store the signature on the object after the poison
bytes (if any) are written.
2016-11-19 17:24:53 +00:00
Kp 382d337118 Switch obj_get_signature to std::any_of
Also, split the predicate into separate statements to improve the output
of analysis tools.
2016-11-19 17:24:53 +00:00
Kp 223a9dfd56 Pass grs_bitmap &to piggy_register_bitmap 2016-11-19 17:24:53 +00:00
Kp 47de4e2906 Pass grs_bitmap &to swap_0_255 2016-11-19 17:24:52 +00:00
Kp 2dd4b574c7 Use virtual function to dispatch window events 2016-11-19 17:24:52 +00:00
Kp 7f9d54a241 Combine multi_endlevel_score player flags updates 2016-11-19 17:24:52 +00:00
Kp 61c11ec4d4 Use d_enumerate for SDL joystick loops 2016-11-19 17:24:52 +00:00
Kp 716b320c34 Use utility d_enumerate for do_cloak_stuff 2016-11-19 17:24:52 +00:00
Kp bb135e546e Set Descent 1 paged out bitmaps to nullptr
Descent 2 sets nullptr in the bitmap data field.  Do the same in Descent
1 for consistency.
2016-11-19 17:24:52 +00:00
Kp 53edbee901 Propagate constant texmerge_init argument 2016-11-19 17:24:52 +00:00
Kp 6db96d1a6d Fix file.cpp -Wunused-but-set-variable
Commit 1c8ad24 removed all reads of `wind`, but did not remove its
assignment or declaration.  This breaks the build with gcc due to
-Wunused-but-set-variable.

Fixes: 1c8ad24da3 ("Check for window_event_result::deleted for ui_get_filename polling loop")
2016-11-19 17:24:51 +00:00
Kp 98afafb80f Fix gadget.cpp -Wunused-but-set-variable
Commit 917f079 removed all reads of `wind`, but did not remove its
assignment or declaration.  This breaks the build with gcc due to
-Wunused-but-set-variable.

Fixes: 917f079f02 ("Check for window_event_result::deleted in ui_dialog_do_gadgets")
2016-11-19 17:24:51 +00:00
Kp b43dcc1a52 Revert "Disable piggy_bitmap_page_out_all"
This reverts commit 3c20c24ac0.

Rebirth no longer contains the Descent memory manager, but Rebirth still
has many traces of the paging support used in the DOS version.  One of
the unfortunate and subtle traces of this support is that it allocates a
contiguous buffer for game data and loads many of the games bitmaps into
that buffer.  The buffer is large enough for most workloads, but not
all.  When the buffer is too small, it is discarded by
piggy_bitmap_page_out_all and rebuilt piecemeal to contain only what it
needs.  Fixing this would be nice, but the memory ownership rules are
messy.  The performance consequences of the legacy approach are not
sufficient to justify the effort to fix this properly.  Instead, revert
to the legacy design.
2016-11-19 17:24:51 +00:00
Chris Taylor a06316f11e Fix crash when pressing Meta key (or Command key for Macs) in editor 2016-11-15 17:20:35 +08:00
Chris Taylor 6df1b85b87 Fix error due to -Werror -Wmissing-declarations in write_mission
This error was reported for gcc. Also set file extension correctly for 'enhanced' missions (though currently unused). Also some tidying up in response to feedback.
2016-11-15 15:03:34 +08:00