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
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
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
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
Eric Wasylishen
b681690807
qbsp: fix some memory leaks
2022-01-16 12:47:19 -07: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
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
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
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
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
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
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
9b19828530
qbsp: avoid triggering MSVC std::vector access bounds check
...
even though we're just taking the address with &, face->edges[face->w.size()]
was accessing an out-of-bounds element
2021-10-06 16:44:14 -06:00
Eric Wasylishen
0d06489016
qbsp: change HashVec to inline (fixing macOS build)
2021-10-06 16:38:24 -06: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
33745c3cb8
clang /macOS: un-constexpr things that were erroring
...
neither clang nor gcc like the qvec(Args..) constructor
being constexpr.
GCC's error says:
error: member ‘qvec<3, double>::v’ must be initialized by mem-initializer in ‘constexpr’ constructor
2021-10-05 23:18:52 -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
Jonathan
52839d4e7f
Run clang-format pass
2021-10-05 15:54:06 -04:00
Jonathan
4ad798e29c
Fix origin brushes
...
Fix merge stuff from qbsp-contentflags
2021-10-05 15:50:18 -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
Eric Wasylishen
5b62f61b29
qbsp: revert contents handling to be closer to master
2021-10-04 20:39:47 -06: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
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
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
1dd4df1b20
calloc/malloc/free -> new/new/delete (except for specific scenarios)
2021-09-14 11:39:12 -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
91f0c47128
remove test code
...
fix two errors
2021-09-12 08:38:21 -04: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
35040d1bd3
Q2 working sorta
2021-09-09 02:13:28 -04:00
Jonathan
9800f4f738
Mostly all native!!
2021-09-09 00:26:17 -04: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
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
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
bc44af4d1d
qbsp: fix unused variable warnings
2021-08-31 22:42:49 -06:00
Eric Wasylishen
1123205d47
qbsp: replace FreeMem uses
2021-08-24 22:49:06 -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
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
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