Commit Graph

93 Commits

Author SHA1 Message Date
Eric Wasylishen 52fcb7a234 refactor: move Mod_Q1BSP_DecompressVis to bsputils.cc 2023-01-08 20:43:53 -07:00
Eric Wasylishen a2399ab48c tests: add dirt / object_channel_mask interaction test
was already working correctly
2023-01-08 19:59:19 -07:00
Eric Wasylishen ba155a3bf5 build: avoid msvc-only constructor 2022-12-20 23:51:56 -07:00
Eric Wasylishen f652af9c7d bsputils: add .lit loader 2022-12-20 22:46:20 -07:00
Jonathan 96e88cfab1 allow a .map to be updated with a .ent file as input using replace-entities 2022-11-25 04:51:00 -05:00
Eric Wasylishen 91a0c8e86a test_ltface.cc: add assertions to catch command line options leaking
across tests
2022-11-19 18:41:46 -07:00
Eric Wasylishen d7acd046c3 light/qbsp: add _surflight_rescale key 2022-11-12 17:07:02 -07:00
Eric Wasylishen 221ea65efb light: fix -world_units_per_luxel on sloped faces 2022-11-03 23:45:47 -06:00
Eric Wasylishen ca0efbf3d3 light: wip -world_units_per_luxel and DECOUPLED_LM BSPX lump 2022-11-03 02:39:15 -06:00
Eric Wasylishen eb2d697cef faceextents_t: refactor to store world <-> lm matrices rather than tex space <-> lm 2022-11-02 09:39:20 -06:00
Eric Wasylishen 1f01b65873 faceextents_t: rename texextents/texmins 2022-11-02 09:27:41 -06:00
Eric Wasylishen 02202b81bb faceextents_t: move texmins out of structure 2022-11-02 09:21:42 -06:00
Eric Wasylishen f3cc0907c8 faceextents_t: refactor to remove lightmapshift member 2022-11-02 00:56:23 -06:00
Eric Wasylishen 728fafde8c light: remove dead code 2022-10-30 18:00:48 -06:00
Eric Wasylishen 34f32f851c common, qbsp: more functions moved from header -> source 2022-10-26 23:29:54 -06:00
Eric Wasylishen 636b376577 squash brushbsp-compilation-speedup branch
move function implementations out of headers
2022-10-21 18:00:58 -06:00
Jonathan 4ecd945587 use kmq2 flag instead of 33 | 66, which no engine supports 2022-09-10 07:49:06 -04:00
Eric Wasylishen f5a8bc7b99 bsputils: add a helper struct for checking clipnode identity 2022-08-15 23:06:00 -06: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
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Eric Wasylishen 40bba01b21 qbsp: brushbsp.cc import from qbsp3 2022-07-03 01:22:09 -06:00
Jonathan dfa1282d40 simplify/c++-ize CompressRow code and related areas (less allocations overall) 2022-06-18 18:25:23 -04:00
Jonathan ac05a7ecf6 Revert "simplify/c++-ize CompressRow code and related areas (less allocations overall)"
This reverts commit 46aaa81ffd.
2022-06-18 17:29:07 -04:00
Jonathan 46aaa81ffd simplify/c++-ize CompressRow code and related areas (less allocations overall) 2022-06-17 12:06:37 -04:00
Jonathan 41ef66190f consistency rename; gtexinfo_t -> mtexinfo_t 2022-06-16 09:36:31 -04:00
Eric Wasylishen a309e8467b testmaps: add qbsp_q1_sealing.map 2022-06-14 00:44:50 -06:00
Eric Wasylishen 0f2ea5333d move CompressRow/DecompressRow from vis to common 2022-05-24 21:01:41 -06:00
Eric Wasylishen a1b8a38283 merge non-brush bsp specific changes from brushbsp branch 2022-05-11 01:58:53 -06:00
Jonathan cc0e1a5561 move Face_IsLightmapped to light
Fix q2rtx, needs to include lightstyle for nodraw for emissive invisibles with lightstyles
fix wal (for the 900th time)
auto-set -nolighting for -q2rtx
2022-04-30 23:27:21 -04: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 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 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 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 a7de4bdae2 Remove unused thingies
Use qplane3 where we can
2021-10-17 06:24:02 -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
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 52839d4e7f Run clang-format pass 2021-10-05 15:54:06 -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
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
Jonathan 792951792c some more cleanup 2021-10-02 05:56:45 -04: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 a6f6cc2d15 qvec now has an empty default initializer, for speed purposes; fixed up places that relied on this behavior
simplified constructor for qvec(T...) that uses fold expressions
simplified rgba_miptex_t
fixed a lot of broken winding_base_t behavior
merged all winding types into winding_base_t
removed now-empty files
2021-09-27 20:44:15 -04:00
Jonathan 87d31e6d4f A lot of type-y stuff here:
- bsp store vectors now
- vis stored in a way that is compatible with both Q2 and Q1
- binary reading of stuff, so swapping is done at load time now
- vis cleanup, although there's still a lot of raw long modification that should get simplified later
2021-09-25 23:58:02 -04:00
Jonathan 6ff2d67d12 major C++-esque change to BSP conversion:
- main mbsp types are declared first in the files, and types that were single-member are now not structs
- conversion is handled by the sub-types themselves. Currently no diagnostic for *what* members overflow, but, overflow is handled via thrown exceptions on all overflowable members
- aabb type is used where appropriate now, simplifying a few areas
2021-09-22 17:30:46 -04:00
Jonathan 326626f127 Remove some old stuff
Cleanup/rework of logging system. I'm not too happy about it still, but, it's at least a bit easier to follow now.
Started cleanup of file-related stuff.
2021-09-19 18:17:28 -04:00
Jonathan e8bd554cc0 winding_t is now a C++ type - a hybrid stack/heap array.
In preparation for converting all of the vec_t[3] to qvec's, the Vector routines are now templated and work with any type that provides indexing operators.
Polylib.cc is gone, since this all needs to be in header now
qvec can now implicitly convert from T[N]
constexpr where appropriate
static inline -> inline
side_t is now an enum, moved into mathlib
2021-09-16 03:10:51 -04:00
Jonathan 1dd4df1b20 calloc/malloc/free -> new/new/delete (except for specific scenarios) 2021-09-14 11:39:12 -04:00
Jonathan 4e7542b111 Clang format pass
typedef -> using
include guards -> pragma once
typedef struct x { } y; -> struct y { }
some fixes to extremely old code that shouldn't be required any more
2021-09-14 02:32:26 -04:00
Jonathan 00efa6e67d Fix operator<
Introduce gamedef, to reduce rewriting of data in bspversions
fix name of needs_subdivision
include value in texinfo, in prep for Q2
2021-09-07 01:41:32 -04:00