Commit Graph

1266 Commits

Author SHA1 Message Date
Eric Wasylishen 4ab4cb7dc8 qbsp: use unique_ptr for portal_t 2022-07-03 22:45:25 -06:00
Eric Wasylishen de68bee886 qbsp: move tree_t to tree.hh 2022-07-03 21:36:17 -06: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 cb4a1ad8a3 re-add nodraw/sky warning 2022-06-30 15:12:42 -04:00
Jonathan f7016d1af0 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-30 05:24:53 -04: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
Eric Wasylishen 862d9bd5f2 testqbsp: add q1_clip_func_wall
Ensure submodels that are all "clip" get bounds set correctly
2022-06-30 00:53:02 -06:00
Eric Wasylishen 2127209955 qbsp: add CreateBrushWindings from qbsp3 2022-06-30 00:31:42 -06: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 292d5afb5e Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-28 06:08:04 -04:00
Jonathan c1dc3cb7d8 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/common/bspfile.hh
2022-06-28 04:13:26 -04:00
Eric Wasylishen 1693bb3877 qbsp: side_t doesn't need sphere culling 2022-06-28 02:01:41 -06:00
Eric Wasylishen b21e245d99 qbsp: surface.cc -> faces.cc 2022-06-28 00:23:47 -06:00
Eric Wasylishen c64b869248 testqbsp: make winding test [.releaseonly] as it crashes on msvc debug builds 2022-06-28 00:21:59 -06:00
Eric Wasylishen eb1f7acc02 qbsp: move PruneNodes to tree.cc for qbsp3 alignment 2022-06-28 00:06:18 -06: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
Eric Wasylishen 29a622d106 testqbsp: use -noverbose by default 2022-06-27 22:44:08 -06:00
Eric Wasylishen 7439fc30db testqbsp: fix absolute path in q1_wad_external 2022-06-27 22:40:38 -06: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 59bff81e9d tests for new WAD stuff 2022-06-27 08:14:30 -04:00
Jonathan 26608c1b37 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspfile.cc
#	common/bspinfo.cc
2022-06-27 08:14:03 -04:00
Jonathan 732621c59a fix bugs in miptex writing
clear FS when loading filesystem again (for tests mainly)
move img::load_palette to where it is in brushbsp
2022-06-27 08:13:04 -04:00
Jonathan a7662a9c9b fix noclipfaces being inverted from type-cleanup 2022-06-27 06:56:20 -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 ba7c18fd35 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-06-27 03:58:41 -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 c7111cc99e qbsp: move FloodAreas to portals.cc for parity with qbsp3 2022-06-27 01:32:34 -06:00
Eric Wasylishen e660182c37 testqbsp: readd "-nopercent" as test output is too verbose without 2022-06-27 01:20:16 -06:00
Eric Wasylishen 5624f7012a qbsp: moving PortalThru->Portal_VisFlood, Portal_EntityFlood to portals.cc for qbsp3 parity
also fixes to both to match qbsp3
2022-06-27 01:13:21 -06:00
Eric Wasylishen 4c2111bfd3 testqbsp: re-enable base1.map test as well as dm1.map (disabled by default as it's too slow on debug builds) 2022-06-27 00:33:04 -06:00
Eric Wasylishen 22f0def4b1 update Catch2 to v3.0.1 2022-06-26 13:21:29 -06: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 afec0a947e qbsp: change bspbrush_t.sides from face_t to side_t 2022-06-24 00:43:40 -06:00
Eric Wasylishen fac5ea384d qbsp: rename bspbrush_t.faces to .sides 2022-06-24 00:21:55 -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 4a1c5842a3 qbsp: rename solidbsp.cc -> brushbsp.cc for consistency with qbsp3 2022-06-24 00:08:12 -06:00
Eric Wasylishen 038651fca6 qbsp: rename brush_t -> bspbrush_t for consistency with qbsp3 2022-06-24 00:01:02 -06:00
Jonathan ee596f3ff1 use vector for vis state
set autoclean default to true, make it invertable
2022-06-23 16:18:52 -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
Eric Wasylishen 84263ef1a1 testqbsp: add model bounds test map 2022-06-22 22:11:40 -06:00
Eric Wasylishen b99ea58ed7 testqbsp: q1 leaf/node bounds tests 2022-06-22 21:43:41 -06:00
Eric Wasylishen f84c794668 testqbsp: make "origin" test accept legacy ericwtools output 2022-06-22 21:43:41 -06:00
Jonathan 0fa779afaa Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-22 14:43:57 -04:00
Eric Wasylishen c054db0f48 testqbsp: shouldn't use -keepprt as the tests are checking for the .prt files 2022-06-21 23:46:13 -06:00
Jonathan 54ac8123e3 use old WindingIsTiny 2022-06-22 01:02:12 -04:00
Eric Wasylishen b77c25dcd4 qbsp: fix -keepprt 2022-06-21 22:05:54 -06:00
Jonathan 60df9eba81 disable `ChooseMidPlaneFromList` to fix regression 2022-06-21 21:07:26 -04:00
Eric Wasylishen 8332c78871 testqbsp: flag water_detail_illusionary as mayfail 2022-06-21 17:25:56 -06:00
Eric Wasylishen 40f370dbd5 Merge branch 'portalfaces' into brushbsp 2022-06-21 16:25:19 -06:00
Jonathan 36a8327452 cherry-pick 812159312e from @Shpoike
Don't strip extended mip data.
2022-06-21 14:11:58 -04:00
Eric Wasylishen 7e1ede2ac3 qbsp: remove old face creation code 2022-06-21 02:01:52 -06:00
Eric Wasylishen 57473f7b4a Merge branch 'brushbsp' into portalfaces 2022-06-21 01:45:14 -06:00
Eric Wasylishen 98e27cf620 testqbsp: improve water_detail_illusionary test 2022-06-21 01:16:55 -06:00
Eric Wasylishen 6be54eadb0 testqbsp: improve water_detail_illusionary test 2022-06-21 01:05:41 -06:00
Eric Wasylishen b3f88d6797 qbsp: remove redundant MergeAll call 2022-06-21 00:40:31 -06:00
Eric Wasylishen 84e007b7ce qbsp: fix noclipfaces tests 2022-06-21 00:39:07 -06:00
Eric Wasylishen e39c8f9cf6 qbsp: fix simple_worldspawn_detail_wall 2022-06-20 23:05:56 -06:00
Eric Wasylishen 6770d8aa34 testqbsp: remove mayfail 2022-06-20 20:56:19 -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 e422da15c3 simplify OutsideFill_Passable 2022-06-20 11:58:40 -04:00
Eric Wasylishen 83c1316cdd docs 2022-06-20 02:25:02 -06:00
Eric Wasylishen 4d30257907 testqbsp: fix test expectation for detail_illusionary_noclipfaces_intersecting 2022-06-20 02:23:06 -06:00
Eric Wasylishen b35233afa2 qbsp: fix assertion failure in qbspfeatures.map 2022-06-19 19:53:58 -06:00
Eric Wasylishen 5c5e6e1ea7 qbsp: fix brush_clipping_order 2022-06-19 17:32:18 -06:00
Eric Wasylishen 4f3ca8c252 qbsp: wip import MarkVisibleSides from qbsp3 2022-06-19 16:04:54 -06:00
Eric Wasylishen 59d6169b3d qbsp: add a test of just a cube 2022-06-19 16:04:54 -06:00
Eric Wasylishen 5fc6cbc95e qbsp: wip import MakeFaces from qbsp3 2022-06-19 16:04:54 -06: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 0a424ca79c testqbsp: add a markfaces test to simple_sealed 2022-06-18 16:26:28 -06:00
Eric Wasylishen 3492ef2b9e qbsp: fix invalid leaf bounds in MakeTreePortals_r 2022-06-18 16:13:00 -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 ea985eb5ac Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-18 17:29:13 -04:00
Jonathan a41c68886a first attempt at clustering leaffaces together 2022-06-18 17:07:36 -04:00
Eric Wasylishen 6fb3bf957a qbsp: detail seals in q2 test passes now 2022-06-18 13:48:30 -06:00
Eric Wasylishen b91973bae1 qbsp: remove old/unused portal code 2022-06-18 13:44:24 -06: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 158c65b056 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2022-06-18 12:53:53 -06:00
Jonathan 7eedf52bf4 sync up BaseWinding checking
add constructor to aabb to construct from range
2022-06-18 14:33:16 -04:00
Jonathan 6a310de784 sort brush result sets by file order for determinism 2022-06-18 13:54:07 -04:00
Eric Wasylishen b14aaff705 qbsp: switch over to CreateVisPortals_r 2022-06-18 11:46:51 -06:00
Eric Wasylishen 501ccda2d1 qbsp: don't attempt to parallelize portal generation 2022-06-18 11:46:40 -06:00
Eric Wasylishen 214a2550f4 qbsp: isolate portal_state_t in prtfile.cc 2022-06-18 00:32:40 -06:00
Eric Wasylishen 1fb5753f60 qbsp: import CreateVisPortals_r from qbsp3 2022-06-17 23:59:19 -06:00
Eric Wasylishen 65e6fafb3e qbsp: import MakeNodePortal, MakeTreePortals from qbsp3 2022-06-17 23:52:33 -06:00
Eric Wasylishen 7d3b5a9c3f qbsp: import SplitNodePortals from qbsp3 2022-06-17 22:34:36 -06:00
Eric Wasylishen af2dd987d8 qbsp: import BaseWindingForNode from qbsp3 2022-06-17 22:10:11 -06:00
Eric Wasylishen 3e2045479b qbsp: move .prt writing to prtfile.cc to align with qbsp3 2022-06-17 20:31:37 -06:00
Eric Wasylishen 9423e68e9f qbsp: fix _noclipfaces 2022-06-17 17:55:17 -06:00
Eric Wasylishen 2248b8cd73 testqbsp: add more portal assertions 2022-06-17 02:41:39 -06:00
Eric Wasylishen 00d9d403ea testqbsp: fix wrong winding constructor being chosen 2022-06-17 01:58:26 -06:00
Eric Wasylishen 259d95e47c testqbsp: add a first portal test 2022-06-17 01:53:08 -06:00
Eric Wasylishen da346a931a testqbsp: quick setup of code to run test suite against a reference q1 compiler 2022-06-17 00:59:18 -06:00
Eric Wasylishen 7ac4012f92 testqbsp: replace map.leakfile checks with checking .prt file existence 2022-06-16 23:33:55 -06:00
Eric Wasylishen 0edd52517a testqbsp: read .prt files back in 2022-06-16 23:22:15 -06:00
Eric Wasylishen f1823f30fa testqbsp: rename LoadTestmap -> LoadTestmapQ1 2022-06-16 23:05:00 -06:00