Commit graph

116 commits

Author SHA1 Message Date
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 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 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 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 fd39a752dd Factor out cloaking wall utility loops 2016-11-12 18:10:10 +00:00
Kp 38fb4c9c9e Pass cloaking_wall &to do_{,de}cloaking_wall_frame 2016-11-12 18:10:10 +00:00
Kp e8f9f22635 Factor out do_{,de}cloaking_wall_frame common head/tail 2016-11-12 18:10:10 +00:00
Kp b4b0de8801 Cache uvl pointers in do_decloaking_wall_frame 2016-11-12 18:10:10 +00:00
Kp c4a20b019e Simplify test for cloak_value change 2016-11-12 18:10:09 +00:00
Kp be08b119e6 Prepare do_cloaking_wall_frame for future work
Move the wall reference member into a structure, so that future work can
initialize front/back data in a cleaner way.
2016-11-12 18:10:09 +00:00
Kp c54948f916 Eliminate some wback tests in cloaking wall code 2016-11-12 18:10:09 +00:00
Kp f208a8490f Move do_cloaking_wall_frame demo test up 2016-11-12 18:10:09 +00:00
Kp aae5279bfd Initialize Stuck_objects for D1 2016-10-15 00:53:22 +00:00
Kp 038a6e3261 Pass player powerup_flags to wall_hit_process 2016-10-02 00:34:46 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp e446965511 Remove unnecessary wall number check in kill_stuck_objects
Callers are expected to filter out invalid numbers.  Even if they do
not, the only use of the number is to match entries in Stuck_objects.
An invalid match could cause a call to vobjptr() with an invalid index,
but that would be diagnosed by the valptridx checking, so no invalid
memory access will occur.
2016-07-21 01:43:22 +00:00
Kp 278c10dec0 Move flush_fcd_cache calls up from kill_stuck_objects
Many callers of kill_stuck_objects call it twice, once for each of two
walls.  Move the flush_fcd_cache up to occur only once, rather than once
per wall.
2016-07-21 01:43:21 +00:00
Kp 82e6ab130b Remove kill_stuck_objects() in wall_illusion_off
Objects cannot become stuck in illusionary walls, so there is nothing to
kill.
2016-07-21 01:43:21 +00:00
Kp 24f59cc9d0 Add stub flush_fcd_cache for D1 2016-07-21 01:43:21 +00:00
Kp b1bdf4aa53 Unify D1/D2 remove_obsolete_stuck_objects
After fixing the bogus lifeleft assignment, the D2 version is equivalent
to a more thorough version of the D1 version.  Delete the D1 version and
use the D2 version for both games.
2016-07-21 01:43:21 +00:00
Kp 7d926f0741 Remove bogus remove_obsolete_stuck_objects lifeleft change
This assignment looks bogus.  If the signature saved when the object
became stuck is different from the signature of the object currently
using that slot, then remove_obsolete_stuck_objects kills the object
using that slot.  Signatures are defined to change when the object slot
is freed and reused.  Therefore, this statement kills the new object
that took the slot of the obsolete object.  This new object may be
important, such as a spawned robot or a weapon.
2016-07-21 01:43:21 +00:00
Kp f29630bd4a Propagate MAX_STUCK_OBJECTS 2016-07-21 01:43:21 +00:00
Kp a98e97505e Fix -Wshadow warnings in do_door_close 2016-05-21 17:24:50 +00:00
Kp 30230a8137 Pass object &to blast_nearby_glass 2016-04-23 17:59:47 +00:00
Kp a18a483114 Pass object &to bng_process_segment 2016-04-23 17:59:47 +00:00
Kp 5dae1e9080 Use range_for for kill_stuck_objects 2016-04-05 01:10:18 +00:00
Kp cc18ad2b68 Fix some -Wshadow warnings 2016-02-12 04:02:28 +00:00
Kp 553b313099 Use vwallptr 2016-02-12 04:02:28 +00:00
Kp 08248331a9 Unify do_door_close 2016-02-06 22:12:55 +00:00
Kp 0101f98905 Use wallnum_t in more places 2016-02-06 22:12:54 +00:00
Kp bb5d1bb7e5 Use valptridx array type for Walls 2016-02-06 22:12:54 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp 4770d3a35e Factor out wall_illusion_* common logic 2016-01-09 16:38:10 +00:00
Kp 5ba5910e7a Use symbolic side_none for testing find_connect_side result 2016-01-03 20:21:35 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 1adf34403e Compile out unused wclip_write
Unused since 547193c591 ("Compile out unused bm_write_all") disabled caller bm_write_all.
2015-12-04 03:36:31 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp b683b4cc68 Scope weapon type 2015-12-03 03:26:49 +00:00