Commit Graph

870 Commits

Author SHA1 Message Date
Garux aa110638d4 remove global std::size_t mapEntityNum;
(not buildable)
2021-11-06 17:27:11 +03:00
Garux 25bb05b0d2 remove global int numMapEntities; int entitySourceBrushes; 2021-11-06 15:12:21 +03:00
Garux 16dddad640 remove global entity_t *mapEnt; 2021-11-06 13:50:30 +03:00
Garux 0aa61b7dfa also fix dummy targetnames in -mergebsp -fixnames, may legitimately exist as outcome of misc_model->group_entity connection 2021-11-04 19:45:57 +03:00
Garux d1610b49ff move Timer class to header, use it in q3map2 2021-11-04 17:25:04 +03:00
Garux 396fe81cd2 Q_MKDIR: use std::filesystem::create_directories 2021-11-02 22:14:08 +03:00
Garux 522f6f907e rename cmdlib and imagelib to fix name clashes 2021-10-31 14:13:02 +03:00
Garux b0b997e493 manage stl includes 2021-10-31 12:38:53 +03:00
Garux 512f0a959b manage headers 2021-10-31 10:54:57 +03:00
Garux da98e8fde3 various code cleanups 2021-10-30 16:04:31 +03:00
Garux e62da4c621 * patchMeta: fix: keep playerclip patches for collisions
* autocaulk: do not impact fog brushes with all faces culled (global fog case)
decompilation: detail flag deduction: avoid detail hints, areaportals, antiportals by surfaceparm structural check
change hardcoded surfaceflags use to statically evaluated ones for the given game
2021-10-29 11:29:32 +03:00
Garux 2b59253b26 wrap bit flags operations 2021-10-28 14:39:58 +03:00
Garux 7626f69b02 minor tweaks 2021-10-28 12:25:26 +03:00
Garux 2e9bf0af1c minor tweaks 2021-10-26 20:15:09 +03:00
Garux 67ea9b0390 fix excess memory allocation 2021-10-26 18:30:05 +03:00
Garux 0c390241c8 fix formatting 2021-10-26 18:16:24 +03:00
Garux 977781a621 minor tweaks 2021-10-26 17:26:35 +03:00
Garux d812cbd4d4 replace ArrayRange by tcb::span (reproduction of std::span) 2021-10-24 08:32:10 +03:00
Garux 4726542134 replace Q_EXTERN Q_ASSIGN macro trick by inline variable specifier
remove explicit initialization, where it equals to default zero initialization
2021-10-22 04:13:08 +03:00
Garux d5b2c67812 fix simple warnings 2021-10-22 03:19:07 +03:00
Garux bf6389fc26 use #pragma once 2021-10-22 02:19:50 +03:00
Garux f5b2653b0d add automatic MemBuffer storage for file loading routines 2021-10-17 23:10:02 +03:00
Garux 6a7550a6ba shorten special class members declarations 2021-10-14 23:31:07 +03:00
Garux 5ef76b0212 * non -fast bsp decompilation: deduce brush detail flag; note: structural transparent brushes get marked detail too, e.g. hints 2021-10-14 21:09:06 +03:00
Garux 5283b70a83 * fix decompilation of brushes with edge case face normal ( -0.577350259 -0.577350259 0.577350259 ) and MakeNormalVectors() in general 2021-10-14 14:33:44 +03:00
Garux bc7bd516e6 refactor bsp decompilation 2021-10-14 14:32:49 +03:00
Garux a719e012fe * -mergebsp [options] <mainBsp.bsp> <bspToinject.bsp>: Inject latter BSP to former. Tree and vis data of the main one are preserved.
* -mergebsp -fixnames: Make incoming BSP target/targetname names unique to not collide with existing names
	* -mergebsp -world: Also merge worldspawn model (brushes as if they were detail, no BSP tree is affected) (only merges entities by default)
