Commit Graph

821 Commits

Author SHA1 Message Date
Jonathan 11d2d51165 Revert "make brush::faces a vector"
This reverts commit 30c7ef94ac.

This was causing issues with bevel brushes in Q2 mode. Not sure why yet. Will attempt this again soonish.
2022-01-24 14:26:28 -05:00
Jonathan be865bc5b8 Fix `face_get_contents` not handling hintskip properly
Simplify `Brush_GetContents` and use the first non-skip face as the base contents
Move period out of `LoadExternalMap` error message so it doesn't confuse the reader
Fix `WriteEntitiesToString` crashing on entities without any brushes (note: need a column/line on mapentity in future)
2022-01-23 23:18:59 -05:00
Jonathan e92b9f1ff9 Fix miscalculation for has_struct
Remove unused variable
2022-01-23 21:48:24 -05:00
Jonathan 5d6d7a71a2 Fix missing includes for list 2022-01-23 19:28:50 -05:00
Jonathan 75339df231 Simplify surface_t by using lists 2022-01-23 19:00:01 -05:00
Jonathan 5f81657621 move calculatesurfaceinfo into a member func 2022-01-23 00:46:11 -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 5a2d522892 partial revert of 1dee7269d6 - restores old tool behavior w/r/g noclipfaces 2022-01-22 21:46:32 -05:00
Jonathan 6c20e49cc3 change the flow of `face_get_contents` a bit; move earlier code into this block
remove `Brush_IsDetail`, as it's legacy and not required any more
MIST is no longer automatically "CFLAGS_DETAIL_ILLUSIONARY"
MIST/AUX default to _mirrorinside 1 if it's not set, matching vanilla behavior
2022-01-22 21:26:57 -05:00
Eric Wasylishen edec33ad93 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into pr/322 2022-01-22 16:28:14 -07:00
Eric Wasylishen d340bd06a5 qbsp: RemapContentsForExport: fix for q2 structural faces completely covered by detail fence not rendering
at least in yquake2, (vanilla?). Remaps the detail fence to "window"
2022-01-22 16:28:08 -07:00
Jonathan 6895fea115 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-01-22 17:55:42 -05:00
Jonathan 8dbb18cc94 Use stem() instead of filename() when we're only wanting to change filename without extension 2022-01-22 17:55:37 -05:00
Eric Wasylishen c31edc6599 qbsp: FindMiptex: fix empty optional access when a .wal couldn't be found 2022-01-22 15:32:14 -07:00
Jonathan 07dd73e5bc Persist native contents when converting them to detail
Simplify hull areas
Q2's `face_get_contents` generated empty surfaces when SKIP was used. It now has another line of defense to ensure contents aren't set to empty, but I'm not sure where the other line of defense went that was supposed to do this.
Remove old comment
2022-01-22 17:23:51 -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 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 02a4463d00 include <list> 2022-01-17 16:24:29 -05:00
Jonathan b824acb376 Reverse ordering of faces to match old code
Fix missing max(1) on leaf/cluster counts
2022-01-17 16:09:10 -05:00
Jonathan 63b8608799 Remove unused functions & tests
Fix test harness
2022-01-17 14:35:18 -05:00
Jonathan 53b4f640e2 use vector<brush_t> directly now 2022-01-17 11:06:13 -05:00
Jonathan 1a0b8c724a use vector of unique_ptrs for brushes; temporary, going to simplify it further 2022-01-17 10:42:24 -05:00
Jonathan 30c7ef94ac make brush::faces a vector 2022-01-17 09:49:10 -05:00
Jonathan 60070e27b2 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-01-17 09:16:27 -05:00
Eric Wasylishen b681690807 qbsp: fix some memory leaks 2022-01-16 12:47:19 -07: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
Eric Wasylishen e6e232d43e qbsp: fix delete/delete[] mismatch 2022-01-15 23:26:59 -07:00
Eric Wasylishen 2ebcdc9fde qbsp: fix memory leak identified by LeakSanitizer 2022-01-15 23:01:55 -07:00
Eric Wasylishen 07e7179c74 fix build 2022-01-15 18:51:33 -07:00
Eric Wasylishen f02bbca0c7 parser: fix reading past end of buffer 2022-01-15 18:31:35 -07:00
Eric Wasylishen 0dd7a73cc1 qbsp: flip brush clipping order to match original qbsp
Patch from Paril
2022-01-15 14:35:02 -07:00
Jonathan 3d9277b711 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-12-20 14:51:20 -05:00
Jonathan e2d64e0e5d FS simplification
Fix transparency calculation (33% is 33% opacity, not 33% transparency)
2021-12-20 14:51:14 -05:00
Eric Wasylishen d6a17d022c qbsp: CreateBrushFaces: fix accessing empty winding in `w->clip(...)` expression 2021-12-15 22:43:21 -07:00
Jonathan 0c827208ec Allow `-subdivide 0` to turn off subdivision
imglib now lives in common
fs 'load' split into two functions, where and load. the former allows you to query for and return archive & path for a given file, whereas the latter handles that for you.
use log verbose in light rather than own verbose flag
2021-11-21 15:08:02 -05:00
Jonathan 8cadf06d81 New FS!
First FS test: use it for decompile for Q2 to prevent unnecessary suffixes
2021-11-05 19:25:37 -04:00
Eric Wasylishen a937e3cdba qbsp: areaportal support 2021-10-27 22:51:43 -06:00
Jonathan c37ec80667 Implement game-agnostic Brush_GetContents 2021-10-26 09:13:48 -04:00
Eric Wasylishen 6856789eef bspfile.cc: move "can't see through solid" to the top of portal_can_see_through
fixes LoadPortals: out of bounds leaf in portal 68 issue
2021-10-25 20:24:21 -06:00
Jonathan 1ccbe9e12c wrbrushes lump using streaming now
temp(?) fix for structural covered by detail
2021-10-25 19:24:07 -04:00
Jonathan 550cacef3f Clean warnings 2021-10-25 13:46:04 -04:00
Jonathan e0ed70cc87 no more Vector! 2021-10-25 10:38:15 -04:00
Jonathan e1695ebfd3 VectorAdd & simplify TexDef_BSPToBrushPrimitives (needs testing) 2021-10-25 08:39:29 -04:00
Jonathan a5f8ecd471 VectorSubtract 2021-10-24 23:26:20 -04:00
Jonathan 11c3511605 new normal calculation cherry-picked from branch
Fix entdata not having its '\0'
don't write unnecessary extended texinfo
2021-10-24 15:21:26 -04:00
Jonathan d0e557b9cb Fix BSPX on q2bsp
Fix normalize generating NaNs to match old behavior of generating zero on zero length
Remove extended texinfo file before potentially not writing new one
2021-10-24 06:56:31 -04:00
Jonathan 3c2ca93b0c normalizeInPlace no longer nodiscard since you might want to only normalize the ref
remove VectorNormalize
2021-10-23 13:34:12 -04:00
Jonathan fae69309a0 VectorLength 2021-10-23 13:24:25 -04:00
Jonathan 7c661a3759 distance-squared 2021-10-23 13:22:32 -04:00