Commit Graph

291 Commits

Author SHA1 Message Date
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
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 056e9442fd bspinfo, bspfile: fixes for handling of \0 terminator on entdata 2021-10-08 23:03:05 -06:00
Eric Wasylishen f3f07d9e06 bspfile: fix reading/writing of entdata adding extra null terminators 2021-10-08 22:45:55 -06:00
Eric Wasylishen 34b6462641 build: build common as a static library 2021-10-08 20:08:26 -06:00
Eric Wasylishen 4c17969651 build: remove mingw workaround (unsupported) 2021-10-08 19:46:48 -06:00
Eric Wasylishen 76d0dae890 mathlib: GLM_InterpolateNormal: quick hack to fix build of testlight 2021-10-08 19:31:06 -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 3df3891563 bspfile: fix hexen2 hull sizes 2021-10-08 00:56:11 -06:00
Jonathan a2edc09018 Resolve GCC wanting `template` before emplacements 2021-10-05 22:54:25 -04: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
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 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 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 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 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 73c665abfe bspfile.cc: gamedef_q1_like_t: fix template argument shadowing 2021-09-23 00:39:10 -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 8093e94864 bspfile.cc: fix build 2021-09-22 00:25:23 -06:00
Eric Wasylishen 80a4aa1b97 Merge branch 'master' into qbsp-contentflags 2021-09-22 00:12:27 -06:00
Eric Wasylishen 8d51e23ecc bspfile: add fixme about q2 overflow checking 2021-09-21 00:09:55 -06:00
Eric Wasylishen 0c0cc9ef81 bspfile: fix OverflowsUint16 2021-09-20 23:59:26 -06:00
Eric Wasylishen 7622ca1a3b bspfile: fix incorrectly identifying bsp2 as hexen2bsp2 2021-09-20 19:38:38 -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 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 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
xDShot 4a1feadaab
#include <limits.h> (#319)
Fixes error about undefined INT_MAX in common/bspfile.cc
2021-09-12 00:15:02 -06:00
Jonathan 8cdb9ff6c4 Initial attempt at leafbrushes 2021-09-09 05:11:47 -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