2021-10-13 22:50:43 +03:00
Garux eceb2e3259 matrixify -scale -tex code 2021-10-09 23:17:21 +03:00
Garux f3a4877ce7 * support inline /* */ comments 2021-10-07 22:14:50 +03:00
Garux 93898d3990 #include <errno.h> 2021-10-07 21:11:12 +03:00
Garux 5c67990859 remove q3data and dependencies
looks like it has no any use today
2021-10-07 21:10:12 +03:00
Garux d897de13d5 refactor scripts parsing 2021-10-07 18:58:00 +03:00
Garux 71c72527af refactor tokenizing 2021-10-06 23:37:12 +03:00
Garux fa1933fff5 secure image_t business
no need to keep in mind its destructor
2021-10-06 15:28:47 +03:00
Garux 9660fbb6f1 * unlimit MAX_IMAGES 2021-10-06 10:51:32 +03:00
Garux 44ced506e3 autopacker: use LoadBSPFilePartially
LoadBSPFilePartially: support RBSP
2021-10-05 13:44:30 +03:00
Garux 1fe4ab8bd8 remove #define NAME_MAX 255
check filename_inzip overflow
2021-10-04 23:06:16 +03:00
Garux 3960adf898 remove ExtractFilePath() ExtractFileBase() ExtractFileExtension() 2021-10-04 11:34:15 +03:00
Garux 82d038f6d1 remove global error prone char name[ 1024 ] 2021-10-04 09:59:17 +03:00
Garux b6d60fb17c add and use path_extension_is() 2021-10-03 17:13:12 +03:00
Garux a0e79e8ecd refactor autopk3
unlimit list sizes
	* -pk3, -repack: support multiple bsp files input by command line
