Commit Graph

62 Commits

Author SHA1 Message Date
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Eric Wasylishen e8d2a53255 bspinfo, bsputil: rename options -> bspinfo_options, bsputil_options 2022-07-10 17:32:23 -06:00
Jonathan cf04f644e0 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspinfo.cc
#	include/common/bspfile.hh
#	include/qbsp/map.hh
#	include/qbsp/wad.hh
#	qbsp/wad.cc
2022-06-27 06:44:45 -04:00
Jonathan 510023e089 step 1 of finishing the rewrite I started of the image subsystems.
- for Quake-likes, WADs will be added as file system archives directly when the first brush is encountered since the wad key is ready to go by that point.
- after loading the .map and before constructing the BSP, what I call secondary textures (animation frames for Quake-likes) are added to the list, and the BSP's miptex data is filled.
- BSP miptex data is now opaque to the BSP process; the BSP simply copies the raw miptex information from the input. This simplifies the BSP structures and reading/writing routines.
- the img subsystem supports reading from raw miptexes now, although in practice this only happens for Quake-likes atm
- instead of a "wal cache", maps now have a "meta cache" which stores the metadata information for all games instead of just Quake II
- texture meta can now be ref'd out rather than needing to be copied every time (mainly only a gain for the std::string)
- wad.cc/wad.hh is gone; wads are now pushed into the filesystem archive
- fixed broken wad_archive
- fs subsystem iterated on a little bit; supports marking archives as external (only used for wads currently; see `LoadTextureData`)
- load_tga has better error handling
- add in foot-gun protection to the BSP readers; now they assert on failure to read instead of silently propagating that error throughout the rest of the process
- bsputil uses img stuff now, so it should handle palettes better
2022-06-27 03:58:23 -04:00
Jonathan 812797f7ed enable lighting for warp/sky in Q2
simplify bitflag definitions
change nudging light warning to make more sense
another #define -> constexpr pass
2022-06-10 06:29:14 -04:00
Jonathan d05b8fc3db don't output texinfo for SKIP faces - rendered faces won't reference them anyways (unless includeskip is on) 2022-06-02 18:59:51 -04:00
Eric Wasylishen ba37ae3a54 move serialize_bsp() to common/bspinfo.cc 2022-05-14 14:54:21 -06:00
Eric Wasylishen f9242f51d6 bspinfo: .json: output readable node plane 2022-05-13 00:27:10 -06:00
Jonathan c81e9ace28 remove old threading code entirely
add new parallel logging stuff in common/parallel which wraps parallel_for(_each) and provides automatic percentage indicator
fix issue with light not pulling in settings
move logging stuff into its own namespace and simplify
2022-03-01 10:28:59 -05: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
Eric Wasylishen 44468037d7 build: copy tbb .dll for vis/bspinfo targets 2022-02-20 16:59:35 -07:00
Eric Wasylishen c9071acbcd bspinfo: fix build 2022-01-15 22:49:27 -07:00
Eric Wasylishen 98d2e8daed bspinfo: fix .bmp palette writing 2021-12-13 20:08:19 -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 8cadf06d81 New FS!
First FS test: use it for decompile for Q2 to prevent unnecessary suffixes
2021-11-05 19:25:37 -04:00
Jonathan 1ccbe9e12c wrbrushes lump using streaming now
temp(?) fix for structural covered by detail
2021-10-25 19:24:07 -04:00
Jonathan 550cacef3f Clean warnings 2021-10-25 13:46:04 -04:00
Jonathan 11c3511605 new normal calculation cherry-picked from branch
Fix entdata not having its '\0'
don't write unnecessary extended texinfo
2021-10-24 15:21:26 -04:00
Jonathan bfc854efcb base64 bmp images for texture debug
Fix qv::length
2021-10-24 13:55:27 -04:00
Jonathan cb3c81aaf8 vec3_t gonedy 2021-10-21 20:21:28 -04:00
Jonathan 1bf6261826 constexpr/inline qv:: where appropriate
comment out rewrite test in bspinfo
updated tjunc code
2021-10-19 23:26:43 -04:00
Jonathan a7de4bdae2 Remove unused thingies
Use qplane3 where we can
2021-10-17 06:24:02 -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
Eric Wasylishen 056e9442fd bspinfo, bspfile: fixes for handling of \0 terminator on entdata 2021-10-08 23:03:05 -06:00
Eric Wasylishen 34b6462641 build: build common as a static library 2021-10-08 20:08:26 -06:00
Eric Wasylishen 377868978d bspinfo: write json to .bsp.json for consistency with master branch / automated tests 2021-10-06 17:19:45 -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 d56418ae95 Merge remote-tracking branch 'origin/master' into qbsp-contentflags 2021-10-04 20:38:49 -06:00
Eric Wasylishen 60d9d4daf4 bspinfo: also output face vertices 2021-10-04 19:53:03 -06:00
Eric Wasylishen 590dd47890 bspinfo: export more lumps to JSON (faces, edges, leaffaces, surfedges) 2021-10-04 18:17:52 -06:00
Jonathan 037c587352 Merge remote-tracking branch 'remotes/origin/qbsp-contentflags' into type-cleanup
# Conflicts:
#	bspinfo/bspinfo.cc
#	include/common/bspfile.hh
#	include/light/light.hh
#	include/light/trace.hh
#	light/light.cc
#	light/ltface.cc
#	light/trace.cc
#	qbsp/brush.cc
#	qbsp/csg4.cc
#	qbsp/outside.cc
#	qbsp/qbsp.cc
2021-10-03 13:08:50 -04:00
Eric Wasylishen 8fd3f14bf9 bspinfo: json export
Co-authored-by: Jonathan <jonno.5000@gmail.com>
2021-10-02 17:57:31 -06: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
Eric Wasylishen ea620b3e5d bspinfo: more JSON export types 2021-09-25 20:44:57 -06:00
Eric Wasylishen 8ff65cc05a bspinfo: JSON export of BSPX BRUSHLIST lump 2021-09-25 16:54:14 -06:00
Eric Wasylishen 4b25b6b095 bspinfo: output more lumps to json 2021-09-24 20:17:43 -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
Jonathan 2ebfdb096f Remove COM_Parse, use parser_t
Game controls hull sizes now
2021-09-20 19:45:09 -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 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 1cf9817092 JSON output support 2021-09-12 11:10:21 -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
Eric Wasylishen fcf0ebbbfe build: upgrade googletest 2021-02-07 14:42:12 -07:00
Eric Wasylishen 9124653156 common: move EntData_ function to common 2021-01-30 21:11:25 -07:00
Eric Wasylishen b85d627c8f change branding to ericw-tools 2017-10-19 16:35:37 -06:00
Eric Wasylishen a6468984bf all: finish c++ification 2016-10-17 19:52:17 -06:00