Commit Graph

703 Commits

Author SHA1 Message Date
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
Eric Wasylishen fe99d69d07 qvec: implement Google Test formatter 2021-10-11 12:55:06 -06:00
Eric Wasylishen feb57abbe2 qvec.hh: build fix
qvec3f is defined lower in the file
2021-10-11 12:19:39 -06:00
Jonathan 01b8abf93c Removed a lot of unused functions
Moved vector-related operations from mathlib to qvec, moved a few into qv::
Use clamp/max/min directly instead of #define'ing them
Move a few single-use functions directly above their usages
2021-10-10 14:04:09 -04:00
Jonathan a8d5125321 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2021-10-09 14:14:54 -04:00
Jonathan eb4bcf96dc -includeskip for Q2RTX
Fix missing fmt include
Default nexttexinfo to -1 to match other tools
Fmt support for bspversion_t, use that instead of a static function
Cleanup write functions
2021-10-09 14:14:49 -04:00
Eric Wasylishen 9dcef7839a common: remove dead code (mesh_t, octree) 2021-10-09 11:40:35 -06:00
Eric Wasylishen 76d0dae890 mathlib: GLM_InterpolateNormal: quick hack to fix build of testlight 2021-10-08 19:31:06 -06:00
Eric Wasylishen 5cf82ee023 qbsp: restore use of options.worldExtent
should fix minor precision differences in .prt files
2021-10-08 19:04:11 -06:00
Jonathan 1b1679fa22 normals are now a special tuple-ish type, so that we can calculate tangents and bitangents for Q2RTX if requested (currently it always does it, but we can fix that later)
always emit texinfo for q2 brush sides
2021-10-08 14:17:48 -04:00
Eric Wasylishen d40e79ae29 mathlib: revert Q_rint to match master
The one on master returns 0 ==Q_rint(-0)
whereas the std::rint returns -0 == Q_rint(-0)
2021-10-07 19:08:34 -06:00
Eric Wasylishen f6e9ba4eb2 qbsp: drop mapentity_t::epair_order and std::map for epairs
just store as a std::vector of pairs. Lookups aren't done much in qbsp
so linear search performance should be fine.

epair_order approach gets messy because we sometimes add epairs
2021-10-06 18:26:25 -06:00
Jonathan aa2a94e0a7 Uninitialized values aren't constexpr, changing these default constructors to inline 2021-10-06 03:43:30 -04:00
Jonathan 16d3bcc7c7 Revert "clang /macOS: un-constexpr things that were erroring"
This reverts commit 33745c3cb8.
Value-initialize v which removes the need for the bottom `if constexpr` expression.
2021-10-06 03:42:46 -04:00
Eric Wasylishen fd28067b5c fix gcc errors about reference to temporary 2021-10-05 23:28:33 -06:00
Eric Wasylishen c54fea1e87 qbsp: face_t: use a std::vector for edges
shared_ptr of C arrays is not working on macOS,
but std::vector is also more correct semantically
2021-10-05 23:15:43 -06:00
Eric Wasylishen 07b24cce79 qvec: fix mat * mat on clang/gcc 2021-10-05 23:12:02 -06:00
Jonathan cb9d90744f More constexpr 2021-10-05 23:49:15 -04:00
Jonathan 75bcccada1 Fix more unused value warnings
Fix operator >= and <= for tuple of arrays
2021-10-05 23:40:40 -04:00
Jonathan e72934de81 Hopefully resolve clang warnings here now
Fix iterator wrapper
Fix >= <= tuple<T&> operators
2021-10-05 23:24:05 -04:00
Jonathan ca0111ce5d Fix missing unordered_map
Maybe fix for tons of -Wunused-value
2021-10-05 23:00:13 -04:00
Jonathan a2edc09018 Resolve GCC wanting `template` before emplacements 2021-10-05 22:54:25 -04:00
Jonathan b4afc32e2b Fix winding_edges using old get() name
Another attempted fix at VA_ARGS
Fix missing typename prefix
2021-10-05 22:44:13 -04:00
Jonathan f4fc8bc72b Remove unused functions, fix math issues
MacOSX potential fix for __VA_ARGS__
2021-10-05 22:35:30 -04:00
Jonathan 37cb535f1a implement MSVC-style setp 2021-10-05 22:05:35 -04:00
Jonathan 81b7fbf916 Fix MSVC extension for setp
Fix PointsAlongLine
2021-10-05 21:38:04 -04:00
Jonathan 52839d4e7f Run clang-format pass 2021-10-05 15:54:06 -04:00
Jonathan 7590230111 Merge remote-tracking branch 'remotes/origin/qbsp-contentflags' into type-cleanup
# Conflicts:
#	bspinfo/bspinfo.cc
#	common/bspfile.cc
#	include/common/bspfile.hh
#	qbsp/brush.cc
#	qbsp/csg4.cc
#	qbsp/portals.cc
#	qbsp/qbsp.cc
#	qbsp/solidbsp.cc
#	qbsp/surfaces.cc
#	qbsp/writebsp.cc
#	vis/vis.cc
2021-10-05 01:21:16 -04:00
Jonathan 0833d84a7a Calculate tangents and bitangents (need to clean this up)
Implement formatters for qvec
Add -nolighting, which skips all non-lightstyled lights
2021-10-05 01:07:13 -04:00
Eric Wasylishen 5b62f61b29 qbsp: revert contents handling to be closer to master 2021-10-04 20:39:47 -06:00
Jonathan 037c587352 Merge remote-tracking branch 'remotes/origin/qbsp-contentflags' into type-cleanup
# Conflicts:
#	bspinfo/bspinfo.cc
#	include/common/bspfile.hh
#	include/light/light.hh
#	include/light/trace.hh
#	light/light.cc
#	light/ltface.cc
#	light/trace.cc
#	qbsp/brush.cc
#	qbsp/csg4.cc
#	qbsp/outside.cc
#	qbsp/qbsp.cc
2021-10-03 13:08:50 -04:00
Jonathan ae4512da2c BSPX structurization and cleanup
Some more vec3_t removals
A bunch of float -> vec_t in light
Simplified construction of lockables
mapdata_t writes directly to an mbsp instead of vector copies
2021-10-03 12:16:13 -04:00
Eric Wasylishen 2fc1e9099a light: remove dead / non-working code for non-embree light tracing 2021-10-02 21:12:12 -06:00
Jonathan 792951792c some more cleanup 2021-10-02 05:56:45 -04:00
Eric Wasylishen 59e71d7600 Merge branch 'master' into qbsp-contentflags 2021-10-01 23:39:12 -06:00
Eric Wasylishen ddf2a36d39 qbsp: make func_detail_wall an alias for func_detail_fence 2021-10-01 23:18:27 -06:00
Jonathan 9d828d2085 Structured texture data!
Move vis decompress/compress back to vis since phs is handled there now too
Fix missing textures in Q1BSP
Comment areaportaling for now
2021-09-30 11:33:04 -04:00
Jonathan 74bbce9eab First attempt at areaportals - sadly it seems like this method might not work with this compiler. 2021-09-28 13:17:27 -04:00
Jonathan 1a5dc9934f Remove span offset code - the compression ratio was not worth it
Allow Q2-esque maps to compile under Q1 modes
Use Q2tools-adapted version of AddBrushBevels for compiling brush sides
Extended limits overflow code displays member that overflowed now, for debugging
2021-09-28 02:10:01 -04:00
Jonathan cc932a96ee Fix BSP being invalid in Q2 if vis is not run
Fixes for skylight in Q2
Don't throw on invalid area
2021-09-27 22:40:43 -04:00