Commit Graph

243 Commits

Author SHA1 Message Date
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 8476e2861c this all matches release now 2022-08-02 04:29:36 -04:00
Eric Wasylishen e05a2bdf75 qbsp: "-add additional.map" feature 2022-08-01 19:13:10 -06:00
Jonathan cc9dd986c6 adopt parent node bounds if a leaf is unbounded now too
move midsplitbrushes into same group as blocksize
always return a split rather than erroring
list out which method is used of the three
2022-08-01 15:51:57 -04: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 e60babdb9c add q3map2-style -blocksize option, using the same algorithm from it. it's optional and disabled by default.
pass through the "use mid split" boolean again
remove node_t::side; appeared to be unused in our current code, and needs to be removed anyways to support the other plane splitters
re-introduce ChooseMidPlaneFromList, but comment it out as it currently fails on a lot of BSPs.
2022-07-30 06:39:14 -04:00
Jonathan d33acbe12c remove snapvertices cmd 2022-07-28 09:25:19 -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
Jonathan 64cd39c229 add optional vertex snapping to match qbsp3 2022-07-28 03:56:12 -04:00
Jonathan 1f1388b2dd remove the type assertions 2022-07-27 22:49:41 -04:00
Jonathan 146f20f677 qbsp_plane_t is now used by other structures, and contains a faster epsilonEqual; since the majority of planes (especially nodes) are going to be axial, there's no need to use the slower full comparison when we can check if the axial component is ready. 2022-07-27 22:44:09 -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 f6d6972b17 fix percents being output when not requested for submodels
tjunc using MWT algorithm
2022-07-22 12:25:06 -04:00
Jonathan 989788cf71 add a switch to optimize compiles for no software mode (mainly for Q2)
fix tjunc 3 vert faces being destroyed
2022-07-19 08:41:59 -04: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 feb6055b07 remove errors pertaining to MAXEDGES (except on output) since we dynamically expand now
allow command line to specify maxedges
default maxedges to 0 (no limit) for Quake II
2022-07-14 04:57:52 -04:00
Jonathan ae4c5cd365 change face output to be slightly more robust
fix tjunc multithreading; added `original_vertices` which is a copy of the `output_vertices` that is safe for tjunc to read from since tjunc writes to the former
2022-07-14 01:56:18 -04:00
Eric Wasylishen d38a65c709 qbsp: revert sidespace to 24 2022-07-13 00:29:45 -06: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 1aa2a9b250 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	qbsp/qbsp.cc
2022-07-11 01:41:10 -04:00
Jonathan f98dd05f56 new, simpler qbsp3-esque TJunc code;
- currently uses naive brute force approach to finding vertices on faces
- simplify 'face fragments', which now only need to contain vertex indices since they are already emitted
2022-07-11 01:40:10 -04:00
Eric Wasylishen f86a5343fb qbsp: rename options -> qbsp_options 2022-07-10 17:30:00 -06:00
Jonathan b30d200543 remove `entity` from functions that no longer need it
EmitVertices as its own phase
2022-07-10 12:50:16 -04:00
Jonathan f213f4aa45 fix edge sharing
remove the "don't share edges if they have different contents" thing
2022-07-10 03:21:36 -04:00
Jonathan 2b0a04a188 fix spacing 2022-07-08 02:07:01 -04:00
Jonathan 5f37159224 allow disabling auto-upgrade, in the case where you don't want it to keep trying to output a BSP2/QBSP when it won't work in your target engine(s)
# Conflicts:
#	include/qbsp/qbsp.hh
2022-07-08 02:06:12 -04:00
Jonathan 705ab73169 rename light option `lmscale` to `lightmap_scale` to reflect its qbsp usage (a forced replacement of the "default" lightmap scale)
allow qbsp to be passed an `-lmscale` to facilitate a global lmscale change for BSPX
fix code paths for writing both lightmap sizes out

