Commit Graph

171 Commits

Author SHA1 Message Date
Jonathan 0f844ad3e2 don't output debug stuff if we don't need it 2024-05-29 07:12:56 -04:00
Eric Wasylishen 275695a37c qbsp: remove -transsky flag which was broken
unknown what it was useful for
2024-03-09 22:07:55 -07:00
Eric Wasylishen aa3b8479b4 qbsp: shrink node_t from 280 to 208 bytes
- contentflags_t from 80 to 8 bytes
2024-03-09 19:37:23 -07:00
Eric Wasylishen ee075b5781 qbsp: shrink node_t from 328 to 280 bytes 2024-02-27 23:34:47 -07:00
Eric Wasylishen 1c692d6f47 qbsp: record portal type 2024-01-05 12:32:01 -07:00
Eric Wasylishen 6351cc50e6 rename: vec_t -> double 2023-12-23 21:09:16 -07:00
Jonathan ec452e2291 remove implicit conversion for qplane3 2023-11-19 19:41:58 -05:00
Jonathan 9d7f83a46a don't remove style keys from non-areaportals if the map leaks 2023-08-21 10:54:10 -04:00
Eric Wasylishen 9760f5b8da qbsp: fix detection of areaportal leaks (FindAreaPortalExits_R was aborting the search for "exits" early) 2023-07-06 22:37:28 -06:00
Eric Wasylishen fbea58d679 code formatting pass 2023-06-25 18:29:48 -06:00
Jonathan 06d48e6822 fix areaportal issue 2023-06-14 02:50:23 -04:00
Jonathan d36e2f5114 --scale option for BSPUtil to do a post-process scale 2023-06-12 15:23:47 -04:00
Jonathan 1548f25daf allow individual brush chop control
allow passing _surflight_targetname to set targetnames for switchable lights on bmodels
2023-05-08 17:44:32 -04:00
Eric Wasylishen 8830a949e6 qbsp: only print "doesn't touch two areas" once per entity
log source location as well
2023-03-27 20:15:19 -06:00
Eric Wasylishen 2a2bc5d966 qbsp: clean up debug spam from DebugAreaPortalBothSidesLeak 2023-03-27 20:09:01 -06:00
Eric Wasylishen 4569ab1b33 qbsp: delete leftover areaportal leak files on startup 2023-03-27 20:05:33 -06:00
Eric Wasylishen d7db2bdae5 qbsp: debug helper for finding areaportal leaks 2023-03-27 01:20:53 -06:00
Eric Wasylishen 759811b548 qbsp: fix Portal_EntityFlood check 2023-03-26 18:04:06 -06:00
Eric Wasylishen 3c408f5d30 qbsp: better debug visualization for "missing portal sides" warning
writes a .missing_portal_sides.prt file for inspection in TB
2023-03-26 14:09:54 -06:00
Eric Wasylishen 06f2363902 qbsp: work around 45 degree plane issue in FindPortalSide 2023-03-01 21:09:15 -07:00
Eric Wasylishen eda6155844 cleanup: run ./clang-format-all.sh
clang-format version 15.0.7
2023-02-18 22:59:43 -07:00
Jonathan dd75cdf3e3 don't bother with area portal flooding if we are leaked 2023-02-13 20:18:09 -05:00
Eric Wasylishen 959fe32e18 portals.cc: add -verbose logging for missing portal sides 2022-11-14 21:49:01 -07:00
Eric Wasylishen 2bd2515792 all: cleanup unused includes (Clion - detect not directly used) 2022-10-31 21:37:34 -06:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Eric Wasylishen 68e2f97fbf qbsp: sync FindAreas to Quake-2-Tools version
fixes area portals in cases when area has no point entities in it
2022-09-10 15:49:17 -06:00
Eric Wasylishen b19527c3fd qbsp: don't use brush sides to texture a portal if they're not coplanar 2022-09-08 21:20:49 -06:00
Jonathan d4dde8350c always mark leaked maps' nodes/leaves areas 2022-09-06 14:44:44 -04:00
Jonathan b305ddaed9 port over the visible = true setting for hint sides 2022-08-25 21:45:33 -04:00
Jonathan 1ce5c5a7b1 combine flood + emit areaportals into a single step, since they won't ever be run not together
add stats for edges and faces
2022-08-24 12:02:56 -04:00
Jonathan 282c5ec69f stat printing adjustments 2022-08-21 15:01:45 -04:00
Jonathan 84870cf366 since tree_t only exists as a type that only allocates heap memory, we don't need to wrap it in a unique_ptr; this also allows the vectors to keep their memory on the next pass, which may improve performance for huge maps
removed tree_t parameter from functions that don't need it
pass reference to tree_t instead of ptr
use an enum instead of std::optional<bool> for the ternary value to store split type, since it's more explicit and obvious now what the three values do
2022-08-19 15:15:53 -04:00
Jonathan 057ae544c4 use references in places where we know it's non-null 2022-08-19 12:11:35 -04:00
Jonathan 424e3ee110 remove unused portal_t::face, unused
rename and re-type a few things to use twosided
2022-08-17 09:10:58 -04:00
Jonathan 781a772d8a move immediately instead of splicing after construction (probably compiles to the same code but whatever)
don't add all of the `result_portals_onnode` one at a time; just directly copy-elision the result.
2022-08-14 07:33:41 -04:00
Jonathan da5b40ce73 since buildportal_t is small and being stored in an std::list (which already stores them in nodes that require allocation & non-moving locations) we don't need to wrap them in unique_ptr; this saves a malloc/free per buildportal_t 2022-08-13 08:24:13 -04:00
Jonathan 2059835a47 use a more optimized version of SplitBrush for CheckPlaneAgainstVolume that doesn't require allocating/freeing a lot of memory 2022-08-13 06:39:30 -04:00
Eric Wasylishen 06a116670b winding_t: make non-copyable 2022-08-12 02:06:23 -06:00
Jonathan bf162c7a86 allow explicit calling of percent_clock so it can be simplified a bit
add more timers in a few spots
by default, display percent timers but don't display elapsed for non-verbose stuff (bmodels); this is so it still shows that it's "working" instead of just showing blank for large maps, give user an idea on progress for certain stuff
merge all "side not found"s into a single line
time `FillOutside`
time `ProcessMapBrushes`
time `Brush_LoadEntity`
2022-08-12 01:30:04 -04:00
Jonathan 4bf2ab338c allowing logging::percent to handle indeterminate values
fix logging::percent getting stomped in multi-threaded operations
add new stats facility to make creating lists of single-use stats easier to manage
fix SplitBrush storing a bunch of extra stats for ChopBrushes
2022-08-11 20:33:12 -04:00
Jonathan 4b4a1738fd more partial revert 2022-08-10 23:06:37 -04:00
Jonathan eb7c65362c fix typo
assume non-sourced sides are non-visible
2022-08-10 22:27:40 -04:00
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 70f015a36c move func_areaportal and lmshift from bspbrush_t to mapbrush_t 2022-08-10 00:48:55 -04:00
Jonathan 44eff2d7b1 throw in percent logging for MakeTreePortals
when node_t converts to leaf, destroy anything on it by re-initializing it
2022-08-09 20:33:49 -04:00
Jonathan d6411cef01 remove AssertNoPortals - it's impossible for it to ever hit, and it's kind of expensive (~150ms for 60k portals) 2022-08-09 19:22:42 -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 426668701e clip_back/clip_front to match ChopWindingInPlace
simplify constructors for winding heap
use std::vector again for mapentity_t since it's being copied because of the std::list
2022-08-08 21:08:27 -04:00
Eric Wasylishen cf653b5b56 qbsp: MakeNodePortal: don't crash if w is empty
for consistency with qbsp3
2022-08-07 01:42:09 -06:00