Commit Graph

90 Commits

Author SHA1 Message Date
Eric Wasylishen 6351cc50e6 rename: vec_t -> double 2023-12-23 21:09:16 -07:00
qruf d189145a01
build: fixes for mingw support (#373) 2023-09-16 13:15:31 -06:00
Jonathan cec120dfc9 maputil starting point 2023-09-04 00:16:23 -04:00
Eric Wasylishen 7608a78b44 style: use std::min/std::max/std::clamp and remove using 2023-08-07 15:42:29 -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 0fb1b429a8 finish tjunc algorithm - can now retopologize by splitting fans up
lower zero-area triangle epsilon
2022-07-12 17:43:25 -04:00
Eric Wasylishen b37d29ee33 common: rename side_t -> planeside_t (side_t is used by qbsp3) 2022-06-24 00:16:46 -06:00
Eric Wasylishen a019088c2f Merge branch 'type-cleanup' into brushbsp 2022-04-02 21:05:46 -06: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
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
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 cb3c81aaf8 vec3_t gonedy 2021-10-21 20:21:28 -04:00
Jonathan a7de4bdae2 Remove unused thingies
Use qplane3 where we can
2021-10-17 06:24:02 -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
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 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
Jonathan f4fc8bc72b Remove unused functions, fix math issues
MacOSX potential fix for __VA_ARGS__
2021-10-05 22:35:30 -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 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 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 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
Eric Wasylishen f7256907d5 common: fix build of bsputils.cc with double == vec_t 2021-08-22 15:12:19 -06:00
Eric Wasylishen fa06716545 common: make VecStrf/VecStr threadsafe 2018-07-24 00:18:43 -06: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 82e3aef283 light: add FacePairConcavity 2018-01-11 21:57:48 -07:00
Eric Wasylishen d31d3621bc light: add MakePlane function 2017-12-10 21:28:35 -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 88ee157b97 mathlib: add LinesOverlap function 2017-11-23 23:45:00 -07:00
Eric Wasylishen 9629134612 qbsp: fix some issues with SplitBrush 2017-07-23 01:32:04 -06:00
Eric Wasylishen 5893c16267 mathlib: add AddPointToBounds, ClearBounds 2017-07-22 16:31:15 -06:00
Eric Wasylishen 0d0f265f05 mathlib: add VectorClear 2017-07-17 21:20:17 -06:00
Eric Wasylishen 4853dd40ee mathlib: RotateAboutX/Y/Z: change to double 2017-07-05 15:02:24 -06:00
Eric Wasylishen 4d9b41d3ec mathlib: fix SetPlanePts linkage 2017-06-20 17:07:36 -06:00
Eric Wasylishen 98c5dd2913 mathlib: refactor ProjectPointOntoPlane 2017-06-20 16:01:34 -06:00
Eric Wasylishen af264821b7 mathlib: factor out SetPlanePts 2017-06-20 14:39:15 -06:00
Eric Wasylishen 85d235393e mathlib: add vec3_t version of ProjectPointOntoPlane 2017-06-20 14:29:53 -06:00
Eric Wasylishen 7545119593 mathlib: change RotateAboutZ to double 2017-06-15 03:30:10 -06:00
Eric Wasylishen e0564e8c2a common: mathlib: don't need #define ANGLEEPSILON 2017-04-26 14:29:07 -06:00
Eric Wasylishen ca58e90e15 common: remove EQUAL_EPSILON from mathlib.hh 2017-04-26 14:25:55 -06:00
Eric Wasylishen 03396787b2 common: mathlib: add VectorLengthSq 2017-04-26 14:21:19 -06:00
Eric Wasylishen 902c45c946 all: make VectorCompare take an explicit epsilon 2017-04-26 14:20:45 -06:00