2021-10-02 19:13:28 +03:00
Garux ff07c6e244 * -json -pack -useflagnames: deduce surface/content flag values from their names in shaders.json (useful for conversion to a game with different flag values)
* -skipflags: while -useflagnames, skip unknown flag names
2021-09-29 19:48:27 +03:00
Garux ca09e63932 add more undocumented switches 2021-09-28 20:20:48 +03:00
Garux 70b711c4cf * synchronize -help, html help and actually available command line arguments 2021-09-28 19:23:47 +03:00
Garux 5017da5fe4 use custom allocation errors handler 2021-09-28 05:55:17 +03:00
Garux 636c3ac90e mention -format game name in -convert usage 2021-09-28 05:19:31 +03:00
Garux 5283f631e7 std::vector<rawGridPoint_t> rawGridPoints 2021-09-28 05:07:56 +03:00
Garux d1ccdb0fcf std::vector<bspDrawVert_t> yDrawVerts 2021-09-27 21:50:46 +03:00
Garux 86a8b5f1eb minor tweak 2021-09-27 19:56:48 +03:00
Garux 158df04936 fix empty bspVisBytes case 2021-09-27 17:23:17 +03:00
Garux 94cc88d8f4 fix header->ident handling 2021-09-27 16:18:46 +03:00
Garux 1b1e6769e8 std::vector<fog_t> mapFogs 2021-09-27 15:40:39 +03:00
Garux efa324ebe6 remove unused stuff 2021-09-27 15:12:53 +03:00
Garux ecf9a46e78 std::vector<bspAdvertisement_t> bspAds 2021-09-27 13:29:59 +03:00
Garux ce0dd55cc5 std::vector<bspFog_t> bspFogs 2021-09-27 12:56:08 +03:00
Garux 4642753564 std::vector<bspDrawSurface_t> bspDrawSurfaces 2021-09-27 06:14:12 +03:00
Garux 7993cc8a1f std::vector<int> bspDrawIndexes 2021-09-26 22:10:46 +03:00
Garux c58bd839da std::vector<bspDrawVert_t> bspDrawVerts 2021-09-26 21:41:46 +03:00
Garux 560060a908 std::vector<byte> bspVisBytes 2021-09-26 20:34:41 +03:00
Garux 28dfbaa5ab std::vector<bspGridPoint_t> bspGridPoints 2021-09-26 20:01:26 +03:00
Garux e4d6e63e91 std::vector<byte> bspLightBytes 2021-09-25 19:16:25 +03:00
Garux f5c1a11a66 std::vector<bspBrushSide_t> bspBrushSides 2021-09-25 10:17:51 +03:00
Garux 9f63742fda std::vector<std::uint8_t> opaqueBrushes 2021-09-24 17:35:58 +03:00
Garux 260dc59d4a std::vector<bspBrush_t> bspBrushes 2021-09-24 17:05:00 +03:00
Garux a20717c364 std::vector<int> bspLeafBrushes 2021-09-24 16:27:10 +03:00
Garux 6066fe2cc2 std::vector<int> bspLeafSurfaces 2021-09-24 16:16:02 +03:00
Garux b1f32e6faa std::vector<bspNode_t> bspNodes 2021-09-24 16:06:34 +03:00
Garux bccd3bafd7 std::vector<bspPlane_t> bspPlanes 2021-09-24 15:43:24 +03:00
Garux 76d2b565b3 std::vector<bspLeaf_t> bspLeafs 2021-09-24 15:25:58 +03:00
Garux 6267f1d0af std::vector<char> bspEntData 2021-09-24 13:57:17 +03:00
Garux 58911934e0 std::vector<bspShader_t> bspShaders 2021-09-24 13:39:04 +03:00
Garux 6e2fc92576 std::vector<bspModel_t> bspModels 2021-09-24 12:11:11 +03:00
Garux 0e0a295330 * new: bsp export/import in json format; Usage: q3map2 -json <-unpack|-pack> [-v] <mapname> 2021-09-23 03:11:43 +03:00
Garux 29ba8c4876 refactor command line arguments parsing 2021-09-19 11:58:00 +03:00
Garux 02a3b9c026 use ostream_write( CopiedString ) 2021-09-18 15:30:11 +03:00
Garux b78513f9f8 refactor InitPaths()
get rid of MAX_OS_PATH
2021-09-17 19:50:36 +03:00
Garux e22e6169c9 * -fs_basegame gamename: Overrides default game directory name (e.g. Q3A uses 'baseq3', OpenArena 'baseoa', so -game quake3 -fs_basegame baseoa for OA ) 2021-09-16 15:26:55 +03:00
Garux 97ad9bf5c5 separate path manipulating functions
unlimit VFS_MAXDIRS
2021-09-15 08:07:05 +03:00
Garux e1186dd734 subdivide files 2021-09-13 22:29:44 +03:00
Garux dbeb2d0718 rename game -> g_game 2021-09-13 18:49:09 +03:00
Garux 5c5f698c28 use standard [[ noreturn ]] attribute
add ENSURE macro
2021-09-13 18:22:44 +03:00
Garux ef635cd95c remove direct uses of MAIN_C macro 2021-09-13 16:33:29 +03:00
Garux 68b8d7d5dc refactor game configs: using class inheritance to avoid massive duplication 2021-09-13 16:11:01 +03:00
Garux 34fc3d0a5d minor tweaks 2021-09-08 20:03:15 +03:00
Garux 18c741a960 remove unused side_t field 2021-09-08 19:45:04 +03:00
Garux 77f2e39af5 minor tweaks 2021-09-08 19:40:09 +03:00
Garux f3321cef5f * auto fog direction: try all sides, not just axial; default to none, if no visible sides
* q3map_fogDir: pick best matching side, not strict match only; ignore invisible 'bevel' sides
2021-09-08 19:22:18 +03:00
Garux 23d82aa9ef * prioritize +Z fog visible side in ambiguous case (= -Z fog direction), as in fogged pit 2021-09-08 10:11:49 +03:00
Garux 204c3138e2 emit warning on expected practical engine fog limit overflow 2021-09-07 08:14:04 +03:00
Garux 43b5148447 remove -metaMaxBBoxDistance
with current 'pre weld' strategy it's not optimization anymore, also wont work as option to merge non welded triangles with adjusted meta score
2021-09-05 14:45:01 +03:00
Garux 191d489d62 * hasten MergeMetaTriangles and SmoothMetaTriangles to perform typically in 0 seconds
* improve quality of metasurfaces and reduce their count in general case
2021-09-05 11:37:00 +03:00
Garux bafb339c09 MergeMetaTriangles: epsilon compare st, improves merging imprecise sts, e.g. for nonplanar surfaces after q3map_tcgen or just brush face texture projection 2021-09-03 06:23:40 +03:00
Garux d113eed245 improve MergeMetaTriangles out surfaces quality and reduce count 2021-09-03 06:19:41 +03:00
Garux 7f8e548c2f * hasten MergeMetaTriangles greatly (around 30 times in worst case)
this has negative impact on surfaces count in certain scenario (big axial surface of easily mergable triangles)
it wins predecessor once we rotate such surface
so may be consider choosing sorting plane per lump or mergables
algorithm itself is dependent on test data ordering, thus best option would be tweaking it, not prerequisites
`redundant indexes suppressed` count is always worse with this due to sorting nature, sorting per axial plane helps
assuming this optimization is not important and case dependent
2021-09-01 20:16:57 +03:00
Garux f067b5d6c3 tweak -meta 2021-08-28 18:37:22 +03:00
Garux 0ad3d89d4a use spatially sorted indices during search of coincident vertices in AddMetaVertToSurface 2021-08-28 10:56:50 +03:00
Garux e780b45696 enfasten -meta for nonplanar by doing cheap check 1st 2021-08-27 17:13:26 +03:00
Garux 160c1d33db remove -texrange business (assuming it's not relevant for decades)
optimize -meta (shave off 1/3 in worst case)
2021-08-27 12:18:56 +03:00
Garux 3129fd0bce refactor model clipping code 2021-08-20 22:32:33 +03:00
Garux d82996d684 mbspc: fix q3 entities being loaded twice 2021-08-15 18:54:28 +03:00