Commit Graph

1141 Commits

Author SHA1 Message Date
Eric Wasylishen 81e0da4d62 qbsp: mark invisible sides on brush entities
fixes brush_clipping_order test failure
2022-05-01 00:01:11 -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 1b852e3a20 fix WINDOW issue
surflight_subdivide minimum 1.0, to allow for people breaking their computers
2022-04-30 22:26:08 -04:00
Eric Wasylishen 5b4a9956c6 qbsp: add -debugchop 2022-04-30 15:10:19 -06:00
Eric Wasylishen cb2268efdf qbsp: initial ChopBrushes implementation 2022-04-30 14:33:26 -06:00
Eric Wasylishen 029e95dc3b qbsp: add PruneNodes 2022-04-28 00:49:26 -06:00
Eric Wasylishen fb59c2e950 bspfile.hh: q1 contents from #defines to constexpr
now prints properly in GTest assertions
2022-04-28 00:47:34 -06:00
Eric Wasylishen 8efb6f689b qbsp: add -outsidedebug flag 2022-04-27 19:18:27 -06:00
Eric Wasylishen 10fbfff20d qbsp: liquids are higher priority than detail_illsuionary 2022-04-27 01:26:56 -06:00
Eric Wasylishen 90e064e9e1 testqbsp: attempt to add a q2 test case (not working yet) 2022-04-26 23:45:44 -06:00
Eric Wasylishen d5320d5aaa qbsp: subdivide faces after merging 2022-04-26 21:41:03 -06:00
Eric Wasylishen df9d530c21 qbsp: fix weird calling convention of SubdivideFace 2022-04-26 21:32:24 -06:00
Eric Wasylishen d2c7412a44 testqbsp: proper test for detail_doesnt_remove_world_nodes 2022-04-26 19:08:44 -06:00
Eric Wasylishen 8731dcb469 bspfile.hh: remove covered_native 2022-04-26 01:23:36 -06:00
Eric Wasylishen f9aa40a50f qbsp: fix outside filling in maps with detail 2022-04-26 00:25:52 -06:00
Eric Wasylishen 1a0b4c0733 qbsp: more covered_native stuff to remove 2022-04-25 22:01:10 -06:00
Eric Wasylishen 9977c14a2f bspfile: add gamedef_t::contents_seals_map() 2022-04-25 18:40:55 -06:00
Eric Wasylishen 064147b908 qbsp: move PortalizeWorld() to portals.hh 2022-04-24 01:07:20 -06:00
Eric Wasylishen 133ee77fc5 testqbsp: fix textures not loading in tests 2022-04-20 01:31:26 -06:00
Eric Wasylishen aa3174d732 testqbsp: initialize filesystem the same as a regular qbsp run 2022-04-20 01:25:29 -06:00
Eric Wasylishen 78210947ff qbsp: add -keepprt option 2022-04-19 01:03:18 -06:00
Eric Wasylishen 28c9cda561 Merge remote-tracking branch 'Paril/type-cleanup' into brushbsp 2022-04-17 13:46:50 -06:00
Eric Wasylishen 20a1b7b94b qbsp: szBSPName -> bsp_path, szMapName -> map_path 2022-04-17 13:41:23 -06:00
Jonathan 91310ef6b8 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-04-16 22:20:35 -04:00
Jonathan 0b41f0a03b notriggermodels support 2022-04-16 22:20:29 -04:00
Jonathan 6080e7fc5d a bit of q2rtx stuff 2022-04-16 10:28:46 -04:00
Eric Wasylishen f467257f72 qbsp: start test case for qbsp_simple_sealed2.map 2022-04-15 21:05:14 -06:00
Eric Wasylishen 8a71b372bd qbsp: remove unnecessary num*() helpers from mapdata_t 2022-04-15 00:27:50 -06:00
Eric Wasylishen 5df0dde756 map.cc: move rgfStartSpots to map struct 2022-04-11 17:49:49 -06:00
Eric Wasylishen 9d2f00a1b2 qbsp: tidying: move pWorldEnt() to mapdata_t 2022-04-11 00:13:42 -06:00
Eric Wasylishen b7fbb48763 qbsp: enable new outside filling 2022-04-10 00:00:28 -06:00
Eric Wasylishen a3d54cf48d qbsp: remove unused face_t::original 2022-04-09 23:40:35 -06:00
Eric Wasylishen 407b39cad1 qbsp.hh: remove writebsp.hh and outside.hh includes 2022-04-09 23:30:42 -06:00
Eric Wasylishen b736704e5e qbsp.hh: remove portals.hh include 2022-04-09 23:28:12 -06:00
Eric Wasylishen 95824d26e4 qbsp.hh: remove surfaces.hh include 2022-04-09 23:25:54 -06:00
Eric Wasylishen ca589906d8 qbsp.hh: remove merge.hh include 2022-04-09 23:25:01 -06:00
Eric Wasylishen 2e14909e84 qbsp.hh: remove map.hh include 2022-04-09 23:23:26 -06:00
Eric Wasylishen f71ae3658e qbsp.hh: remove solidbsp.hh include 2022-04-09 23:19:34 -06:00
Eric Wasylishen 147a76c11b qbsp.hh: remove csg4.hh include 2022-04-09 23:17:43 -06:00
Eric Wasylishen 9295181f84 qbsp.hh: remove brush.hh include 2022-04-09 23:15:21 -06:00
Eric Wasylishen 39d1930446 outside.cc: prototype marking visible brush sides 2022-04-09 21:46:01 -06:00
Eric Wasylishen edad06cc5a qbsp: planning outside filling approach, wip 2022-04-05 19:46:59 -06:00
Eric Wasylishen 449b76db70 qbsp: remove unused region.hh header 2022-04-05 19:46:59 -06:00
Eric Wasylishen 24ca07188c log: use ANSI colors for strings containing "warning" or "error" 2022-04-03 14:16:22 -06:00
Eric Wasylishen a0fbfdbad5 log: use ANSI colors for strings containing "warning" or "error" 2022-04-03 12:56:11 -06:00
Eric Wasylishen a019088c2f Merge branch 'type-cleanup' into brushbsp 2022-04-02 21:05:46 -06:00
Jonathan f5cda68416 clean up percent stuff
comment out "didn't split" message
fix winding resize
merge phong loops together
2022-03-07 14:49:50 -05: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 a479a5ddfb use case-insensitive natsort for discoverArchives
add two other logging control bools, which -quiet now redirect to
add -lowpriority for CPU priority (on Windows)
2022-02-28 09:20:35 -05:00
Jonathan 6baea3bc03 Fix three bugs that slipped by for cmdargs
Remove old threading code, use tbb internally
2022-02-27 04:09:28 -05:00
Jonathan df92d9ce12
Command line args systems (#2)
* cmd

* cmake change for tbb DLLs
add in test for double-hyphens

* cmd

* game version

* settings!

* bsp texture usage
decompile fix for q1bsp

* finish up the options for qbsp

* light finished?

* finish up the few missing bits

* move scalar/int32 up

* Run clang-format pass

* natvis for our mathlib
use slightly faster storage for winding
fix light tests

* allow dictionary to be a base type

* re-run style

* Remove cfg_static
Fix options summary

* natvis for lockable_value<T>

* last-ish pass?

* format

* forgot last few lockables
2022-02-27 00:01:57 -05:00
Eric Wasylishen 658d807052 qbsp: finish re-adding CSG code 2022-02-21 12:35:27 -07:00
Eric Wasylishen b04a6e9a30 qbsp: csg: re-add checking of map file order 2022-02-21 12:00:26 -07:00
Eric Wasylishen 3b348af301 qbsp: wip mirroring faces 2022-02-21 00:47:57 -07:00
Eric Wasylishen 91f7d9adaa qbsp: remove surface_t 2022-02-21 00:05:48 -07:00
Eric Wasylishen 70ea752587 qbsp: restore MergeAll 2022-02-20 23:57:42 -07:00
Eric Wasylishen cb464031da qbsp: track original brushes, populate q2 leafbrushes accurately 2022-02-20 16:10:44 -07:00
Eric Wasylishen 8c84871129 qbsp: wip: add CSG-ing back in 2022-02-20 01:19:55 -07:00
xDShot 5780ce4bd6
Include some headers for brushbsp branch files (#325)
* include <vector> for std::vector definition

* include <algorithm> for std::clamp definition
2022-02-19 11:17:20 -07:00
Eric Wasylishen 2a257693c6 Merge branch 'type-cleanup' into brushbsp 2022-02-17 00:43:08 -07:00
Jonathan b0ece93f83 Fix/implement animated textures for Q2 2022-02-16 19:23:19 -05:00
Eric Wasylishen 055f865ef0 qbsp: add very rough pass of building visible faces
- faces are subdivided where neeed
- markfaces not calculated accurately
- overlaps/clipping not handled
2022-02-13 19:51:59 -07:00
Eric Wasylishen 1fbfd199c5 qbsp: wip port of BrushBSP from Q2 tools
currently can compile qbsp_simple.map (2 brushes)
no faces, but generates leafs/nodes which seem OK
2022-02-13 12:03:27 -07:00
Eric Wasylishen dc10d90c36 add missing <list> include 2022-02-07 00:35:27 -07:00
Eric Wasylishen 6b5b426636 qbsp: remove internal list in face_t 2022-02-07 00:02:51 -07:00
Jonathan ed325eedea surface faces now use list/vector 2022-02-06 11:39:22 -07:00
Eric Wasylishen 8531286777 qbsp: replace `-nothreads` with `-threads 1` for consistency with light/vis 2022-01-30 17:50:21 -07:00
Jonathan 15484b55f8 Use better tjunction vertex addition
Parallel MergeAll
Allow modifyable iterators from polylib; resizing may invalidate them however
2022-01-28 09:45:29 -05:00
Jonathan d076920665 Revert "Instead of calculating brush extents globally, do it per brush creation"
This reverts commit 069720078f.
2022-01-27 01:52:08 -05:00
Jonathan 069720078f Instead of calculating brush extents globally, do it per brush creation
Use portal node bounds for extents
2022-01-27 01:03:38 -05:00
Jonathan 3f37de95a5 Fix tests 2022-01-26 18:15:53 -05:00
Jonathan 93505a88b2 Merge branch 'type-cleanup' of https://github.com/Paril/ericw-tools into type-cleanup 2022-01-26 18:03:36 -05:00
Jonathan 571e7337fc Fix the temporary hintskip detection and finally move it to gamedef
Dynamic extent calculation - turned on by default - will automatically determine the extents used for winding_from_plane beforehand. On a 50kb .map file it only takes about 10ms, so for the majority of maps it should be instantaneous.
2022-01-26 18:03:31 -05:00
Eric Wasylishen 19dbc1c1c8 polylib: fix compile error with clang 2022-01-25 19:55:07 -07:00
Jonathan 0414c77c19 Use copies rather than moving for conversion, so that graceful upgrades are graceful again 2022-01-25 04:49:20 -05:00
Jonathan ff2ff5c87f fix emplace UB 2022-01-25 04:21:07 -05:00
Jonathan f9f76b6dbb skip the flips - saves us a bit of time! 2022-01-25 04:18:52 -05:00
Jonathan 674be0c812 Fix a few messages (missing newlines, period in wrong place)
Use fragments to store TJunction bits instead of having them in separate-but-chained faces
2022-01-25 03:23:39 -05:00
Jonathan dfd31d7441 make markfaces a vector to simplify usage 2022-01-25 00:13:12 -05:00
Jonathan 1764afb475 Revert "Revert "make brush::faces a vector""
This reverts commit 11d2d51165.

Fixes implementation - was swapped logic in brush bevels
2022-01-24 14:55:21 -05:00
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 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 c9f2502118 Fix swap 2022-01-20 19:50:05 -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 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 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
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
Jonathan b205127e81 Fix exactEmpty
Simplify output_dir
2021-09-27 21:03:24 -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
Eric Wasylishen 8ff65cc05a bspinfo: JSON export of BSPX BRUSHLIST lump 2021-09-25 16:54:14 -06:00
Eric Wasylishen f1744118e2 qbsp: move BSPX BRUSHLIST struct types out to bspfile.hh 2021-09-25 15:42:42 -06:00
Eric Wasylishen f7c0c80a26 qbsp, light: allow _minlight to go up to 510 instead of 255 on func_detail/etc. 2021-09-25 13:11:15 -06:00
Jonathan 41b9a79e83 Merge branch 'qbsp-contentflags' into type-cleanup
# Conflicts:
#	bsputil/bsputil.cc
#	common/bspfile.cc
#	common/cmdlib.cc
#	include/common/bspfile.hh
#	include/common/cmdlib.hh
#	qbsp/brush.cc
#	qbsp/portals.cc
#	qbsp/writebsp.cc
#	vis/vis.cc
2021-09-23 18:42:25 -04:00
Jonathan ed37289290 Store extended limits format in bspversion 2021-09-23 14:42:56 -04:00
Eric Wasylishen 4c5d8b99f9 add missing <tuple> include (for std::tie) 2021-09-22 22:32:37 -06: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
Eric Wasylishen 80a4aa1b97 Merge branch 'master' into qbsp-contentflags 2021-09-22 00:12:27 -06:00
Jonathan 2ebfdb096f Remove COM_Parse, use parser_t
Game controls hull sizes now
2021-09-20 19:45:09 -04:00
Jonathan 9f1f575761 Parser simplification and classification
Hulls stored in game definitions
2021-09-20 16:24:38 -04:00
Jonathan 49fd62b9f3 Lotta more file stuff. Have to think about fscanf though. 2021-09-19 22:20:39 -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 17606fde4b Use variant instead of having all BSP types allocated at once (even though they are smol)
Move ownership of pointers to the bsp structures themselves for now.
2021-09-16 11:52:37 -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 db5ccb6a93 warnerr fix 2021-09-14 09:25:18 -04:00
Jonathan eb6bb81d61 use the C++ includes
stdbool not required
_vsnprintf and _snprintf are standard in MSVC since 2015, so I just use them directly now. They'll be replaced by std::fmt later anyways.
use <thread> for threading, instead of pthreads/windows.h thread directly
2021-09-14 08:46:03 -04:00
Jonathan 7f8d2cfb49 Fix single line functions 2021-09-14 02:56:44 -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 05e20a3360 astyle project; not using yet 2021-09-13 14:14:33 -04:00
Jonathan facf3490c7 typedef changes 2021-09-13 13:04:18 -04:00
Eric Wasylishen d2ea0cee41 Merge remote-tracking branch 'origin/master' into qbsp-use-common 2021-09-12 23:04:42 -06:00
Jonathan c95a1e2ccb q2 and bug fixes
# Conflicts:
#	include/qbsp/qbsp.hh
#	include/qbsp/winding.hh
#	qbsp/brush.cc
#	qbsp/csg4.cc
#	qbsp/merge.cc
2021-09-12 08:34:01 -04:00
Jonathan 8cdb9ff6c4 Initial attempt at leafbrushes 2021-09-09 05:11:47 -04:00
Jonathan 9800f4f738 Mostly all native!! 2021-09-09 00:26:17 -04:00
Ozkan Sezer 69cb6b981f
bsputil: write ents in binary mode and print its crc in 4-digit hex (#317) 2021-09-08 17:50:32 -06:00
Jonathan 004fcb57c1 Content flags type, splitting up native and compiler flags.
Extreme WIP and likely not working properly. Need to rid all direct .native usages and direct them through target_version->game
2021-09-07 06:13:17 -04:00
Jonathan c16bbf403d Change miptex thingies to handle const as the comment wishes they would
Use optional to properly indicate the intended purpose of optional/"unset" values rather than a magic number (also because for some reason outputnum was stuck at 0 even though it defaults to -1 and I didn't want to debug why)
beginning of Q2 contents
2021-09-07 03:24:16 -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
Jonathan acc65953ce Use tie for mtexinfo too 2021-09-06 22:15:59 -04:00
Jonathan 398b865c96 throw array in there too 2021-09-06 22:13:45 -04:00
Jonathan 9602772450 Use tie for operator</> of surfflags_t 2021-09-06 22:12:57 -04:00
Jonathan 437459a4dd Finish using game everywhere 2021-09-06 18:09:13 -04:00
Jonathan 01d1400971 Merge branch 'qbsp-use-common' of https://github.com/ericwa/ericw-tools into qbsp-use-common
# Conflicts:
#	common/bspfile.cc
#	qbsp/writebsp.cc
2021-09-06 17:27:42 -04:00
Jonathan 3bc9b1b0f8 Instead of directly comparing BSP version pointers just for game type, I compacted quake2/hexen2 into a single enum.
Feature check in bspver for colored lightmaps, which replaces the many "version == q2 || version == qbism || version == hl".
2021-09-06 17:13:37 -04:00
Eric Wasylishen 648ef89845 qbsp: naming fix 2021-09-06 13:44:36 -06:00
Jonathan 8fd1d89b8d Fix double-delete
Fix typo
2021-09-05 17:39:17 -04:00
Jonathan dad0e61f63 Fix for texinfo/miptex searching routines
surf flags now use the "native + extended" format that will eventually be used for brush contents. Q1 output seems identical, haven't tested Q2 yet.
2021-09-05 16:56:29 -04:00
Eric Wasylishen f978d2a8d5 common: start adding overflow checks to ConvertBSPFormat 2021-09-05 00:44:25 -06:00
Jonathan 04ad8e2962 OOP wad file stuff 2021-09-04 23:23:03 -04:00
Jonathan 3b656e6ef1 Cleanup & preserve texture name for q2bsp 2021-09-04 22:15:04 -04:00
Jonathan b01fddf7f1 More Q2 support 2021-09-04 18:49:01 -04:00
Eric Wasylishen 54799a11fc qbsp: restore bspx brushes writing 2021-09-04 11:47:33 -06:00
Eric Wasylishen 047bc1299a qbsp: fix tests 2021-09-01 01:19:24 -06:00
Eric Wasylishen 54d9e08033 qbsp: handle target bsp version 2021-09-01 00:42:30 -06:00
Eric Wasylishen 3cbf54749e qbsp: fix -onlyents 2021-08-31 23:53:40 -06:00
Eric Wasylishen 2e09ad509b Merge remote-tracking branch 'origin/master' into qbsp-use-common 2021-08-31 22:40:51 -06:00
Jonathan 90973e1198
Q2bsp VIS support (#315)
* Add QBSP - the BSP2-esque variant to Q2BSP - to bspinfo, and all of its accompanying structures.

* pass around ident, since Q2 needs it - admittedly it's a bit ugly, but it works for now.
conversion for QBSP

* Fix light

* _qbsp_ -> _qbism_

* Introduced bspversion_t, a struct that holds pertinent information about different BSP versions and also acts as a tagged pointer type for direct comparisons. This makes a lot of code paths simpler. I'm not entirely set on the wordings or usages yet, and maybe we can stuff boolean flags inside of them for different behaviors (for instance Q2, QBism and HL would have the "colored lightmap" boolean set to true, which replaces the check-for-all-three in the lightmapper)
Swapped arguments to ConvertBSPFormat to have the conversion target last instead of first
Finished rename of qbsp -> qbism
Tested:
 - bspinfo on various BSPs I had laying around (Q1, Q2, Qbism)
 - bsputil converting between Q2 and Qbism, and that they loaded in engine/roundtripped properly
Not tested:
 - vis/rad on anything major (I still can't run rad due to embree being weird)
 - bsputil conversion of Q1-esque maps

* Q2 VIS
Almost working, just in-game is not 100% functional

* PHS! Q2 VIS!

* Fix missing loadversion assignment
Fix missing \n

* Implement q2bsp -> mbsp visdata copy
fix sky lighting to use arghrad compat
2021-08-31 22:38:12 -06:00
Eric Wasylishen a75ad998e7 common: clean up Hexen II handling 2021-08-30 01:05:18 -06:00
Eric Wasylishen 5429655ce8 qbsp: move internal content types to bspfile.hh 2021-08-26 22:30:56 -06:00
Eric Wasylishen bafea15753 Merge branch 'master' into qbsp-use-common 2021-08-26 21:14:49 -06:00
Eric Wasylishen 8beda9a039 common, qbsp: make Error() noreturn 2021-08-26 20:22:45 -06:00
Eric Wasylishen 8a1bc3ef20 qbsp: refactor clipnode writing (changes .bsp output)
- drop reshuffling feature from ExportClipNodes
  As far as I can tell, the only purpose of this was to keep clipnodes
  for a given model contiguous within the lump (i.e. keep the different
  hulls contiguous).

  Vanilla qbsp didn't appear to have done this, and the code was
  unmaintainable/complex, so I'm dropping the feature.
2021-08-26 20:22:39 -06:00
Eric Wasylishen 899b2b8384 qbsp: drop MemSize stuff 2021-08-24 22:51:44 -06:00
Eric Wasylishen 208a9610ad qbsp: delete bspfile.cc/hh 2021-08-24 22:23:24 -06:00
Eric Wasylishen 50a16fa2bf qbsp: use common to write bsp
NOTE: produces almost binary-identical e1m1.bsp as last commit, the only
difference is due to the old QBSP using ascii space as a padding byte,
and common using \0
2021-08-24 01:29:21 -06:00
Eric Wasylishen 890db18171 qbsp: use common's bspfile.hh 2021-08-24 00:31:16 -06:00
Eric Wasylishen 00cdc2924a qbsp: fix name conflict with miptex_t (qbsp used it as a std::string alias) 2021-08-24 00:25:10 -06:00
Eric Wasylishen 09d7b6e73f common: transfer comments from qbsp's bspfile.hh 2021-08-24 00:17:47 -06:00
Eric Wasylishen e0710859fb qbsp: remove mapentity_t::lumps 2021-08-23 23:25:31 -06:00
Eric Wasylishen c55112b47f qbsp: refactor lmshifts lump export 2021-08-23 23:18:43 -06:00
Eric Wasylishen 490e71bb1a qbsp: remove cTotal 2021-08-23 22:50:03 -06:00
Eric Wasylishen a7fd04af12 qbsp: refactor texdata writing 2021-08-23 22:44:22 -06:00
Eric Wasylishen 6a7e59026c qbsp: refactor entities lump writing 2021-08-23 22:20:08 -06:00
Eric Wasylishen 561ffffb9b qbsp: refactor model writing 2021-08-23 21:01:49 -06:00
Eric Wasylishen f59bc08db8 qbsp: refactor face writing 2021-08-23 20:16:40 -06:00
Eric Wasylishen a0bdbf89d1 qbsp: refactor surfedges writing 2021-08-23 19:52:46 -06:00
Eric Wasylishen 8147b97dc6 qbsp: refactor vertexes writing 2021-08-23 19:45:31 -06:00
Eric Wasylishen f4700f978d qbsp: refactor edges writing 2021-08-23 19:36:41 -06:00
Eric Wasylishen 671bacf30c qbsp: refactor clipnode writing (changes .bsp output)
- drop reshuffling feature from ExportClipNodes
  As far as I can tell, the only purpose of this was to keep clipnodes
  for a given model contiguous within the lump (i.e. keep the different
  hulls contiguous).

  Vanilla qbsp didn't appear to have done this, and the code was
  unmaintainable/complex, so I'm dropping the feature.
2021-08-23 18:05:37 -06:00
Eric Wasylishen 382a725f2b qbsp: refactor writing of leafs, nodes, marksurfaces lump
- only support bsp29 for now
2021-08-23 18:02:05 -06:00
Eric Wasylishen 24fc2ffc6a qbsp: refactor plane lump writing 2021-08-23 18:02:05 -06:00
Eric Wasylishen 460428d099 qbsp: refactor texinfo lump writing 2021-08-23 18:02:05 -06:00
Jonathan eaa86c71c6
Q2BSP + QBSP (#313)
* Add QBSP - the BSP2-esque variant to Q2BSP - to bspinfo, and all of its accompanying structures.

* pass around ident, since Q2 needs it - admittedly it's a bit ugly, but it works for now.
conversion for QBSP

* Fix light

* _qbsp_ -> _qbism_

* Introduced bspversion_t, a struct that holds pertinent information about different BSP versions and also acts as a tagged pointer type for direct comparisons. This makes a lot of code paths simpler. I'm not entirely set on the wordings or usages yet, and maybe we can stuff boolean flags inside of them for different behaviors (for instance Q2, QBism and HL would have the "colored lightmap" boolean set to true, which replaces the check-for-all-three in the lightmapper)
Swapped arguments to ConvertBSPFormat to have the conversion target last instead of first
Finished rename of qbsp -> qbism
Tested:
 - bspinfo on various BSPs I had laying around (Q1, Q2, Qbism)
 - bsputil converting between Q2 and Qbism, and that they loaded in engine/roundtripped properly
Not tested:
 - vis/rad on anything major (I still can't run rad due to embree being weird)
 - bsputil conversion of Q1-esque maps
2021-08-23 09:56:33 -06:00
Eric Wasylishen ff7f8a1542 qbsp: add -nothreads debug option 2021-08-23 00:12:38 -06:00
Eric Wasylishen 29652b4a7a qbsp: fix some threading issues with solidbsp.cc stats 2021-08-23 00:00:01 -06:00
Eric Wasylishen a618e5f5b5 common: assert(0) on Q_assert failure for better debugger experience 2021-08-22 23:27:05 -06:00
Eric Wasylishen f7256907d5 common: fix build of bsputils.cc with double == vec_t 2021-08-22 15:12:19 -06:00
Eric Wasylishen d6c888bee9 vis add -nostate debug option, skips loading from state file 2021-08-15 13:22:57 -06:00
Eric Wasylishen 72885addf1 common: fix build failure 2021-03-23 21:17:09 -06:00
Eric Wasylishen fea7849315 common: preserve order of key/value pairs 2021-02-10 00:05:53 -07:00
Eric Wasylishen b5fcdec19e cleanup: remove "byte" typedef 2021-02-07 14:02:35 -07:00
Eric Wasylishen cc116a4729 decompile: restore coplanar faces 2021-02-06 16:19:15 -07:00
Eric Wasylishen 86a644680a qvec: add constructor to extend a vector 2021-02-06 14:11:01 -07:00
Eric Wasylishen f0e2f4ba96 common: small tweaks: CopyWinding accepts null, document face side 2021-02-05 22:26:13 -07:00
Eric Wasylishen 708d3eccd3 qvec: add unary minus 2021-02-04 22:00:55 -07:00
Eric Wasylishen 0cdd2f97ab common: revert Face_Miptex change, it was breaking reading of
Q1 texture names. TODO: fix this properly?
2021-01-31 01:27:01 -07:00
Eric Wasylishen 9124653156 common: move EntData_ function to common 2021-01-30 21:11:25 -07:00
Eric Wasylishen d4aa42f0ab bsputil: decompiler wip 2021-01-30 14:49:18 -07:00
Eric Wasylishen 94c30afac4 light: refactoring necessary to support embree3 2021-01-01 23:48:22 -07:00
Eric Wasylishen 00e41688c3 light: quake2: arghrad-compatible phong support
(set face "value" to the same non-zero number, have light flag unset)
2020-12-31 12:39:17 -07:00
Eric Wasylishen 2d15d20410 light: q2: avoid black seams on geometry near sky 2020-12-29 15:58:40 -07:00
Eric Wasylishen eb842ba165 light: arghrad compat: preliminary sky_surface implementation 2020-12-29 13:43:06 -07:00
Eric Wasylishen bb4d6fdea9 light: add arghrad compatible sunlight keys sun_light, sun_color, sun_angle 2020-12-29 12:59:44 -07:00
Julian Priestley 1b714108cd
Add ability to set phong in worldspawn #267 (#305) 2020-11-30 00:42:42 -07:00
tk 19f8ac8110
Add -visdist param from bjptools (#300)
* Add support for -visdist param from bjp tools

* add mention to man

Co-authored-by: Shpuld Shpuldson <shp@cock.li>
2020-09-18 19:11:38 -06:00
Eric Wasylishen b35cb8eb7e light: fixes for bjptools skip faces (which have no associated model) 2020-08-20 12:08:46 -06:00
Eric Wasylishen a0e7f1eccb light: refactor last commit's std::pair to a custom struct 2020-08-04 18:05:54 -06:00
Eric Wasylishen 1b53d458f4 light: support bounce and switchable shadows
fixes #251
2020-08-03 23:53:07 -06:00
Eric Wasylishen 03ed0697a4 light: add -litonly option for re-lighting a bsp without modifying it 2020-08-03 00:40:13 -06:00
Eric Wasylishen c30a0a46a9 qbsp: fix origin brushes in hexen 2. Drop _no_bbox_rotation_expansion
document origin brushes. Never expand the bbox when origin brushes are in
use.
2020-02-24 01:26:53 -07:00
Eric Wasylishen e2a5f62f32 vis: temporary hack of raising MAX_PORTALS_ON_LEAF to 512 2020-01-21 00:24:03 -07:00
Eric Wasylishen d6136c154d light: add _light_alpha func_group key for making faces translucent for
light
2019-12-28 21:48:33 -07:00
Eric Wasylishen 2d3aa22242 light: add _nostaticlight key 2019-12-26 17:13:21 -07:00
Eric Wasylishen a4c1ce6ff6 qbsp, light: support _lightignore on func_detail/group 2019-12-09 00:09:20 -07:00
Eric Wasylishen 5e74b4d0bb qbsp: fix external maps with no worldspawn brushes
Thanks to ZungryWare for the report
2019-11-29 21:03:54 -07:00
Eric Wasylishen b132152891 light: allow starting assigning switchable styles before default of 32 2019-10-31 00:40:23 -06:00
Eric Wasylishen 4456020b30 light: remove 65536 ray limit, fixes #276 2019-10-28 01:12:23 -06:00
Eric Wasylishen d7d797b898 qbsp: restore bounds expansion for rotators.
Add "_no_bbox_rotation_expansion" key for opting-out of the bounds expansion

Fixes #271
2019-10-27 23:02:05 -06:00
Eric Wasylishen 79d3aa99de qbsp: fix relative paths for .wad files
Fixes #279
2019-10-27 19:03:45 -06:00
Eric Wasylishen d4cc19afc5 light: rename _dome to _sunlight2/_sunlight3 2019-10-09 20:24:18 -06:00
Eric Wasylishen fa62b20603 light: add a limited version of Lunaran's "_dome" light feature
that only supports domes oriented up/down like sunlight2/3
2019-10-09 02:12:04 -06:00
Eric Wasylishen a36a128b30 light: missing file from last commit 2019-10-09 01:03:37 -06:00
Eric Wasylishen 70336339ca light: fix "_suntexture" interaction with -bounce 2019-10-09 00:59:49 -06:00
Eric Wasylishen f220b2f531 light: support "_suntexture" key on "_sun" "1" entities to limit them
to being cast from a specific sky texture.

Fixes #110
2019-10-09 00:47:39 -06:00
Eric Wasylishen d2ecc73db3 light: support "style" / "targetname" on "_sun" "1" entities.
Fixes #253
2019-10-08 23:43:22 -06:00
Shpoike 89365949bc Squashed commit of the following:
commit 8ca122916d
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 20:54:23 2019 -0600

    fix linker error (radlights is in 2 .cpp files)

commit 8f06fc9c8d
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 20:53:57 2019 -0600

    add clarification comment

commit 038a553fb0
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 20:30:27 2019 -0600

    fix tests compilation

commit 02e94ec507
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 19:59:25 2019 -0600

    hlbsp: use q_snprintf

commit 669a5a7911
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 19:56:21 2019 -0600

    Reformat

commit 6653760982
Merge: 347a455 ac3553c
Author: Eric Wasylishen <ewasylishen@gmail.com>
Date:   Thu Jul 4 19:28:06 2019 -0600

    Merge remote-tracking branch 'origin/master' into hlbsp

    # Conflicts:
    #	include/qbsp/qbsp.hh

commit 347a455102
Author: Shpoike <Shpoike@users.noreply.github.com>
Date:   Thu Mar 28 02:18:16 2019 +0000

    Misc HLBSP tweaks

    Added support for multiple -wadpath args.
    Added -xwadpath (for eg valve/*.wad to avoid bloat/license issues).
    Reworked hint brushes - the non-hint surfaces can use any name, just so long as they're not 'hint', for compat with zhlt.
    Support 'bevel' and 'null' textures for compat with zhlt.

commit 7fb22c7367
Author: Shpoike <Shpoike@users.noreply.github.com>
Date:   Thu Mar 28 01:59:42 2019 +0000

    Support for halflife-style .rad surface lights (probably too bright, but the basics work).

commit 2da504fb62
Author: Shpoike <Shpoike@users.noreply.github.com>
Date:   Thu Mar 28 01:56:27 2019 +0000

    Add minus-prefixed textures for halflife's randomised-textures feature, instead of getting crash-to-desktop errors when the map is loaded.

commit 6366199bdb
Author: Shpoike <Shpoike@users.noreply.github.com>
Date:   Thu Mar 21 04:51:24 2019 +0000

    First attempt at hlbsp output.
2019-07-04 21:08:17 -06:00
Eric Wasylishen b04c06a616 light: fix _shadow -1 being interpreted as _shadow 1 for bmodels 2019-06-27 23:45:54 -06:00
Eric Wasylishen ba7bdf86a1 light: increase max sky distance to 1M 2019-04-20 12:27:27 -06:00
Eric Wasylishen b343b9504a qbsp, light: support _minlight_exclude on func_group, detail, etc. 2019-04-05 21:14:39 -06:00
Eric Wasylishen fd8b205dd2 light: fix fix_coord bug (for sampling fence textures) and
rename clamp_texcoord. Thanks to mxd for spotting the bug.

Fixes #260
2019-03-24 23:43:47 -06:00
Eric Wasylishen ad65449cef qbsp: add "-midsplitsurffraction n" option as an alt. to -maxnodesize
switch to midsplit if the node contains more than this fraction of the
model's total surfaces. Try 0.15 to 0.5. Works better than
maxNodeSize for maps with a 3D skybox (e.g. +-128K unit maps)
2019-02-11 00:52:38 -07:00
Eric Wasylishen 16ad2b077a qbsp: -objexport debugging: Add another point where an .obj is dumped 2019-01-26 22:22:07 -07:00
Eric Wasylishen 2df839cfc2 light: Add "_bounce" "-1" to disable bouncing for a func_detail/etc. 2019-01-22 00:02:46 -07:00
Eric Wasylishen 0ac4909396 qbsp: change outside.cc to not fill leafs that have faces that are
straddling in and out of the void.

Previously, we were just deleting these faces, leaving HOMs.
Keeping them but filling the leaf in as solid doesn't work either, because
if they are the only faces left in the leaf it messes up the content type
determination later.

Fixes test_tjunc01.map test case from Qmaster.
2019-01-19 21:56:05 -07:00
Eric Wasylishen 8a47233bbf bsputil: start a --compare feature for helping with qbsp testing 2019-01-10 02:58:37 -07:00
Eric Wasylishen 4a360989f3 qbsp: add -worldextent option for compiling large maps, default 65536 2018-12-24 01:53:08 -07:00
Eric Wasylishen fa06716545 common: make VecStrf/VecStr threadsafe 2018-07-24 00:18:43 -06:00
Eric Wasylishen e6411b2cee light: alternate fix for lockable_vec_t::stringValue() 2018-07-24 00:12:31 -06:00
MaxED 07447a633e Rewritten parts of surface light logic. Should resemble qrad3 looks a bit more now...
Added "surflightscale", "surflightbouncescale" and "surflightsubdivision" cmdline/worldspawn settings.
Fixed: a face should not be skipped when it has both sky and nodraw texinfo flags.
Fixed some non-windows compilation errors.
2018-05-25 14:59:22 +03:00
MaxED 0661098bc5 Quake 2 support: area lights, palette/texture loading, transparent/sky/fence face flags. 2018-05-08 15:50:01 +03:00
Eric Wasylishen 30c19ab9da qbsp: support reading Q2/Q3 detail flag 2018-03-18 19:50:35 -06:00
Eric Wasylishen f92b48a8cb qbsp: experimental _noclipfaces key 2018-03-13 12:23:41 -06:00
Eric Wasylishen 94dbd0a705 qbsp: _phong_angle_concave support 2018-01-30 01:20:38 -07:00
Eric Wasylishen 23b25a0a0e qbsp: add failing tests for healing invalid texture projections 2018-01-28 01:54:58 -07:00
Eric Wasylishen 82e3aef283 light: add FacePairConcavity 2018-01-11 21:57:48 -07:00
Eric Wasylishen ebb508c7db light: remove transparent lightmaps spam 2017-12-28 12:50:32 -07:00
Eric Wasylishen d31d3621bc light: add MakePlane function 2017-12-10 21:28:35 -07:00
Eric Wasylishen 33bc1ee05e light: wip work on CalcPointNormal 2017-12-06 23:38:59 -07:00
Eric Wasylishen 71d9f8ce8a light: move NeighbouringFaces_new to phong.cc 2017-12-06 00:23:21 -07:00
Eric Wasylishen 69879b4104 light: add -highlightseams flag 2017-12-05 15:09:34 -07:00
Eric Wasylishen d9f112a97f light: add -phongdebug_obj flag 2017-11-25 23:12:23 -07:00
Eric Wasylishen d4d2d537eb light: split GLM_PolyRandomPoint into precomputed portion
take uniform random params explicitly
2017-11-24 18:01:18 -07:00
Eric Wasylishen 92bacbe7e1 light: FacesOverlappingEdge: return the edge that overlaps 2017-11-24 14:22:54 -07:00
Eric Wasylishen 8ce7a682b1 light: add -debugneighbours 2017-11-23 23:45:15 -07:00
Eric Wasylishen 7170aac1c3 light: FacesOverlappingEdge 2017-11-23 23:45:05 -07:00
Eric Wasylishen f356ea40d1 bsputils: add more bounds-checked accessors 2017-11-23 23:45:05 -07:00
Eric Wasylishen 88ee157b97 mathlib: add LinesOverlap function 2017-11-23 23:45:00 -07:00
Eric Wasylishen 501fb9ee40 light: add FacesUsingVert 2017-11-19 23:47:29 -07:00
Eric Wasylishen 2ea0076160 qbsp: experimental func_illusionary_visblocker 2017-10-24 22:17:10 -07:00
Eric Wasylishen abf2a3665b vis: fix to use mbsp_t 2017-10-24 20:01:04 -07:00
Eric Wasylishen cbba35a346 common: logprint: print to visual studio console 2017-10-24 19:51:29 -07:00
Eric Wasylishen 4471a80aa9 common: add q2 content types (from: https://github.com/id-software/quake-2-tools ) 2017-10-03 18:17:10 -06:00
Eric Wasylishen 873e0b8a35 common: Face_IsLightmapped: q2 support 2017-10-03 14:42:19 -06:00
Eric Wasylishen 2dc22b7088 common: add loadversion to mbsp_t 2017-10-03 14:17:42 -06:00
Eric Wasylishen dff71edfe9 light: very early q2 support. half of the faces seem to be saved without lightmaps for some reason 2017-10-03 00:33:14 -06:00
Eric Wasylishen df06ead299 common: q2 <-> generic conversion 2017-10-02 16:02:01 -06:00
Eric Wasylishen 8813d272cb common, light, vis: change from bsp2_t to mbsp_t 2017-10-01 22:32:20 -06:00
Eric Wasylishen b847af61e1 common: bsp29_t <-> mbsp_t conversion 2017-10-01 21:27:00 -06:00