Commit Graph

98 Commits

Author SHA1 Message Date
Jonathan 097b564cc6 remove bspbrush_t::original; it is no longer required since mapbrush_t is what the output is being written to
use some explicit types (bspbrush_t::ptr for pointer, bspbrush_t::container for container of pointers, and bspbrush_t::make_ptr to create one) so that we can swap it out with different pointers easier later
swap out bspbrush_t::ptr from unique_ptr to shared_ptr; it's not important yet, but it does not increase compilation time and will allow us to pass things to functions like SplitBrush without destroying the original as long as we still have a reference to it somewhere (important for ChopBrushes)
add get_positive_plane to mapface_t
instead of creating a whole copy of the bspbrush_t list, BrushBSP now just creates copies of the shared_ptrs which are then filtered down the tree; the originals are never modified by SplitBrushList and friends, only split into new brushes, so this is safe from what I can tell
portals now directly reference the mapface_ts
original_brushes now directly reference the mapbrush_ts
early exit in `BrushBSP` if brush list is empty (moved to top)
2022-08-10 16:02:16 -04:00
Jonathan bca6bda7c3 move `visible` to mapface_t since we only need to store one boolean for it 2022-08-10 01:29:34 -04:00
Jonathan c0cec4e1ba Rewrite of 697e3325f8 2022-08-10 00:11:17 -04:00
Eric Wasylishen 30b529b70f qbsp: keep a pool of node_t's in tree_t in a tbb::concurrent_vector
rather than using std::unique_ptr recursively in nodes
2022-08-08 23:43:36 -06:00
Jonathan 4ec30e02a2 remove "brushes" from mapentity_t - it is now local to the ProcessEntity process
"node_t::original_brushes" is now only used during construction and cleared on Prune; original_mapbrushes is used to track the map brushes on nodes post-construction
calculate and cache contents on mapbrush_t
2022-08-06 19:28:17 -04:00
Jonathan ec62a0e8d0 move in the rest of the missing code back into LoadBrush
fix bug with c_brushesremoved brushes
move & CreateBrushWindings use where required
store the source face we made a bspbrush_t side from
fix test issue
2022-08-03 12:35:47 -04:00
Jonathan 24168c8e40 clang pass 2022-08-02 21:57:33 -04:00
Jonathan a75f4239e3 node_t planenum 2022-08-02 16:04:48 -04:00
Jonathan 1d729ba573 side_t using planenums 2022-08-02 14:55:38 -04:00
Jonathan 26a18d5cc3 add logging::header/funcheader to easily and consistently print function or "active routine" headers
add OOP percent_clock wrapper to make printing percents easier, not used yet
2022-08-01 09:35:21 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan 9c73416594 Squashed commit of the following:
change temp-named planeside_ to plane_flipped

commit 8b3938f5069837e76504a16ffd019a8682fd4325
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 05:35:05 2022 -0400

    fix compile errors/warnings

commit 0c19a922490a332a084ceb65bbb88368fecb40a1
Merge: 31edc84e a2451a41
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 05:30:54 2022 -0400

    Merge branch 'brushbsp' into paril/brushbsp_plane2

    # Conflicts:
    #	qbsp/portals.cc
    #	qbsp/tree.cc

commit 31edc84e5a0f16196aacb4e465657954a523ccf9
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:55:52 2022 -0400

    use std::map for the two other hashes (edge/vertex) for speed

commit a9bb68b6ea203226d21f73d42558ffe388fc3051
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:31:45 2022 -0400

    remove final uses of FindPlane

commit 951a2b1977f813751c93417901a775a7a0cb77f4
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 02:01:19 2022 -0400

    only set flipped status if we actually flipped; this seems to have no affect in practice, but it was wrong in theory

commit 97610203bebb115391ef39ea2b5c6400b9ce2d89
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 01:56:19 2022 -0400

    remove FindPositivePlane

commit d424afbb2cfa32669883f5aafcf34555169eec3e
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 01:22:10 2022 -0400

    side_t uses plane and side_ now

commit af883bc111049a8c6fcb12c8c888e17f03cf30ff
Author: Jonathan <jonno.5000@gmail.com>
Date:   Wed Jul 27 00:46:52 2022 -0400

    face_t uses internal plane

commit 1cd776c89b683b0af0d8a642eee7e54b5f54b559
Author: Jonathan <jonno.5000@gmail.com>
Date:   Tue Jul 26 22:59:47 2022 -0400

    node_t using plane directly, pulling planenum in when necessary

commit 8b34312ef9c3d416c011f2694a34fb9d5eba4faa
Author: Jonathan <jonno.5000@gmail.com>
Date:   Tue Jul 26 22:22:28 2022 -0400

    remove PLANENUM_LEAF, use a boolean for the separation
