Commit Graph

139 Commits

Author SHA1 Message Date
Eric Wasylishen d7acd046c3 light/qbsp: add _surflight_rescale key 2022-11-12 17:07:02 -07:00
Jonathan 5ea786702b always include NODRAW + LIGHT 2022-10-30 15:29:42 -04: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 acf334daee cleanup: rename surfflags_t::is_skip to is_nodraw
This is a break to the .json format
2022-09-18 15:47:14 -06:00
Jonathan 6713fedcbc allow changing a brushes' lightmap color scale with `lightcolorscale` 2022-09-10 19:04:17 -04:00
Jonathan 5fb0d56da7 maxlight
# Conflicts:
#	include/common/bspfile.hh
2022-08-24 21:50:11 -04:00
Jonathan 057ae544c4 use references in places where we know it's non-null 2022-08-19 12:11:35 -04:00
Jonathan 9e764d8035 document some stuff
remove mapface_t::value and mapface_t::flags; they are duplicated by texinfo
add mapface_t::get_texinfo and face_t::get_texinfo so that you can fetch them easier
2022-08-17 07:30:31 -04: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
Eric Wasylishen 854e1f48f5 qbsp: rewrite/fix hull and bmodel logging with new -loghulls and -logbmodels flags 2022-08-14 12:40:42 -06: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 d9a3abfba7 remove blocksize now that midplane is working
don't re-fetch plane being exported since we know its id already
2022-08-07 21:48:22 -04:00
Jonathan 7593834e06 fix map.planes being stomped on export 2022-08-07 19:39:29 -04:00
Jonathan a75f4239e3 node_t planenum 2022-08-02 16:04:48 -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 d9a9046e46 fix some foot-guns with qbsp_plane_t - type is auto-set now 2022-07-28 05:51:55 -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 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
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 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 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 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
Eric Wasylishen 40bba01b21 qbsp: brushbsp.cc import from qbsp3 2022-07-03 01:22:09 -06: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 92af2ed3f7 qbsp: restore weird 1 unit bounds shrinkage Q1 needs 2022-06-22 22:37:09 -06:00
Eric Wasylishen af802d5447 qbsp: fix model bounds 2022-06-22 22:23:14 -06:00
Jonathan c79e263753 simplify bspx code
remove old obj preview for wrnormals
2022-06-20 20:42:34 -04:00
Eric Wasylishen 276b62e30a Revert "first attempt at clustering leaffaces together"
This reverts commit a41c68886a.
2022-06-18 16:26:31 -06:00
Eric Wasylishen ccf605794e qbsp: throw exception in ExportLeaf if a leaf bounds is invalid
add check in test suite that qbspfeatures.map doesn't get upgraded to BSP2 due to invalid leaf bounds
2022-06-18 16:11:29 -06:00
Jonathan a41c68886a first attempt at clustering leaffaces together 2022-06-18 17:07:36 -04:00
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -04:00
Jonathan c62480c337 consistency rename; mtexinfo_t -> maptexinfo_t 2022-06-16 09:35:08 -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
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
Eric Wasylishen 3c4f798e97 qbsp: add create_detail_illusionary/fence/solid_contents 2022-06-10 01:07:20 -06:00
Eric Wasylishen 014e0d8aaa qbsp: replace some contents.extended reads with new is_detail_*() getters 2022-06-10 00:07:01 -06: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
Jonathan d05b8fc3db don't output texinfo for SKIP faces - rendered faces won't reference them anyways (unless includeskip is on) 2022-06-02 18:59:51 -04:00
Eric Wasylishen a1b8a38283 merge non-brush bsp specific changes from brushbsp branch 2022-05-11 01:58:53 -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
Jonathan b0ece93f83 Fix/implement animated textures for Q2 2022-02-16 19:23:19 -05:00
Jonathan 0392698bd3 Fix for engines that require edges reference valid vertices (edge 0 references vertex 0 but it might not be set in some cases)
Change `Brush_GetContents` again so that clip works
2022-02-05 13:18:21 -05:00
Jonathan 674be0c812 Fix a few messages (missing newlines, period in wrong place)
Use fragments to store TJunction bits instead of having them in separate-but-chained faces
2022-01-25 03:23:39 -05:00