Commit Graph

692 Commits

Author SHA1 Message Date
Jonathan 1aaa513368 collapse certain map face issues into loggable warning stats to lessen maps spamming warnings on things that legacy compilers allow
adjust the wording of certain warning messages
don't display face crunching on bmodels/hulls by default
2022-08-20 20:13:27 -04:00
Eric Wasylishen c0c146d47c bsputil: move decompiler to common 2022-08-19 20:49:34 -06:00
Eric Wasylishen f5a8bc7b99 bsputils: add a helper struct for checking clipnode identity 2022-08-15 23:06:00 -06:00
Jonathan f7b8f85ece use an optional<uint8_t> to store hull number, which gets rid of special -1 collision hull number.
fixed no-hull always chopping even with chop off
2022-08-15 06:13:30 -04:00
Jonathan 97665d15a9 fix slight mistype in Brush_LoadEntity
make ~settings_container virtual so light_t can be freed properly
reset visible to false on all brush sides
2022-08-15 03:37:38 -04:00
Eric Wasylishen e7adc1108a qbsp: reset more settings between test cases 2022-08-13 20:38:57 -06:00
Jonathan de7c8b42b4 fix hybrid at() 2022-08-13 20:57:58 -04:00
Eric Wasylishen 9baf161fc0 work around macos bug (std::atomic_size_t::value_type missing) 2022-08-13 13:12:23 -06:00
Eric Wasylishen 1844f0810f fix linux build 2022-08-13 12:40:11 -06: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 8b9c1bd784 fix missing includes 2022-08-12 02:42:52 -04:00
Jonathan ea38e5eeb7 fix missing move
fix clip_back causing extra copies
2022-08-12 02:03:00 -04: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 eb7c65362c fix typo
assume non-sourced sides are non-visible
2022-08-10 22:27:40 -04:00
Eric Wasylishen 55bdc88f9d polylib: use tbb::scalable_allocator for winding std::vector storage 2022-08-09 00:23:43 -06:00
Jonathan 189f70ca30 add in-place versions of union and expand to help with inlining 2022-08-08 22:43:10 -04:00
Jonathan 1c6b2e5a95 fix duplicate plane test 2022-08-08 21:27:42 -04: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
Jonathan 8b7a1c21c9 use vector instead of raw heap for winding_storage_heap_t 2022-08-08 20:09:41 -04:00
Eric Wasylishen 12abfb93cf qbsp: add fmt formatters for aabb_t, plane_type_t, qplane3, qbsp_plane_t 2022-08-07 16:58:52 -06:00
Jonathan 335db1c0e4 move map_source_location to parser as parser_source_location since the locations actually come from there rather than from the map; now the parser keeps track of the location, so it's a bit easier to follow 2022-08-05 23:17:15 -04:00
Jonathan a1faa97f3f fix aabb::contains 2022-08-05 06:58:29 -04:00
Jonathan 9af74ce083 store linenum on mapbrush_t; add new location type, but not using it yet, for later so we can track more complex locations (external/-add maps, etc)
add extra sanity checking to polylib
adjust some warnings to be clearer and not indicate that the world will break
add sanity check to update_bounds, and don't add empty windings to the bounds
2022-08-04 12:05:04 -04:00
Jonathan 24168c8e40 clang pass 2022-08-02 21:57:33 -04:00
Jonathan e14c2772a6 add ability for winding storages to reserve memory (for clip mainly, so it doesn't need to allocate on each addition; we know the winding will have at least the input number of points) 2022-08-02 18:10:20 -04:00
Jonathan 93655913c0 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	include/qbsp/qbsp.hh
2022-08-02 06:24:46 -04:00
Jonathan dd287f30d4 Merge branch 'brushbsp-midsplit' into brushbsp 2022-08-02 06:09:28 -04:00
Jonathan 53adb9fed5 split winding_base_t into two types, so that we can switch out the backing storage
default winding_t for the main polylib to use heap-based, exact-memory-usage-only, winding
2022-08-02 06:09:20 -04:00
Eric Wasylishen 52dff47a86 fix linux build 2022-08-01 12:47:20 -06:00
Eric Wasylishen 1751733ddc qbsp: add experimental MidSplit re-implementation, enabled by default 2022-08-01 12:30:04 -06:00
Jonathan 755a9e65ca use std::set instead of vector for original_brushes since we need them implicitly sorted and no dupes
parallelize PruneNodes_R and CalcTreeBounds_r
2022-08-01 13:19:50 -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
Eric Wasylishen aac9513417 qbsp: parallelize MakeTreePortals 2022-07-31 21:39:47 -06:00
Jonathan d8fd13d481 use <= gating for brightness for surface and bounce lighting, since these can often be very small values (provides a moderate speed increase as well, counter-balancing the next change)
bounce lighting generates a grid of bounces rather than a single light, improving lighting in conditions with larger faces or where the midpoint is blocked by other geometry
2022-07-29 22:26:07 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan d9a9046e46 fix some foot-guns with qbsp_plane_t - type is auto-set now 2022-07-28 05:51:55 -04:00
Eric Wasylishen a2451a41fb qbsp: rewrite of q1 contents representation in bspfile.cc
use q2-like bitflags so we can represent mixes like (water | mist), which we need within the compiler
2022-07-27 02:31:49 -06:00
Eric Wasylishen 6025585f01 switch from std::any to class hierarchy for content_stats_t
Fixes bogus (huge integers) content stats reporting on macOS (also fix tjunc stats reporting)

having the non-copyable std::atomic<size_t> inside a std::any which must
be copyable was problematic

IMO this is slightly better because it lets us use non-copyable types
2022-07-18 20:13:33 -06:00
Jonathan acac6cb720 add in a "validator" setting which is just a thin wrapper to another setting type allowing for an additional validation step
simplify the face structure; now, "fragments" just mean the output windings (if you opt out of tjunction fixing, then there will only be 1 fragment with the same values as original_vertices)
move MakeTangentAndBitangentUnnormalized to qvec.hh since we will use it later
-tjunc allows for more fine-grained control now (-notjunc still exists)
-maxedges now throws if you specify a bad value (1 and 2)
remove the checks to OmitFaces - we can tell if a face was omitted because it will have an empty winding
remove static variables from tjunc
2022-07-16 10:45:24 -04:00
Jonathan da9546e260 change settings semantics to be simpler and more clear:
- no more "isLocked" - use getSource directly (locked is a confusing name)
- no more split parse/setValue functions. there's only one entry point each now, and all they do is pass along the source passed to it from its parser.
- no separate setters, use setValue(value, source)
- add a "game target" source, which is low priority and indicates to the user that the value would have been default but was changed to a better value for the game target
2022-07-14 09:03:59 -04:00
Jonathan 0fb1b429a8 finish tjunc algorithm - can now retopologize by splitting fans up
lower zero-area triangle epsilon
2022-07-12 17:43:25 -04:00
Jonathan 8fc089aa34 fix lmscale with bounce lighting 2022-07-09 23:09:02 -04:00
Jonathan adc54dac61 fix bug with output of lmstyle/lmoffset lumps
bspinfo will output proper atlasses now
use faceextents_t everywhere
2022-07-08 02:06:07 -04:00
Jonathan 43c5e942b2 move faceextents_t & friends to common
use stb_image_write for PNGs for better compression on bsp.json
add in code for spitting out a lightmap from a face. doesn't support other styles and such yet.
2022-07-08 02:06:06 -04:00
Jonathan 6caee83eb2 remove old string parse stuff since we don't use it any more (the "parse the rest" method)
(cherry picked from commit fb3ff5decd)
2022-07-04 20:47:11 -04:00
Jonathan a0d81372d1 improved path detection (and overriding) routines
(cherry picked from commit 32f33fb4b3)
2022-07-03 18:23:40 -04:00
Eric Wasylishen 40bba01b21 qbsp: brushbsp.cc import from qbsp3 2022-07-03 01:22:09 -06:00
Jonathan 9f734ff976 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspfile.cc
#	include/common/bspfile.hh
#	light/trace.cc
2022-06-30 05:23:05 -04:00
Jonathan 410106ff90 fix uninitialized memory 2022-06-29 14:27:00 -04:00
Jonathan 03ee5c52e8 add an entry point for specifically loading meta-only file formats, like .wal; used for discerning replacements from their source material (since replacements are often larger than the default, we need the scale info)
add a new meta format, which is just a JSON representation of the metadata contained in a .wal
simplify texture loading in `light`
fix `light` not handling replacement textures very well
string_iequals take string_view like the others
move averageColor to be alongside pixel data, where it belongs
2022-06-29 12:59:33 -04:00
Jonathan c1dc3cb7d8 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/common/bspfile.hh
2022-06-28 04:13:26 -04:00
Jonathan 44c50717c3 move generic image loading routine to `img`
move light-specific "load textures from BSP" routine to light
fix a couple bugs with external wad textures (there should always be at least a 40-byte miptex in there)
light can now load external textures
move -paths to common settings
fix bug with missing texture not filling miptex name
2022-06-28 01:37:12 -04:00
Jonathan c23b7d2ec9 allow Quake-likes to load textures similarly to Q2 (finding best place to load them from)
allow Quake and Q2 to handle other texture formats (mainly just TGA for now)
2022-06-27 11:30:28 -04:00
Jonathan bf1cb56e5a fix build
add setting to control file priority
2022-06-27 10:41:24 -04:00
Jonathan cf04f644e0 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspinfo.cc
#	include/common/bspfile.hh
#	include/qbsp/map.hh
#	include/qbsp/wad.hh
#	qbsp/wad.cc
2022-06-27 06:44:45 -04:00
Jonathan 510023e089 step 1 of finishing the rewrite I started of the image subsystems.
- for Quake-likes, WADs will be added as file system archives directly when the first brush is encountered since the wad key is ready to go by that point.
- after loading the .map and before constructing the BSP, what I call secondary textures (animation frames for Quake-likes) are added to the list, and the BSP's miptex data is filled.
- BSP miptex data is now opaque to the BSP process; the BSP simply copies the raw miptex information from the input. This simplifies the BSP structures and reading/writing routines.
- the img subsystem supports reading from raw miptexes now, although in practice this only happens for Quake-likes atm
- instead of a "wal cache", maps now have a "meta cache" which stores the metadata information for all games instead of just Quake II
- texture meta can now be ref'd out rather than needing to be copied every time (mainly only a gain for the std::string)
- wad.cc/wad.hh is gone; wads are now pushed into the filesystem archive
- fixed broken wad_archive
- fs subsystem iterated on a little bit; supports marking archives as external (only used for wads currently; see `LoadTextureData`)
- load_tga has better error handling
- add in foot-gun protection to the BSP readers; now they assert on failure to read instead of silently propagating that error throughout the rest of the process
- bsputil uses img stuff now, so it should handle palettes better
2022-06-27 03:58:23 -04:00
Eric Wasylishen 92dd54c0b1 bspfile: fix is_any_solid() implementation to be just (contents.native & Q2_CONTENTS_SOLID) 2022-06-27 01:19:31 -06:00
Jonathan 2264de71a2 Revert "very slight speedup (~3% improvement) on normalize; don't sqrt if we don't need to (rare), and use multiplication instead of division"
This reverts commit 8fe525f5b2.
2022-06-26 01:24:47 -04:00
Jonathan 00485553f3 / should be * 2022-06-26 01:22:03 -04:00
Jonathan 8fe525f5b2 very slight speedup (~3% improvement) on normalize; don't sqrt if we don't need to (rare), and use multiplication instead of division 2022-06-25 20:56:08 -04:00
Jonathan a4c304272a use floats for dealing with ray info, for consistency (and to avoid a bunch of float->double casts)
use raydir from hit point rather than calculating it twice
2022-06-25 04:47:26 -04:00
Eric Wasylishen b37d29ee33 common: rename side_t -> planeside_t (side_t is used by qbsp3) 2022-06-24 00:16:46 -06:00
Jonathan 579140067f expose vector.size() using a subtype to not pollute winding_base_t 2022-06-23 18:42:38 -04:00
Jonathan 3ac1d02624 fix missing noexcept
explicit initialization in some cases for vis winding_t's parameters
more vector
2022-06-23 17:02:18 -04:00
Jonathan c6521aa0b6 move aligned allocator to cmdlib 2022-06-23 00:39:28 -04:00
Jonathan cb3ef7b19f allow radlights to specify an entity dictionary instead (if the input is a .ent, it is an entity dict) which is more flexible 2022-06-22 17:03:00 -04:00
Jonathan b725b32c66 fix compile 2022-06-22 15:50:38 -04:00
Jonathan dfdd568974 use unique_ptr 2022-06-22 14:43:53 -04:00
Eric Wasylishen 40f370dbd5 Merge branch 'portalfaces' into brushbsp 2022-06-21 16:25:19 -06:00
Jonathan 210d994445 cherry pick commit 96cd23761c from @Shpoike
Removed legacy switchable lightstyles limit (requires updated engines when exceeded). Added -facestyles argument that allows for >4 styles per face, as well as potentially increasing style indexes to 16bit for far far more switchable styles.
2022-06-21 15:35:39 -04:00
Jonathan 72914b4724 moving more raw pointers to vectors/smart pointers
support for radiosity _surface lights with `_surface_radiosity` key
allow lightstyles for _surface radiosity lights
bounce enabled by default on Q2
remove ValueForKey, use epairs directly
2022-06-21 13:41:51 -04:00
Eric Wasylishen 57473f7b4a Merge branch 'brushbsp' into portalfaces 2022-06-21 01:45:14 -06:00
Eric Wasylishen 1c4b90a032 qbsp: fix detail_illusionary_noclipfaces_intersecting 2022-06-20 20:53:56 -06:00
Jonathan df3e6d3988 remove Little* funcs, not used any more
remove byteswap as it wasn't used any more
re-introduce imemstream and omemstream to make it harder to accidentally use the wrong operators
add dynamic padding stream manipulator
use memstreams for BSPX
2022-06-20 21:39:08 -04:00
Jonathan c79e263753 simplify bspx code
remove old obj preview for wrnormals
2022-06-20 20:42:34 -04:00
Jonathan 9354fc8148 reserve as much as we currently have allocated rather than only exactly how much is coming up 2022-06-19 19:22:34 -04:00
Jonathan cd77b1a7e6 use vector as overflow instead of secondary storage for winding 2022-06-19 19:17:52 -04:00
Eric Wasylishen 4f3ca8c252 qbsp: wip import MarkVisibleSides from qbsp3 2022-06-19 16:04:54 -06:00
Jonathan e366898796 re-introduce vis culling, mainly for Q2/surface lit maps
-novisapprox gone; replaced with -visapprox auto|none|vis|rays
2022-06-18 23:56:45 -04:00
Jonathan b21920841d revert some of the vis stuff, but re-implement it in a more working state 2022-06-18 18:36:09 -04:00
Jonathan dfa1282d40 simplify/c++-ize CompressRow code and related areas (less allocations overall) 2022-06-18 18:25:23 -04:00
Jonathan ac05a7ecf6 Revert "simplify/c++-ize CompressRow code and related areas (less allocations overall)"
This reverts commit 46aaa81ffd.
2022-06-18 17:29:07 -04:00
Jonathan 7eedf52bf4 sync up BaseWinding checking
add constructor to aabb to construct from range
2022-06-18 14:33:16 -04:00
Jonathan b0dad9d01d save a few more cycles by just using raw pointers. it's a bit uglier, but this is hard to represent with shared_ptr and I think it was the wrong choice anyways since the ownership chain is difficult to represent in a shared_ptr here. 2022-06-17 14:56:17 -04:00
Jonathan 46aaa81ffd simplify/c++-ize CompressRow code and related areas (less allocations overall) 2022-06-17 12:06:37 -04:00
Jonathan 238a7b8fa7 document FACENORMALS lump 2022-06-17 10:59:24 -04:00
Eric Wasylishen 259d95e47c testqbsp: add a first portal test 2022-06-17 01:53:08 -06:00
Eric Wasylishen 0edd52517a testqbsp: read .prt files back in 2022-06-16 23:22:15 -06:00
Eric Wasylishen f6309a91cb vis: move .prt reader to common 2022-06-16 21:55:03 -06:00
Eric Wasylishen a746506d6a clang-cl build fix 2022-06-16 20:54:15 -04:00
Jonathan 0b67acd4ba Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	include/common/bspfile.hh
2022-06-16 20:22:36 -04:00
Jonathan e57633bbca the old Safe read/writes are gonedy now 2022-06-16 20:22:03 -04:00
Eric Wasylishen b164b7b250 bspfile: fix bad optional access on Q1 maps 2022-06-16 17:14:40 -06:00
Jonathan d872514b56 split bspfile.hh into multiple files which store the respective BSP info for the different BSP types; bspfile_generic stores the upper-most data (the superset of all BSP types), whereas the individual files contain the subsets. 2022-06-16 12:06:37 -04:00
Jonathan 740ab24626 bspx stuff into its own file
change the printing to be less redundant on BSP version
2022-06-16 10:59:22 -04:00
Jonathan f53a6a19fe move extended_texinfo_t to qbsp, since it's only used during compilation and not related to the BSP file 2022-06-16 09:50:00 -04:00
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -04:00
Jonathan 8afcc54b74 move making contents valid from brush parsing into gamedef 2022-06-15 09:07:37 -04:00
Eric Wasylishen 0c24e7bbd0 clang-cl build fix 2022-06-14 20:18:06 -06:00
Jonathan eedabe6f1c fix bugs 2022-06-14 18:38:22 -04:00
Jonathan 17656eff78 don't return string ref, since it can be modified after it's inserted because of the vector growing 2022-06-14 18:34:01 -04: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 f1fd0bd30f Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-14 10:50:54 -04:00
Jonathan 7827885f0f add texturedef support
change Q2_CONTENTS_TRANSLUCENT parsing; remove it always, but if the surface doesn't have TRANS then swap it with DETAIL which is probably what they intended
2022-06-14 10:50:35 -04:00
Eric Wasylishen a309e8467b testmaps: add qbsp_q1_sealing.map 2022-06-14 00:44:50 -06:00
Jonathan 12caf1bcd4 move transsky/transwater code into portal_can_see_through 2022-06-13 02:34:39 -04:00
Jonathan 98682f41fa move brush/leaf counts into gamedef
(Q2 stores every combo currently, old code kept in case we want to use that instead)
2022-06-12 03:35:44 -04:00
Jonathan 1a88b46e8c RemapContentsForExport moved into gamedef
simplified gamedef stuff by checking which functions were still necessary, and no need to pass extended flags through at all now
detail type moved into Q1
2022-06-12 02:24:27 -04:00
Jonathan 54900cf7b6 move visblocker to a boolean 2022-06-12 01:02:31 -04:00
Jonathan 13bf99a7f3 fix test cases (implement equals(game) properly, and `is_empty` is false depending on get_content_type for Q2 now)
remove unnecessary condition from Q2 contents_are_empty since areaportals are already considered a valid non-empty type via get_content_type
2022-06-11 09:19:51 -04:00
Jonathan 10676603e9 move clip & origin into game-specific code
remove hint from brush; hint is technically a surface flag rather than a content flag, so we can infer it from the sides rather than needing to store it as a unique flag (we could still cache the result somewhere but this makes it consistent between q1 and q2)
2022-06-11 08:29:55 -04:00
Jonathan b33e792458 move clip-own-typeness over to gamedef & contentflags (fixes Q2 edge case with a solid version of a type bordering a translucent version) 2022-06-11 06:01:36 -04:00
Jonathan e61998dd54 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	qbsp/surfaces.cc
2022-06-11 05:43:29 -04:00
Jonathan 8b4f9f5480 move mirrorinside to gamedef 2022-06-11 05:37:50 -04:00
Eric Wasylishen 5372c4a568 qbsp: fix q2 liquids not mirrored 2022-06-10 23:29:28 -06:00
Eric Wasylishen 64159d92f1 Merge remote-tracking branch 'github-desktop-paril/type-cleanup' into brushbsp 2022-06-10 21:32:23 -06:00
Eric Wasylishen fc5f1573ef qbsp: simplify ShouldClipbrushEatBrush
fixes lavaclip test case
2022-06-10 20:00:42 -06:00
Eric Wasylishen d4f1707cdb qbsp: proper merging of Q2 contents 2022-06-10 19:19:00 -06:00
Jonathan 812797f7ed enable lighting for warp/sky in Q2
simplify bitflag definitions
change nudging light warning to make more sense
another #define -> constexpr pass
2022-06-10 06:29:14 -04:00
Jonathan 5b4660fa63 simplify crc code 2022-06-10 04:47:10 -04:00
Jonathan 42c4060a64 canonize plane stuff into an enum type, remove duplicates
more macros into constexpr's
use options.epsilon directly instead of ON_EPSILON in qbsp
2022-06-10 04:43:56 -04:00
Eric Wasylishen 3c4f798e97 qbsp: add create_detail_illusionary/fence/solid_contents 2022-06-10 01:07:20 -06:00
Eric Wasylishen 8c1095715c qbsp: refactor out is_detail(int32_t types = CFLAGS_DETAIL_MASK) since it's going to depend on game now 2022-06-09 23:48:26 -06:00
Eric Wasylishen 47aa1f7476 qbsp: replace is_detail() with is_any_detail(options.target_game) 2022-06-09 23:32:33 -06:00
Eric Wasylishen 33f1681261 bspfile.hh: updates to content type constants docs 2022-06-08 01:03:39 -06: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
Eric Wasylishen b6c421d30e bspfile.hh: #define -> constexpr for content flags 2022-06-03 20:12:04 -06:00
Jonathan 65852ef042 adjust settings_set to only accept one token per entry
radlights is now a set (only loads one though)
2022-06-01 20:42:06 -04:00
Eric Wasylishen 0f2ea5333d move CompressRow/DecompressRow from vis to common 2022-05-24 21:01:41 -06:00
Eric Wasylishen 25b390aafe qbsp: merge original brush lists when merging leafs in PruneNodes 2022-05-21 16:05:22 -06:00
Eric Wasylishen b21b7466ce Merge branch 'type-cleanup' into brushbsp 2022-05-16 21:33:57 -06:00
Jonathan ad85489580 fix windings > N being initialized wrongly 2022-05-15 21:07:35 -04:00
Eric Wasylishen 8fe5d9d694 common: adjust formatting of usage line
-remove version hash as it's printed above
-rename `usage` variable to `programDescription`
2022-05-15 17:44:17 -06:00
Eric Wasylishen 6f1ca3c79d Merge branch 'type-cleanup' into brushbsp 2022-05-15 14:02:42 -06:00
Jonathan d9c6e52bd3 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-05-15 10:09:41 -04:00
Jonathan e2512372c3 fix -convert not working properly for Q2 maps
begin code for alias files
2022-05-15 10:09:38 -04:00
Eric Wasylishen c82741ff8a Merge branch 'type-cleanup' into brushbsp 2022-05-15 00:46:49 -06:00
Eric Wasylishen 9c806d2d15 settings: don't call exit(0) in printHelp() as it's problematic for tests 2022-05-14 18:11:14 -06:00
Eric Wasylishen ba37ae3a54 move serialize_bsp() to common/bspinfo.cc 2022-05-14 14:54:21 -06:00
Eric Wasylishen 4957622c50 Merge branch 'type-cleanup' into brushbsp 2022-05-13 01:24:14 -06:00
Jonathan 59db5bfdc5 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup
# Conflicts:
#	include/qbsp/qbsp.hh
#	qbsp/map.cc
#	qbsp/qbsp.cc
2022-05-11 09:50:46 -04:00
Jonathan cbdb5c0c73 slight bit of cleaning 2022-05-11 09:46:39 -04:00
Eric Wasylishen a1b8a38283 merge non-brush bsp specific changes from brushbsp branch 2022-05-11 01:58:53 -06:00
Eric Wasylishen 4a711908c8 Merge branch 'pr/322' into brushbsp 2022-05-11 00:29:58 -06:00
Eric Wasylishen 6e3bb91d98 build: fix build on macOS/clang 2022-05-11 00:21:14 -06:00
Eric Wasylishen e9abb212bb settings: allow setting_enum to parse numeric representation of enums
use it for light forumla. disallow enums in setting_numeric.
2022-05-10 22:55:41 -06:00
Eric Wasylishen d390ac2030 build: restore !enum check on setting_numeric constructor and boolValue()
with non-MSVC workaround
2022-05-10 22:08:41 -06:00
Eric Wasylishen abc799554d build: fix all clang-cl warnings 2022-05-10 21:57:17 -06:00
Eric Wasylishen d763b2e336 build: support clang-cl 2022-05-10 21:39:58 -06:00
Eric Wasylishen 66ba184083 Merge branch 'type-cleanup' into brushbsp 2022-05-10 00:47:41 -06:00
Eric Wasylishen 0c4833226a settings: implement reset(). Fix setting_mangle::copyFrom()
We can't use the string serialization/deserialization trick because setting_mangle transforms
the value upon parsing
2022-05-10 00:43:22 -06:00
Eric Wasylishen 081d63a64c settings: add setting_container::copyFrom, setting_base::copyFrom
disable copy constructors on setting_container/setting_base, which were previously available but broken
2022-05-09 22:32:09 -06:00
Eric Wasylishen 4021d71700 polylib: make operator[] un-bounds-checked 2022-05-08 15:20:21 -06:00
Eric Wasylishen 1df848cfc1 testqbsp: areaportal test 2022-05-04 17:47:14 -06:00
Eric Wasylishen e0d0d5246f aabb: add disjoint_or_touching 2022-05-03 19:22:14 -06:00
Eric Wasylishen ec20072440 testqbsp: expand q2 detail test 2022-05-02 20:24:18 -06:00
Eric Wasylishen fa97116d12 testqbsp: wip markfaces test 2022-05-02 02:13:54 -06:00
Eric Wasylishen 3a30891476 testqbsp: add more detail_illusionary tests 2022-05-01 21:44:58 -06:00
Eric Wasylishen 59684a1c5d Merge remote-tracking branch 'Paril/type-cleanup' into brushbsp 2022-05-01 01:21:01 -06:00
Eric Wasylishen 13612f18d0 qbsp: factor out 'chops' condition in BrushGE 2022-05-01 00:48:58 -06:00
Jonathan cc0e1a5561 move Face_IsLightmapped to light
Fix q2rtx, needs to include lightstyle for nodraw for emissive invisibles with lightstyles
fix wal (for the 900th time)
auto-set -nolighting for -q2rtx
2022-04-30 23:27:21 -04:00
Eric Wasylishen fb59c2e950 bspfile.hh: q1 contents from #defines to constexpr
now prints properly in GTest assertions
2022-04-28 00:47:34 -06:00
Eric Wasylishen 10fbfff20d qbsp: liquids are higher priority than detail_illsuionary 2022-04-27 01:26:56 -06:00
Eric Wasylishen d2c7412a44 testqbsp: proper test for detail_doesnt_remove_world_nodes 2022-04-26 19:08:44 -06:00
Eric Wasylishen 8731dcb469 bspfile.hh: remove covered_native 2022-04-26 01:23:36 -06:00
Eric Wasylishen 1a0b4c0733 qbsp: more covered_native stuff to remove 2022-04-25 22:01:10 -06:00
Eric Wasylishen 9977c14a2f bspfile: add gamedef_t::contents_seals_map() 2022-04-25 18:40:55 -06:00
Eric Wasylishen 28c9cda561 Merge remote-tracking branch 'Paril/type-cleanup' into brushbsp 2022-04-17 13:46:50 -06:00
Jonathan 91310ef6b8 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-04-16 22:20:35 -04:00
Jonathan 6080e7fc5d a bit of q2rtx stuff 2022-04-16 10:28:46 -04:00
Eric Wasylishen 24ca07188c log: use ANSI colors for strings containing "warning" or "error" 2022-04-03 14:16:22 -06:00
Eric Wasylishen a0fbfdbad5 log: use ANSI colors for strings containing "warning" or "error" 2022-04-03 12:56:11 -06:00
Eric Wasylishen a019088c2f Merge branch 'type-cleanup' into brushbsp 2022-04-02 21:05:46 -06:00
Jonathan f5cda68416 clean up percent stuff
comment out "didn't split" message
fix winding resize
merge phong loops together
2022-03-07 14:49:50 -05:00
Jonathan c81e9ace28 remove old threading code entirely
add new parallel logging stuff in common/parallel which wraps parallel_for(_each) and provides automatic percentage indicator
fix issue with light not pulling in settings
move logging stuff into its own namespace and simplify
2022-03-01 10:28:59 -05:00
Jonathan a479a5ddfb use case-insensitive natsort for discoverArchives
add two other logging control bools, which -quiet now redirect to
add -lowpriority for CPU priority (on Windows)
2022-02-28 09:20:35 -05:00
Jonathan 6baea3bc03 Fix three bugs that slipped by for cmdargs
Remove old threading code, use tbb internally
2022-02-27 04:09:28 -05:00
Jonathan df92d9ce12
Command line args systems (#2)
* cmd

* cmake change for tbb DLLs
add in test for double-hyphens

* cmd

* game version

* settings!

* bsp texture usage
decompile fix for q1bsp

* finish up the options for qbsp

* light finished?

* finish up the few missing bits

* move scalar/int32 up

* Run clang-format pass

* natvis for our mathlib
use slightly faster storage for winding
fix light tests

* allow dictionary to be a base type

* re-run style

* Remove cfg_static
Fix options summary

* natvis for lockable_value<T>

* last-ish pass?

* format

* forgot last few lockables
2022-02-27 00:01:57 -05:00
Eric Wasylishen 658d807052 qbsp: finish re-adding CSG code 2022-02-21 12:35:27 -07:00
Eric Wasylishen 3b348af301 qbsp: wip mirroring faces 2022-02-21 00:47:57 -07:00
xDShot 5780ce4bd6
Include some headers for brushbsp branch files (#325)
* include <vector> for std::vector definition

* include <algorithm> for std::clamp definition
2022-02-19 11:17:20 -07:00
Eric Wasylishen 8531286777 qbsp: replace `-nothreads` with `-threads 1` for consistency with light/vis 2022-01-30 17:50:21 -07:00
Jonathan 15484b55f8 Use better tjunction vertex addition
Parallel MergeAll
Allow modifyable iterators from polylib; resizing may invalidate them however
2022-01-28 09:45:29 -05:00
Jonathan d076920665 Revert "Instead of calculating brush extents globally, do it per brush creation"
This reverts commit 069720078f.
2022-01-27 01:52:08 -05:00
Jonathan 069720078f Instead of calculating brush extents globally, do it per brush creation
Use portal node bounds for extents
2022-01-27 01:03:38 -05:00
Jonathan 93505a88b2 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-01-26 18:03:36 -05:00
Jonathan 571e7337fc Fix the temporary hintskip detection and finally move it to gamedef
Dynamic extent calculation - turned on by default - will automatically determine the extents used for winding_from_plane beforehand. On a 50kb .map file it only takes about 10ms, so for the majority of maps it should be instantaneous.
2022-01-26 18:03:31 -05:00
Eric Wasylishen 19dbc1c1c8 polylib: fix compile error with clang 2022-01-25 19:55:07 -07:00
Jonathan 0414c77c19 Use copies rather than moving for conversion, so that graceful upgrades are graceful again 2022-01-25 04:49:20 -05:00
Jonathan ff2ff5c87f fix emplace UB 2022-01-25 04:21:07 -05:00
Jonathan 5dd2deba8e use custom type for two-sided things to simplify brain power (.front/.back is easier to process than [0]/[1]) 2022-01-23 00:26:58 -05:00
Jonathan 68424edb8d introduce a flag for whether the target game supports bmodels with contents
move the check in SubdivideFace so that it can early-exit if subdivision isn't even enabled
2022-01-21 00:51:06 -05:00
Jonathan c9f2502118 Fix swap 2022-01-20 19:50:05 -05:00
Jonathan 008d6db056 Fix detail for Q2 maps
Simplify winding::flip
Add an assert that a generated surface has a non-empty bounds (have a map that generates a face with 0,0,0 bounds)
2022-01-20 19:25:58 -05:00
Jonathan 0cca14d1b2 Fix bug in bitangent calculation - thank you AlexP
Allow `calc_sides` to skip writing outputs if they are not required, & return counts since they are constant sized
2022-01-20 16:35:56 -05:00
Jonathan 10fa97e6b8 Use string_view where appropriate for parser, add some additional constructors for ease of use 2022-01-16 04:17:06 -05:00