2022-07-27 05:38:50 -04:00
Jonathan 4e3739c751 use a reader/writer-esque lock (shared_mutex) instead of exclusive-only recursive lock to speed up plane stuff 2022-07-24 19:05:28 -04:00
Eric Wasylishen f86a5343fb qbsp: rename options -> qbsp_options 2022-07-10 17:30:00 -06:00
Eric Wasylishen de68bee886 qbsp: move tree_t to tree.hh 2022-07-03 21:36:17 -06:00
Eric Wasylishen 40bba01b21 qbsp: brushbsp.cc import from qbsp3 2022-07-03 01:22:09 -06:00
Eric Wasylishen fac5ea384d qbsp: rename bspbrush_t.faces to .sides 2022-06-24 00:21:55 -06:00
Jonathan e422da15c3 simplify OutsideFill_Passable 2022-06-20 11:58:40 -04:00
Eric Wasylishen 8d5978dcc2 qbsp: switch to qbsp3 implementation for MakeTreePortals
Quick update to outside filling to remove cluster handling, because now we perform filling with
all leaf portals
2022-06-18 13:42:41 -06:00
Eric Wasylishen 3474dd00c5 qbsp: add portal_t::onnode, tree_t from qbsp3 2022-06-15 00:45:58 -06:00
Jonathan 78b979d670 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/light/entities.hh
#	qbsp/brush.cc
#	qbsp/map.cc
2022-06-14 17:19:30 -04:00
Jonathan d24ea4922a entdict cleanup 2022-06-14 17:18:13 -04:00
Jonathan 4e2e1c9bb3 default filltype to auto, which uses outside for hullnum > 0 and inside otherwise (lower leaf & node counts) 2022-06-13 06:19:58 -04:00
Jonathan d917c253c5 restore inside fill to working status 2022-06-13 02:20:34 -04:00
Jonathan 4755f23efa re-implement inside filling (not working fully yet) 2022-06-13 01:44:06 -04:00
Jonathan a94de7f8cc use closer to Q2 version of WindingIsTiny
allow .outside.map to be written for Q2 as well
2022-06-06 17:54:05 -04:00
Jonathan c5e864fca1 re-enable stuff
undo the shared lock stuff
2022-06-06 03:26:19 -04:00
Jonathan 8f50108b5e slight optimization for winding_t: use memcpy directly. the copy constructor can't automatically optimize it into a memcpy because of the iterator wrapper.
use side_t where appropriate
add a shared lock to map.planes, and hide the original vector to prevent non-locked read/writes
move MakeSkipTexinfo to the beginning of the operation - make a global skip texinfo as the first texinfo. it will get culled out later if need be.
re-enable ChooseMidPlaneFromList; seems to work, but maybe there's a test that is failing that is the reason it was if'd out?
enable parallelization of PartitionBrushes since map.planes is lockable now
2022-06-05 22:52:02 -04:00
Eric Wasylishen e3ee12e985 Merge branch 'type-cleanup' into brushbsp 2022-06-03 23:44:03 -06:00
Jonathan a9e9c14e0d warning for invalid face contents rather than a hard assert error
remove _wad warning for Quake II, Q2 doesn't use wads
areaportals are still fiddly, but this should help track down the errors - print entity # (bounds still not working)
2022-06-01 15:30:27 -04:00
Eric Wasylishen f9f355474c qbsp: fix broken FindOccupiedClusters_R 2022-05-21 16:32:36 -06:00
Eric Wasylishen 70706b4923 outside.cc: make FindOccupiedClusters safe to call more than once 2022-05-21 13:53:05 -06:00
Eric Wasylishen cf91610738 brushbsp: wip, restore using invisible sides as splitters
- fill again after second BSP so PruneNodes works
2022-05-21 00:57:16 -06:00
Eric Wasylishen a1b8a38283 merge non-brush bsp specific changes from brushbsp branch 2022-05-11 01:58:53 -06:00
Eric Wasylishen 893b0b080e qbsp: move to unique_ptr<brush_t> vectors 2022-05-03 02:35:43 -06:00
Eric Wasylishen 81e0da4d62 qbsp: mark invisible sides on brush entities
fixes brush_clipping_order test failure
2022-05-01 00:01:11 -06:00
Eric Wasylishen 8b93754b1f outside.cc: fixes for filling in detail in the void 2022-04-28 00:50:27 -06:00
Eric Wasylishen 8efb6f689b qbsp: add -outsidedebug flag 2022-04-27 19:18:27 -06:00
Eric Wasylishen f9aa40a50f qbsp: fix outside filling in maps with detail 2022-04-26 00:25:52 -06:00
Eric Wasylishen d372f0f0f4 qbsp: outside.cc: fix clearing occupied state on detail clusters 2022-04-23 15:07:20 -06:00
Eric Wasylishen 78210947ff qbsp: add -keepprt option 2022-04-19 01:03:18 -06:00
Eric Wasylishen 20a1b7b94b qbsp: szBSPName -> bsp_path, szMapName -> map_path 2022-04-17 13:41:23 -06:00
Eric Wasylishen 2c32177a69 qbsp: stop clobbering szBSPName 2022-04-17 13:36:19 -06:00
Eric Wasylishen 8a71b372bd qbsp: remove unnecessary num*() helpers from mapdata_t 2022-04-15 00:27:50 -06:00
Eric Wasylishen 9b9239fc38 outside.cc: add comment 2022-04-11 17:42:11 -06:00
Eric Wasylishen b7fbb48763 qbsp: enable new outside filling 2022-04-10 00:00:28 -06:00
Eric Wasylishen b736704e5e qbsp.hh: remove portals.hh include 2022-04-09 23:28:12 -06:00
Eric Wasylishen 2e14909e84 qbsp.hh: remove map.hh include 2022-04-09 23:23:26 -06:00
Eric Wasylishen 39d1930446 outside.cc: prototype marking visible brush sides 2022-04-09 21:46:01 -06:00
Eric Wasylishen edad06cc5a qbsp: planning outside filling approach, wip 2022-04-05 19:46:59 -06:00