Commit Graph

233 Commits

Author SHA1 Message Date
Eric Wasylishen d2ea0cee41 Merge remote-tracking branch 'origin/master' into qbsp-use-common 2021-09-12 23:04:42 -06: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
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
Eric Wasylishen c90ac7d6a7 common: bsp29: validate edges/marksurfaces 2021-09-05 01:28:58 -06:00
Eric Wasylishen 948932f333 common: bsp29: validate clipnodes 2021-09-05 01:10:23 -06:00
Eric Wasylishen a0ccb765e8 common: validate bsp29 nodes and faces 2021-09-05 01:04:39 -06:00
Eric Wasylishen f978d2a8d5 common: start adding overflow checks to ConvertBSPFormat 2021-09-05 00:44:25 -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 8beda9a039 common, qbsp: make Error() noreturn 2021-08-26 20:22:45 -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 f7256907d5 common: fix build of bsputils.cc with double == vec_t 2021-08-22 15:12:19 -06:00
Eric Wasylishen 6e12b3d956 common: fix another 99999 constant 2021-07-13 22:02:41 -06:00
Eric Wasylishen c9570260fa gcc 11: pass constant to offsetof 2021-05-30 23:12:17 -06:00
Eric Wasylishen 4ba0e99d3f Light_PointInSolid: add check against model bounds 2021-05-21 22:35:41 -06:00
Eric Wasylishen ab6956c9d0 bsputils: fix comment 2021-05-21 22:25:05 -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 f0e2f4ba96 common: small tweaks: CopyWinding accepts null, document face side 2021-02-05 22:26:13 -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 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 2f92681ba6 polylib: increase limits in BaseWindingForPlane 2020-08-23 11:35:15 -06:00
Eric Wasylishen 79d3aa99de qbsp: fix relative paths for .wad files
Fixes #279
2019-10-27 19:03:45 -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 16ad2b077a qbsp: -objexport debugging: Add another point where an .obj is dumped 2019-01-26 22:22:07 -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 fa06716545 common: make VecStrf/VecStr threadsafe 2018-07-24 00:18:43 -06:00
Eric Wasylishen af6d4744fc SetQdirFromPath: don't make it an error if the qdir/gamedir/basedir
can't be found.
2018-07-23 23:00:56 -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 7b341e1b55 BSPX_AddLump: copy the input data 2018-02-18 16:06:56 -07:00
Eric Wasylishen 992484f173 common: fix SafeWrite error msg 2018-02-09 11:05:11 -07:00
Eric Wasylishen b3cd6ccc1a light: GLM_InterpolateNormal: make more robust against degenerate tris 2018-01-28 02:29:24 -07:00
Eric Wasylishen 6b14e166b8 light: make GLM_InterpolateNormal return failure on degenerate input 2018-01-28 02:19:09 -07:00
Eric Wasylishen d10dec1803 light: make GLM_PolyCentroid accept degenerate faces (todo: must rename these) 2018-01-12 00:36:12 -07: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 75bc7b86d0 light: add FIXME 2017-12-05 21:06:51 -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 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 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 37e2b94d3e bsputils: add leafnum bounds check to Light_PointInSolid_r 2017-10-19 13:41:14 -07:00
Eric Wasylishen 873e0b8a35 common: Face_IsLightmapped: q2 support 2017-10-03 14:42:19 -06:00