Commit Graph

742 Commits

Author SHA1 Message Date
Eric Wasylishen 4e94c7bab3 bspfile: fix UB reinterpret_cast causing ASan to complain on macOS 2022-01-15 22:40:03 -07:00
Eric Wasylishen f02bbca0c7 parser: fix reading past end of buffer 2022-01-15 18:31:35 -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 5c7a490fea qv::PolyArea: return 0 for degenerate polygons 2021-12-15 23:12:48 -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 d5497a675d polylib.hh: remove verts >= 3 assertion in from_face 2021-10-31 17:12:03 -06:00
Eric Wasylishen a937e3cdba qbsp: areaportal support 2021-10-27 22:51:43 -06:00
Jonathan 0e361f9323 Support for Q2BSP decompilation
- there's still a couple failure cases - specifically base1 in the outdoor area has a side that wasn't able to match to a face
- the clip brush at the start of base1 gets cut into a bunch of pieces because of the whole "check for texinfo, compare and split into multiple pieces" thing, but I'm pretty sure it's just one single brush - we need to ignore the splitting thing on clip brushes since they don't care about texture
- triggers don't pull in a temp texture
- origin brushes?
2021-10-27 17:56:56 -04:00
Jonathan c37ec80667 Implement game-agnostic Brush_GetContents 2021-10-26 09:13:48 -04:00
Jonathan 2bdfdc90cc Fix disjoint 2021-10-25 19:39:18 -04:00
Jonathan 3f27b11bf9 Fix qv::min/qv::max 2021-10-25 19:37:18 -04:00
Jonathan 1ccbe9e12c wrbrushes lump using streaming now
temp(?) fix for structural covered by detail
2021-10-25 19:24:07 -04:00
Jonathan e401136b4d Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-10-25 10:38:32 -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
Eric Wasylishen 02d3284045 bspfile: get rid of default implementations of contents_are_empty/solid/sky 2021-10-25 00:05:11 -06:00
Eric Wasylishen 71c5501ef0 qvec: revert plane3::operator- change.
not worth trying to maintain all of the inconsistent special cases of the old code.
2021-10-24 16:20:52 -06:00
Jonathan 90276d76dd Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-10-24 17:45:35 -04:00
Jonathan 38a4f66bef Move this to header since we may need it soon 2021-10-24 17:11:35 -04:00
Eric Wasylishen 72b39bc576 qplane3::operator-: implement "inverting" the normal as 0 - normal
to avoid introducing -0, for consistency with the old code, which tended to flip normals this way.
2021-10-24 14:47:02 -06:00
Jonathan 3456f62a90 Smaller equalExact (probably should just get rid of this tbh)
Fix for ClosestPointOnLine
2021-10-24 14:20:24 -04:00
Jonathan bfc854efcb base64 bmp images for texture debug
Fix qv::length
2021-10-24 13:55:27 -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 5f40d5a7ae Fix segfault 2021-10-24 05:09:47 -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
Jonathan 865fbb0745 VectorMA 2021-10-23 13:20:43 -04:00
Jonathan 4dca2d7d07 VectorInverse, VectorSet, VectorClear gone 2021-10-23 13:15:38 -04:00
Jonathan c607c0d98f Fix extraneous maybe_unused's
Fix qmat::row
2021-10-23 09:34:33 -04:00
Jonathan 74253fd189 Fixed Unix/Clang compilation
Adjusted makefile to work with both clang and msvc on win32
Removed "WIN32", use the standard _WIN32 instead
Fixed bad VectorCopy's
Use qvec4b instead of special color_rgba type
qvec now follows built-in type procedures for handling operators; this means that (qvec3i + qvec3f) will now properly produce a float, as one would expect, instead of adding the float to the integers without casting to the common type.
2021-10-23 07:35:41 -04:00
Jonathan a21be0362c replace VectorCompare, CrossProduct, DotProduct
qv::dot handles inputs a bit more gracefully now
plane::distance_to for distance checks, and dplane has the fast version
2021-10-21 23:25:19 -04:00
Jonathan cb3c81aaf8 vec3_t gonedy 2021-10-21 20:21:28 -04:00
Jonathan fdeb7d34f5 missing file 2021-10-21 20:05:17 -04:00
Jonathan 84b4388f4b Added a deprecation sniffer so I can find problematic areas later
Revert tjunc fixes
Add -notjunc to match other editors
Rid Light_Add since it's too simple
2021-10-20 04:27:22 -04:00
Jonathan 1bf6261826 constexpr/inline qv:: where appropriate
comment out rewrite test in bspinfo
updated tjunc code
2021-10-19 23:26:43 -04:00
Jonathan 95b47db922 More qmat/qvec where appropriate
Add a json.hh file which includes common JSON serialization types
surfflags_t::extended uses booleans instead of a bitflag for simplicity
JSON serialization for surfflags
2021-10-19 21:15:00 -04:00
Jonathan a7de4bdae2 Remove unused thingies
Use qplane3 where we can
2021-10-17 06:24:02 -04:00
Jonathan fd18fc154c Fix various warnings by testing a clang-cl compile 2021-10-12 14:39:15 -04:00
Jonathan c6393abdd9 Fix for qmat::qmat 2021-10-12 13:56:36 -04:00
Jonathan e974285fe7 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-10-12 13:52:53 -04:00
Jonathan e1290fd0f4 Snap normals/tangents/bitangents written from WriteNormals to save some bits
Texvec inherits mat<2, 4> now, since it's the most logical type for it to be based on.
2021-10-12 13:52:47 -04:00
Jonathan e6fd6b653e A few more vec3_t -> qvec
qmat follows other type conventions (T, N, M) and is annotated differently so it's not as confusing to follow
Removed qmat::operator[] - it's not clear from calling it that it's column-major (as evidenced by the comments needing to explicitly make clear at call sites that it's column, not row), so I've collapsed them into two separate functions that explicitly fetch either a column or a row. This also ties them nicely into qvec<N>.
2021-10-12 12:03:59 -04:00
Eric Wasylishen b68b370147 bspfile: replace 'abstract' with '= 0' (abstract seems to be a C++/CLI keyword?) 2021-10-11 23:22:19 -06:00
Eric Wasylishen c88274f806 qbsp: outside.cc: rewrite with outside -> in filling 2021-10-11 22:40:26 -06:00
Jonathan 6ec134a1f0 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-10-11 19:46:04 -04:00
Jonathan bd6bc0dc56 surfflags remap -> is_valid to match contentflags
warn on excessive key/value lengths, per-game
2021-10-11 19:45:55 -04:00
Eric Wasylishen a60581c99a qvec: fix undefined behaviour in PolyCentroid 2021-10-11 12:59:37 -06:00