# Conflicts:
#	include/qbsp/qbsp.hh
2022-07-08 02:06:06 -04:00
Eric Wasylishen 97d360120b qbsp: use unique_ptr for node_t::facelist 2022-07-03 23:41:48 -06:00
Eric Wasylishen 40bba01b21 qbsp: brushbsp.cc import from qbsp3 2022-07-03 01:22:09 -06: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
Eric Wasylishen aabd1c27dc qbsp: face_t: make contents, lmshifts single sided
side_t: same, also remove contents (unused)
2022-06-24 01:14:11 -06:00
Eric Wasylishen 7b81702c08 qbsp: remove unneeded fields from side_t/face_t 2022-06-24 00:54:02 -06:00
Eric Wasylishen b37d29ee33 common: rename side_t -> planeside_t (side_t is used by qbsp3) 2022-06-24 00:16:46 -06:00
Eric Wasylishen 038651fca6 qbsp: rename brush_t -> bspbrush_t for consistency with qbsp3 2022-06-24 00:01:02 -06:00
Eric Wasylishen 5fc6cbc95e qbsp: wip import MakeFaces from qbsp3 2022-06-19 16:04:54 -06:00
Eric Wasylishen af2dd987d8 qbsp: import BaseWindingForNode from qbsp3 2022-06-17 22:10:11 -06: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 c62480c337 consistency rename; mtexinfo_t -> maptexinfo_t 2022-06-16 09:35:08 -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 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
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 4755f23efa re-implement inside filling (not working fully yet) 2022-06-13 01:44:06 -04:00
Eric Wasylishen 64159d92f1 Merge remote-tracking branch 'github-desktop-paril/type-cleanup' into brushbsp 2022-06-10 21:32:23 -06: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
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 f8c227acbf Merge branch 'type-cleanup' into brushbsp 2022-05-18 23:17:40 -06:00
Jonathan b63eb11275 wadpath/xwadpath always take 1 argument 2022-05-18 17:50:05 -04:00
Eric Wasylishen b21b7466ce Merge branch 'type-cleanup' into brushbsp 2022-05-16 21:33:57 -06: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 e2512372c3 fix -convert not working properly for Q2 maps
begin code for alias files
2022-05-15 10:09:38 -04: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 abc799554d build: fix all clang-cl warnings 2022-05-10 21:57:17 -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 5cae1919ce qbsp: fix areaportals 2022-05-04 21:04:36 -06:00
Eric Wasylishen 5b4a9956c6 qbsp: add -debugchop 2022-04-30 15:10:19 -06:00
Eric Wasylishen 8efb6f689b qbsp: add -outsidedebug flag 2022-04-27 19:18:27 -06:00
Eric Wasylishen 90e064e9e1 testqbsp: attempt to add a q2 test case (not working yet) 2022-04-26 23:45:44 -06:00
Eric Wasylishen f9aa40a50f qbsp: fix outside filling in maps with detail 2022-04-26 00:25:52 -06:00
Eric Wasylishen aa3174d732 testqbsp: initialize filesystem the same as a regular qbsp run 2022-04-20 01:25:29 -06:00
Eric Wasylishen 78210947ff qbsp: add -keepprt option 2022-04-19 01:03:18 -06:00
Eric Wasylishen 28c9cda561 Merge remote-tracking branch 'Paril/type-cleanup' into brushbsp 2022-04-17 13:46:50 -06:00
Eric Wasylishen 20a1b7b94b qbsp: szBSPName -> bsp_path, szMapName -> map_path 2022-04-17 13:41:23 -06:00
Jonathan 0b41f0a03b notriggermodels support 2022-04-16 22:20:29 -04:00
Eric Wasylishen f467257f72 qbsp: start test case for qbsp_simple_sealed2.map 2022-04-15 21:05:14 -06:00
Eric Wasylishen b7fbb48763 qbsp: enable new outside filling 2022-04-10 00:00:28 -06:00
Eric Wasylishen a3d54cf48d qbsp: remove unused face_t::original 2022-04-09 23:40:35 -06:00
Eric Wasylishen 407b39cad1 qbsp.hh: remove writebsp.hh and outside.hh includes 2022-04-09 23:30:42 -06:00
Eric Wasylishen b736704e5e qbsp.hh: remove portals.hh include 2022-04-09 23:28:12 -06:00
Eric Wasylishen 95824d26e4 qbsp.hh: remove surfaces.hh include 2022-04-09 23:25:54 -06:00
Eric Wasylishen ca589906d8 qbsp.hh: remove merge.hh include 2022-04-09 23:25:01 -06:00
Eric Wasylishen 2e14909e84 qbsp.hh: remove map.hh include 2022-04-09 23:23:26 -06:00
Eric Wasylishen f71ae3658e qbsp.hh: remove solidbsp.hh include 2022-04-09 23:19:34 -06:00
Eric Wasylishen 147a76c11b qbsp.hh: remove csg4.hh include 2022-04-09 23:17:43 -06:00
Eric Wasylishen 9295181f84 qbsp.hh: remove brush.hh include 2022-04-09 23:15:21 -06:00
Eric Wasylishen edad06cc5a qbsp: planning outside filling approach, wip 2022-04-05 19:46:59 -06:00
Eric Wasylishen 449b76db70 qbsp: remove unused region.hh header 2022-04-05 19:46:59 -06:00
Eric Wasylishen a019088c2f Merge branch 'type-cleanup' into brushbsp 2022-04-02 21:05:46 -06: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 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 91f7d9adaa qbsp: remove surface_t 2022-02-21 00:05:48 -07:00
Eric Wasylishen cb464031da qbsp: track original brushes, populate q2 leafbrushes accurately 2022-02-20 16:10:44 -07:00
Eric Wasylishen 8c84871129 qbsp: wip: add CSG-ing back in 2022-02-20 01:19:55 -07:00
Eric Wasylishen 2a257693c6 Merge branch 'type-cleanup' into brushbsp 2022-02-17 00:43:08 -07:00
Jonathan b0ece93f83 Fix/implement animated textures for Q2 2022-02-16 19:23:19 -05:00
Eric Wasylishen 1fbfd199c5 qbsp: wip port of BrushBSP from Q2 tools
currently can compile qbsp_simple.map (2 brushes)
no faces, but generates leafs/nodes which seem OK
2022-02-13 12:03:27 -07:00
Eric Wasylishen dc10d90c36 add missing <list> include 2022-02-07 00:35:27 -07:00
Eric Wasylishen 6b5b426636 qbsp: remove internal list in face_t 2022-02-07 00:02:51 -07:00
Jonathan ed325eedea surface faces now use list/vector 2022-02-06 11:39:22 -07:00
Eric Wasylishen 8531286777 qbsp: replace `-nothreads` with `-threads 1` for consistency with light/vis 2022-01-30 17:50:21 -07:00