Commit Graph

65 Commits

Author SHA1 Message Date
Eric Wasylishen ad9fd7fc59 common: structured bspxbrushes reading/writing 2023-11-25 17:28:26 -07:00
qruf d189145a01
build: fixes for mingw support (#373) 2023-09-16 13:15:31 -06:00
Eric Wasylishen 1c85bb882a light: minimize includes 2023-06-26 01:19:54 -06:00
Eric Wasylishen 26dedb603f common: move numeric_cast to dedicated common/numeric_cast.hh 2023-06-25 17:50:17 -06:00
Eric Wasylishen b17633f746 cleanup: set PackConstructorInitializers: Never 2023-02-20 10:23:59 -07:00
Eric Wasylishen eda6155844 cleanup: run ./clang-format-all.sh
clang-format version 15.0.7
2023-02-18 22:59:43 -07:00
Eric Wasylishen d28f97e655 cmdlib: use <bit> include unconditionally 2022-11-12 20:10:58 -07: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
Eric Wasylishen 72ad52647b cmdlib.hh: add missing include 2022-09-30 00:37:18 -06:00
Eric Wasylishen df46f7af82 cmdlib.hh: add missing include 2022-09-30 00:36:03 -06:00
Eric Wasylishen 45fae91a0f cmdlib.hh: add missing include 2022-09-30 00:34:56 -06:00
Jonathan f6601a7c85 clean up the output table for BSPs
add a specialized stream buffer which just tracks how much would be written to it; used to get the output size of the texture lump, since that's no longer tracked
display dmodel byte size
display BSPX lumps a bit differently (no need to repeat BSPX per line)
add header to both lists, to make it more obvious what's coming up
2022-08-22 13:02:58 -04:00
Jonathan 1d8a0c1df3 clang-format pass 2022-07-28 06:14:54 -04:00
Jonathan 9f734ff976 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	common/bspfile.cc
#	include/common/bspfile.hh
#	light/trace.cc
2022-06-30 05:23:05 -04:00
Jonathan 03ee5c52e8 add an entry point for specifically loading meta-only file formats, like .wal; used for discerning replacements from their source material (since replacements are often larger than the default, we need the scale info)
add a new meta format, which is just a JSON representation of the metadata contained in a .wal
simplify texture loading in `light`
fix `light` not handling replacement textures very well
string_iequals take string_view like the others
move averageColor to be alongside pixel data, where it belongs
2022-06-29 12:59:33 -04:00
Jonathan c1dc3cb7d8 Merge branch 'type-cleanup' into brushbsp
# Conflicts:
#	include/common/bspfile.hh
2022-06-28 04:13:26 -04:00
Jonathan c6521aa0b6 move aligned allocator to cmdlib 2022-06-23 00:39:28 -04:00
Jonathan df3e6d3988 remove Little* funcs, not used any more
remove byteswap as it wasn't used any more
re-introduce imemstream and omemstream to make it harder to accidentally use the wrong operators
add dynamic padding stream manipulator
use memstreams for BSPX
2022-06-20 21:39:08 -04:00
Jonathan d24ea4922a entdict cleanup 2022-06-14 17:18:13 -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 5b4660fa63 simplify crc code 2022-06-10 04:47:10 -04:00
Eric Wasylishen d763b2e336 build: support clang-cl 2022-05-10 21:39:58 -06:00
Eric Wasylishen 24ca07188c log: use ANSI colors for strings containing "warning" or "error" 2022-04-03 14:16:22 -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 a479a5ddfb use case-insensitive natsort for discoverArchives
add two other logging control bools, which -quiet now redirect to
add -lowpriority for CPU priority (on Windows)
2022-02-28 09:20:35 -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
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 0e361f9323 Support for Q2BSP decompilation
- there's still a couple failure cases - specifically base1 in the outdoor area has a side that wasn't able to match to a face
- the clip brush at the start of base1 gets cut into a bunch of pieces because of the whole "check for texinfo, compare and split into multiple pieces" thing, but I'm pretty sure it's just one single brush - we need to ignore the splitting thing on clip brushes since they don't care about texture
- triggers don't pull in a temp texture
- origin brushes?
2021-10-27 17:56:56 -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
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 75bcccada1 Fix more unused value warnings
Fix operator >= and <= for tuple of arrays
2021-10-05 23:40:40 -04:00
Jonathan e72934de81 Hopefully resolve clang warnings here now
Fix iterator wrapper
Fix >= <= tuple<T&> operators
2021-10-05 23:24:05 -04:00
Jonathan a2edc09018 Resolve GCC wanting `template` before emplacements 2021-10-05 22:54:25 -04:00
Jonathan b4afc32e2b Fix winding_edges using old get() name
Another attempted fix at VA_ARGS
Fix missing typename prefix
2021-10-05 22:44:13 -04:00
Jonathan f4fc8bc72b Remove unused functions, fix math issues
MacOSX potential fix for __VA_ARGS__
2021-10-05 22:35:30 -04:00
Jonathan 37cb535f1a implement MSVC-style setp 2021-10-05 22:05:35 -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 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
Jonathan 792951792c some more cleanup 2021-10-02 05:56:45 -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 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 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