Commit Graph

252 Commits

Author SHA1 Message Date
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
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
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 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 437459a4dd Finish using game everywhere 2021-09-06 18:09:13 -04:00
Jonathan dd3bcebe39 Fix missing newline 2021-09-06 17:29:09 -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
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 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
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 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