Eric Wasylishen
3069996a6f
qbsp: portals.cc: remove statics, move to portal_state_t struct
2017-07-09 00:46:06 -06:00
Eric Wasylishen
e848d00f92
qbsp: get an actual test for #158 , currently disabled
2017-07-08 17:38:33 -06:00
Eric Wasylishen
01fa4a9f58
qbsp: set up test case for #158
2017-07-08 16:23:08 -06:00
Eric Wasylishen
34a6bf7876
qbsp: add testqbsp target
2017-07-08 15:49:14 -06:00
Eric Wasylishen
7656d5c2f1
qbsp: external map: merge all brush entities with worldspawn
2017-07-07 20:26:27 -06:00
Eric Wasylishen
a4e3a3a887
Revert "qbsp: move node_t markfaces list to a std::vector"
...
This reverts commit 31df408333 .
2017-07-05 18:10:56 -07:00
Eric Wasylishen
cef3b3da9f
qbsp: misc_external_map: add "_external_map_angles" for pitch/yaw/roll
2017-07-05 15:13:09 -06:00
Eric Wasylishen
cf6af89bdf
qbsp: fix some comments
2017-07-03 17:48:43 -06:00
Eric Wasylishen
117f568cd7
qbsp: don't write unused texinfo.
...
also cleanup planes writing
2017-07-03 01:58:26 -06:00
Eric Wasylishen
31df408333
qbsp: move node_t markfaces list to a std::vector
2017-07-02 21:03:41 -06:00
Eric Wasylishen
97787e9d2c
qbsp: add extrafaces argument to MakeFaceEdges
2017-07-02 20:06:41 -06:00
Eric Wasylishen
eef45d79eb
qbsp: more refactoring GrowNodeRegion
2017-07-02 17:27:35 -06:00
Eric Wasylishen
014770b212
qbsp: refactor GrowNodeRegion
2017-07-02 17:18:19 -06:00
Eric Wasylishen
d7e90b1cf2
qbsp: PrintBSPFileSizes: reformat
2017-07-02 16:34:55 -06:00
Eric Wasylishen
80380fa7fd
qbsp: drop ExportNodePlanes. Planes were already deduplicated by
...
FindPlanes.
2017-07-01 17:25:02 -06:00
Eric Wasylishen
af264821b7
mathlib: factor out SetPlanePts
2017-06-20 14:39:15 -06:00
Eric Wasylishen
85a6b9095d
qbsp: refactor PlaneInvEqual
2017-06-20 13:07:17 -06:00
Eric Wasylishen
73ffb37417
misc_external_map: fix -onlyents
2017-06-15 17:38:49 -06:00
Eric Wasylishen
37ed11c2ed
qbsp: experimental "misc_external_map" entity
...
"_external_map" - map to load
"_external_map_classname" - classname to switch to (e.g. func_wall)
"_external_map_angle" - rotation angle around Z axis
2017-06-15 03:43:39 -06:00
Eric Wasylishen
ceab425885
map.cc: factor out plane-points setting code
2017-06-15 03:30:02 -06:00
Eric Wasylishen
8d2a257729
wad.cc: factor out .wad file opening
2017-06-15 03:29:55 -06:00
Eric Wasylishen
19dd7b1c4a
qbsp: log number of planes after calling Brush_LoadEntity
2017-06-10 01:15:49 -06:00
Eric Wasylishen
77f3da30bf
qbsp: add func_detail_fence
2017-06-09 15:13:13 -06:00
Eric Wasylishen
7198884392
qbsp: ExportDrawNodes: add assertion from DP that node children are different
...
DetailToSolid: collapse redundant nodes where both children are
solid (-1) to just be the leaf -1. Any faces on-node should be
impossible to see so they can be safely discarded.
2017-06-09 13:14:52 -06:00
Eric Wasylishen
d01b740b5b
qbsp: add -omitdetailwall and -omitdetailillusionary
2017-06-07 14:12:02 -06:00
Eric Wasylishen
37401937ae
qbsp: fix LinkNodeFaces documentation
2017-06-07 12:23:25 -06:00
Eric Wasylishen
5f4520ee8b
exportobj.cc: remove redundant #defines
2017-06-05 20:29:36 -06:00
Eric Wasylishen
44445becb8
qbsp: rename "_nosurfacefragment" to func_detail_wall
2017-06-05 16:22:15 -06:00
Eric Wasylishen
f8f007f7df
qbsp: detail brushes with CFLAGS_DETAIL_NOSURFACEFRAGMENT don't
...
clip ordinary detail brushes, only those that also have the flag set
2017-06-05 16:11:04 -06:00
Eric Wasylishen
3ca83ea46e
qbsp: add logging for func_detail_illusionary and _nosurfacefragment
2017-06-05 14:37:40 -06:00
Eric Wasylishen
ac78efed98
qbsp: func_detail rewrite.
...
- Fix corrupt VIS issues when using func_detail
- func_detail no longer seals the map.
- add func_detail_illusionary entity type
- add func_detail key "_nosurfacefragment"
2017-06-05 14:09:31 -06:00
Eric Wasylishen
ea099775ef
qbsp, light: allow _shadow -1 to disable shadows from func_detail
2017-06-05 14:01:12 -06:00
Eric Wasylishen
e3da31b308
writebsp.cc: Assert we never write a private contents type to the bsp
2017-06-05 14:00:01 -06:00
Eric Wasylishen
dffee91191
csg4.cc: refactor if() statement to match comment
2017-06-01 19:40:06 -06:00
Eric Wasylishen
8236efa613
csg4.cc: clarify SaveInsideFaces docs and add assertions
2017-06-01 14:25:14 -06:00
Eric Wasylishen
e3b7b9615a
qbsp: fix check for needing PRT2 (unlikely to matter on real maps)
2017-06-01 01:16:36 -06:00
Eric Wasylishen
213e4b9f7d
qbsp: add a -nodetail switch, for debugging func_detail issues
2017-05-31 23:23:53 -06:00
Eric Wasylishen
f5d4cd9202
qbsp: add -forceprt1 option for generating a PRT1 to load in editors
...
This is for previewing the portals between clusters, since no editors
can load PRT2.
2017-05-31 23:18:04 -06:00
Eric Wasylishen
8385797ce7
csg4.cc: add a clarifying comment
2017-05-31 13:09:42 -06:00
Eric Wasylishen
224b0c4d2e
qbsp: "Couldn't create brush faces": print .map line number
2017-04-30 19:05:01 -06:00
Eric Wasylishen
85a4249852
qbsp: csg: make hint brushes never clip anything else.
2017-04-30 12:39:12 -06:00
Eric Wasylishen
8f4b506608
qbsp: refactor cmake setup
2017-04-28 13:04:51 -06:00
Eric Wasylishen
64efc77055
qbsp: expose some stuff in qbsp.hh
2017-04-28 13:04:44 -06:00
Eric Wasylishen
3ec36f6550
qbsp: use common/cmdlib
2017-04-26 15:08:49 -06:00
Eric Wasylishen
a548ada3d0
qbsp: fix build
2017-04-26 14:57:23 -06:00
Eric Wasylishen
32eaa99d40
qbsp: rename our plane_t to qbsp_plane_t
2017-04-26 14:55:26 -06:00
Eric Wasylishen
8c89e128c7
qbsp: drop internal mathlib
2017-04-26 14:51:27 -06:00
Eric Wasylishen
902c45c946
all: make VectorCompare take an explicit epsilon
2017-04-26 14:20:45 -06:00
Eric Wasylishen
68b084a6c3
replace glm with qvec
2017-04-24 00:26:49 -06:00
Eric Wasylishen
1f7bd69385
qbsp: optimize FindTexinfo
2017-04-22 16:59:14 -06:00
Eric Wasylishen
43798edcfe
qbsp: split out winding.hh
2017-04-20 20:09:24 -06:00
Eric Wasylishen
9034eb107a
qbsp: move remaining headers to include directory
2017-04-20 19:52:06 -06:00
Eric Wasylishen
c34d958d7a
qbsp: split up qbsp.hh
2017-04-20 19:44:10 -06:00
Eric Wasylishen
66744e33e2
qbsp: map conversion: output epairs in the correct order
2017-03-27 19:36:53 -06:00
Eric Wasylishen
30b8503ccf
qbsp: -convert quake: silence annoying warnings
2017-03-26 17:46:31 -06:00
Eric Wasylishen
73082828b4
qbsp: don't use regex stuff, doesn't work on the travis version of gcc
2017-03-26 17:41:22 -06:00
Eric Wasylishen
ed89dc487a
qbsp: add docs for -convert option
2017-03-26 17:07:52 -06:00
Eric Wasylishen
62f17545b9
qbsp: expose LoadBrush in header
2017-03-26 16:41:16 -06:00
Eric Wasylishen
af355a87be
qbsp: fix -convert quake2
2017-03-26 16:35:26 -06:00
Eric Wasylishen
f3caed2f8b
qbsp: support -convert quake2 to write classic q2/q3 format with three 0 flags
2017-03-26 16:06:21 -06:00
Eric Wasylishen
32b001b4d9
qbsp: fix typo in QuakeEd .map conversion
2017-03-26 16:05:33 -06:00
Eric Wasylishen
dbec32efaf
qbsp: -convert bp: write 0 0 0 face flags
2017-03-26 15:49:15 -06:00
Eric Wasylishen
8294e1d750
qbsp: change -convert valve220 to shorter -convert valve
2017-03-26 15:32:58 -06:00
Eric Wasylishen
75c3fdadf6
qbsp: rewrite .map printing code. Print as integers if it can be done losslessly.
2017-03-26 15:29:36 -06:00
Eric Wasylishen
2fe14087db
qbsp: QuakeEd .map conversion: normalize shifts
2017-03-26 15:08:10 -06:00
Eric Wasylishen
6c336738c4
qbsp: QuakeEd .map conversion: drop the RMSE test as it sometimes picked worse visual results (wood roof trim in ad_swampy)
2017-03-26 14:42:13 -06:00
Eric Wasylishen
39c137c2a3
qbsp: SetTexinfo_QuakeEd_New: treat scale=0 as scale=1
2017-03-26 13:00:07 -06:00
Eric Wasylishen
94ba5560c7
qbsp: fix QuakeEd map conversion
2017-03-26 12:40:06 -06:00
Eric Wasylishen
ce673b813e
qbsp: remove dead code
2017-03-23 14:40:03 -06:00
Eric Wasylishen
5fae648506
qbsp: refactor TexDef_BSPToValve
2017-03-23 14:39:34 -06:00
Eric Wasylishen
57bed163be
qbsp: change "brushprimtivies" label to shorter "bp"
2017-03-23 14:38:08 -06:00
Eric Wasylishen
78d517a99d
qbsp: remove placeholder entity inserted at the end of the vecotr
2017-03-22 19:22:23 -06:00
Eric Wasylishen
6f17758fc7
qbsp: quake/valve map output: avoid divide by 0 when calculating scale
2017-03-22 18:27:13 -06:00
Eric Wasylishen
be78da93e8
qbsp: quark ETP: add missing negative sign to match bjptools-xt output
2017-03-22 17:13:36 -06:00
Eric Wasylishen
fc2b5e438d
qbsp: brush primitives output
2017-03-22 16:39:43 -06:00
Eric Wasylishen
e8a7e55bb7
qbsp: refactoring to SetTexinfo_BrushPrimitives
2017-03-22 16:39:43 -06:00
Eric Wasylishen
3dda0e9c4e
qbsp: hook up "to quake" conversion
2017-03-22 02:39:55 -06:00
Eric Wasylishen
aab47605bb
qbsp: add TexDef_BSPToQuakeEd()
2017-03-22 02:12:16 -06:00
Eric Wasylishen
f04f34524c
qbsp: TextureAxisFromPlane: add extra param for returning the snapped axis
2017-03-22 01:11:21 -06:00
Eric Wasylishen
1f3d38a611
qbsp mathlib: add helper for getting angle between vectors
2017-03-22 01:07:32 -06:00
Eric Wasylishen
8e1b7effca
qbsp: mark unreachable code
2017-03-22 00:40:33 -06:00
Eric Wasylishen
c2bb2bea32
qbsp: first draft of * to valve220 conversion
2017-03-21 21:01:10 -06:00
Eric Wasylishen
d607aa1a89
qbsp: whitespace fix
2017-03-21 21:01:10 -06:00
Eric Wasylishen
a6f56d9111
qbsp: add -omitdetail option
2017-02-27 13:26:01 -07:00
Eric Wasylishen
2673d9d8c3
qbsp: fix broken clipping hulls on rotating objects
2017-01-25 14:59:40 -07:00
Eric Wasylishen
cc71ad024f
qbsp: origin brush support
...
light: allow model offset on any brush entity with "origin" key set, not just ones with a "rotate_*" classname
2017-01-24 21:39:03 -07:00
Eric Wasylishen
986aad52c2
qbsp: save _mincolor to the .texinfo file
2016-11-02 17:10:01 -06:00
Eric Wasylishen
e5f5b99584
qbsp: bounds check some array accesses
2016-11-02 16:52:12 -06:00
Eric Wasylishen
05447ee0b9
qbsp: use a mtexinfo_t for texinfo before writing to bsp
2016-11-02 16:45:41 -06:00
Eric Wasylishen
1b9d5538c2
qbsp: make BuildSurfaces not rely on map iteration order
2016-11-01 15:07:58 -06:00
Eric Wasylishen
40c090c604
qbsp: SaveFacesToPlaneList: reduce redunant map lookups
2016-11-01 14:58:51 -06:00
Eric Wasylishen
a96aa4de70
qbsp: fix stupid perf bug in BuildSurfaces that I introduced
...
(unnecessary insertions and redundant lookups to a map)
2016-11-01 14:38:50 -06:00
Eric Wasylishen
2094114a18
qbsp: rename brushbsp.c -> .cc and convert tabs to spaces
2016-10-31 20:32:07 -06:00
Eric Wasylishen
27e93b3546
qbsp: import brushbsp.c from https://raw.githubusercontent.com/id-Software/Quake-2-Tools/master/bsp/qbsp3/brushbsp.c
2016-10-31 20:30:34 -06:00
Eric Wasylishen
a6468984bf
all: finish c++ification
2016-10-17 19:52:17 -06:00
Eric Wasylishen
cc12810da3
qbsp: brush primitives support
2016-10-04 22:39:13 -06:00
Eric Wasylishen
e3775e7f09
qbsp: accept absolute paths to map file (thanks lurq)
2016-09-24 12:34:29 -06:00
Eric Wasylishen
299e68e7e5
build: support Ubuntu 14.04
2016-09-23 15:13:58 -06:00
Eric Wasylishen
9340ce223a
build: clean up request for C++11. require cmake 3.1 (which introduced CMAKE_CXX_STANDARD)
2016-08-09 16:00:09 -06:00
Eric Wasylishen
939778bd23
build: add snprintf wrapper from QuakeSpasm (vs2013 compat)
2016-08-06 15:47:40 -07:00
Eric Wasylishen
afbc17d1ea
qbsp, common: raise BOGUS_RANGE to 65536
2016-06-09 01:18:35 -06:00
Eric Wasylishen
7f31e6d4fd
qbsp: don't warn about \b escape sequence
2016-04-29 10:36:26 -06:00
Eric Wasylishen
b087f0f010
build: specify c99
2016-04-18 14:22:33 -06:00
Eric Wasylishen
ed48508070
qbsp: fix usage of offsetof() with a non-compile time constant, was erroring on gcc
2016-03-16 10:55:39 -06:00
Eric Wasylishen
8773e0bb15
build: fix build error on Linux due to missing target_link_libraries(qbsp )
2016-03-16 10:48:00 -06:00
Eric Wasylishen
1340529234
qbsp: add -splitsky and -splitturb, finer control over -splitspecial
2016-04-16 22:53:33 -06:00
Eric Wasylishen
91f321493e
qbsp: fix wrong return type in ParseEntity
2016-04-07 21:11:53 -06:00
Eric Wasylishen
2121e73386
qbsp: fix -onlyents, broken in c++-ifying
2016-04-03 18:20:31 -06:00
Eric Wasylishen
177e037de3
qbsp: better bounds checking for mapbrush_t::face and mapentity_t::mapbrush
2016-03-20 20:02:39 -06:00
Eric Wasylishen
86e92ee6b3
qbsp: add missing include
2016-03-20 14:08:34 -06:00
Eric Wasylishen
60c0b64906
qbsp: change mapdata_t to use std::vector
2016-03-20 14:02:31 -06:00
Eric Wasylishen
f3639eb1e3
qbsp: csg: rewrite planefaces structure to use std::map
2016-03-12 14:23:26 -07:00
Eric Wasylishen
4ee88ede3b
qbsp: turn map.num* into functions
2016-03-12 13:50:24 -07:00
Eric Wasylishen
3db441eea2
qbsp: rename files to .cc
2016-03-12 13:02:28 -07:00
Eric Wasylishen
ecff3f77a8
qbsp: add casts to compile as c++
2016-03-12 13:00:33 -07:00
Eric Wasylishen
923118dfc6
qbsp: convert qbsp.c to c++
2016-03-11 20:43:05 -07:00
Eric Wasylishen
4f66bd7ddc
qbsp: grow texinfo array as needed
2016-03-11 19:30:20 -07:00
Eric Wasylishen
6e94f6a1c2
qbsp: c++ compat changes
2016-03-11 19:25:55 -07:00
Eric Wasylishen
a4c24ac0fa
qbsp: add -objexport flag to export to obj
2016-03-11 18:29:24 -07:00
Eric Wasylishen
41972a376a
qbsp, light: Strip texinfo flags other than TEX_SPECIAL.
...
Write extended ones to a "mapname.texinfo" file.
Support "_dirt" and "_minlight" flags on func_detail/group.
2016-03-05 00:26:54 -07:00
Eric Wasylishen
492d94c1fe
light: new phong shading keys, "_phong_angle" and "_phong".
...
"_phong" "1" is a shortcut for "_phong_angle" "89".
"_phong_angle" sets the max angle in degrees between faces that will get smoothed.
2016-03-02 20:00:05 -07:00
Eric Wasylishen
1a436d8f13
qbsp: fix for comments not incrementing line count.
...
fixes https://github.com/ericwa/tyrutils-ericw/issues/11
2016-02-25 13:17:53 -07:00
Eric Wasylishen
7128a8e956
code formatting, normalize most whitespace to 4 spaces
2016-02-15 16:20:29 -07:00
Eric Wasylishen
1da64c0db4
Fix bspx lump padding logic
2016-02-15 16:20:29 -07:00
Eric Wasylishen
1f05b7976a
fix wrong FindTexinfo call
...
fix Lightmap_ForStyle call
change M_PI to Q_PI
switch to Q_strncasecmp
2016-02-15 16:18:51 -07:00
Eric Wasylishen
1630b8756e
tyrutils-ericw-spike rebased on to 998c9d3acb
2016-02-15 16:16:37 -07:00
Eric Wasylishen
998c9d3acb
qbsp: add hint to use -bsp2 to fix "Too many vertices" error.
2015-12-16 12:27:57 -07:00
Eric Wasylishen
ab268ab9ba
qbsp: CheckFace: print position of non-convex face
2015-12-10 15:58:40 -07:00
Eric Wasylishen
99d5a4d4f9
build: setup CPack to package binaries in a zip file
2015-12-09 16:23:36 -08:00
Eric Wasylishen
dd440699fc
qbsp: remove 128 character limit on key+value line
2015-12-08 23:25:53 -07:00
Eric Wasylishen
063786bf02
build: fix spurious errors in VS2015 IDE
2015-12-07 14:37:46 -08:00
Eric Wasylishen
420125cc67
replace tabs with spaces.
...
for FILE in $(find . -name "*.h" -or -name "*.c"); do cat $FILE | expand > temp; cat temp > $FILE; done
2015-12-07 15:08:48 -07:00
Eric Wasylishen
0ec1c96a06
build: fix warning
2015-12-07 14:40:44 -07:00
Eric Wasylishen
c149ed2bf6
build: VS2015 support
2015-12-07 14:23:13 -07:00
Eric Wasylishen
5face9dd51
qbsp: round texture vector values that are within ZERO_EPSILON of integers,
...
to attempt to attempt to work around corrupted lightmap sizes in DarkPlaces
(it uses 32 bit precision in CalcSurfaceExtents)
2015-12-04 15:49:23 -08:00
Eric Wasylishen
fee62faa24
qbsp: Print coordinates in "CheckFace: too few points" error
2015-11-20 17:15:59 -07:00
Eric Wasylishen
a5a2de6c6f
qbsp: add coordinates to "New portal was clipped away" warning, from txqbsp-xt
2015-10-26 13:42:42 -06:00
Eric Wasylishen
fddb87287a
qbsp: DividePlane: always use bugfix from 7e7d851 regardless of maxNodeSize setting
2015-10-23 17:22:05 -06:00
Eric Wasylishen
0bc85020d2
qbsp: ChooseMidPlaneFromList: mark detail separators on the final SolidBSP pass.
2015-10-19 20:19:25 -06:00
Eric Wasylishen
44e1eccca6
qbsp: change detail handling, from qbsp-xt.
...
MidSplit now does two passes (structural/detail), like ChoosePlaneFromList.
Now, the first pass will pick among planes that have at least one structural face, and zero or more detail faces.
The second pass will pick among planes that have no structural faces, and zero or more detail faces.
This fixes the hull 1 leak in telefragged.map introduced when I added txqbsp's maxNodeSize feature,
and also reduces the cluster and portal count in jam6_ericwtronyn.map a bit.
2015-10-18 14:28:36 -06:00
Eric Wasylishen
ddfa2c7ad5
merge: don't merge detail and non-detail
2015-10-18 00:21:09 -06:00
Eric Wasylishen
a596187841
hexen2 support: fix "qbsp -onlyents" which broke with the hexen2 patch
2015-10-17 01:38:24 -06:00
Eric Wasylishen
a3b985e721
hexen2 support, patch from Spike
2015-10-16 21:18:53 -06:00
Eric Wasylishen
a75de817b1
qbsp: add -epsilon option to set ON_EPSILON, from txqbsp-xt
2015-09-27 00:53:55 -06:00
Eric Wasylishen
7e7d851fdb
qbsp: DividePlane: add missing recalculation of surface bbox for the parallel case.
...
Thanks to rebb for the idea, txqbsp has the workaround in SelectPartition that recomputes the surface bbox; I think this fixes the underlying bug though.
Note: this makes telefragged.map (from the RRP devkit) leak in hull 2.
However, the point file starts at a func_detail staircase that, if turned into func_wall, fixes the leak.
2015-09-16 22:49:33 -06:00
Eric Wasylishen
3322ffb8f3
qbsp: add -maxnodesize option from txqbsp-xt. Defaults to on, nodes with a bbox with any dimension exceeding 1024.
2015-09-16 21:31:44 -06:00
Eric Wasylishen
20901a5a7d
qbsp: update usage text
2015-08-09 13:45:30 -06:00
Eric Wasylishen
3877a213a0
qbsp: use -oldaxis by default
2015-08-09 13:36:13 -06:00
Eric Wasylishen
a7b1ae851b
qbsp: make degenerate edge error in tjunc.c into a warning. from txqbsp-xt.
2015-08-01 20:07:51 -06:00
Eric Wasylishen
9fd7305479
qbsp: make "mixed face contents" error non-fatal if one of the leafnode or face is CONTENTS_EMPTY. from txqbsp-xt.
...
Fixes an issue necros was having.
2015-07-30 18:33:52 -06:00
Eric Wasylishen
3a109ac84d
build: split up cmake build system into subprojects.
...
-DDOUBLEVEC_T now correctly used for qbsp only.
2015-05-05 12:34:39 -06:00
Eric Wasylishen
67cec03ac8
qbsp: fix broken -onlyents option by moving model allocation from map.c to ExportDrawNodes
2015-04-29 16:07:14 -06:00
Eric Wasylishen
ed66ed112e
qbsp: fix texture offset on rotate_object, so they match in the editor. Added "-oldrottex" flag to revert to old behaviour. From txqbsp-xt.
2015-04-29 16:07:07 -06:00
Eric Wasylishen
d77a7d768c
qbsp: switch to hardcoded MAX_MAP_PLANES. counting unique planes was slow
2015-04-25 23:09:35 -06:00
Eric Wasylishen
28e460be9a
qbsp: MakeFaceEdges: accelerate with a hash table to avoid slow O(n^2) search for edges
2015-04-25 22:49:40 -06:00
Eric Wasylishen
1812734037
qbsp: ChooseMidPlaneFromList: fix off-by-one error in axial plane test. On the first SolidBSP pass, gives fewer split nodes on bbin1.map (128k vs 199k)
2015-04-25 21:01:49 -06:00
Eric Wasylishen
5111c5485c
qbsp: account for miptex struct in wad3 lump disksize
...
Here's another little tyrutils patch: in qbsp, I believe the
calculation of the "disksize" field of the miptex lumps when using
WAD3 textures is missing the size of the dmiptex_t struct (40 bytes),
causing the resulting bsp file to be slightly truncated.
I noticed this because one of Tronyn's levels (jam2_tronyn.bsp) was
crashing Quakespasm for me; it turned out the engine was trying to
read 40 bytes past the end of the file when loading the last texture
in the bsp. I got him to send over his map source, wads, and compiler;
he was using tyrutils 0.15 and wad3 format textures, and I confirmed
that this patch fixes the engine crash.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-10-30 12:54:36 +10:30
Kevin Shanahan
90aa616866
qbsp: fix coordinates in degenerate edge error in tjunc.c
...
The error message was actually displaying the edge vector, which is
always going to be ~(0,0,0). Pass in the edge end points and then we
can display both the length of the edge and the location of one end
point.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-05-06 20:30:15 +09:30
Kevin Shanahan
df9c82eb91
qbsp: improve a few error messages using new line number info
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:57:01 +10:30
Kevin Shanahan
06583de238
qbsp: save line number information when generating faces
...
To improve debug messages, save the line number of the faces as we
generate them and in the case of hull generation, save a pointer back
to the source brush.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:55:23 +10:30
Kevin Shanahan
e40c68a8b8
qbsp: use explicit cast to short in ExportLeaf_BSP2 node bounds
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:00:05 +10:30
Kevin Shanahan
fa48825cb5
qbsp: make transparent water the default for visibility calculations
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-24 19:08:46 +10:30
Kevin Shanahan
f9d1f50cf3
qbsp: increase MAXEDGES from 32 to 64
...
Should still be enough stack space... I think.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-24 19:04:57 +10:30
Kevin Shanahan
88db6a79b1
qbsp: remember to ignore func_group entities for -onlyents compiles
...
Otherwise, we break the brush model names (numbering).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-02 15:06:40 +10:30
Kevin Shanahan
e8d1f59d11
qbsp: fix parsing of texture names containing curly braces
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-04 09:21:04 +09:30
Kevin Shanahan
456565d17f
qbsp: add the -2psb command line option to output RMQ style BSP2
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-03 11:09:25 +09:30
Kevin Shanahan
f972f19f39
qbsp: ignore leading path in texture names for Quake 2 compatibility
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:42:25 +09:30
Kevin Shanahan
1196dd8a82
qbsp: ignore extra surface flags found in Quake 2 map files
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:34:59 +09:30
Kevin Shanahan
4a487955c8
qbsp: add a PARSE_OPTIONAL parser flag
...
Enables us to check if there is extra data on the same line, without
advancing the parser past the end of line.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:34:01 +09:30
Kevin Shanahan
ae060bf0fe
qbsp: add any extra animation frames for used textures
...
Search the WADs for extra frames on any animated textures used and add
them to the bsp. This restores the old behaviour which was mistakenly
removed, but now we have the assurance that textures are added in
order and all lower numbered animation frames are added a warning is
printed if it is missing from the wad.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 13:09:45 +09:30
Kevin Shanahan
55d717d3fe
qbsp: fudge miptex count to work around tiny maps with lots of animating textures
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 13:08:10 +09:30
Kevin Shanahan
543d177d66
qbsp: correctly handle func_groups with no solid brushes
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 12:29:41 +09:30
Kevin Shanahan
83686fe0f1
qbsp: consistently use strcasecmp to compare entity keys
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 12:27:53 +09:30
Kevin Shanahan
cb091642c7
qbsp: fix non-solid sky brushes in the collision hulls
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:40:07 +09:30
Kevin Shanahan
50b78f3d61
qbsp, common: support both DP and RMQ variants of the BSP2 format
...
Turns out there are two types of "BSP2" format - one that I think was
created by MH and implemented in the RMQ project (this is the one I
implemented previously) and one by LordHavoc which exteneded the
coordinate limits beyond 32k, implemented in Darkplaces. The
Darkplaces version of BSP2 will get the name BSP2 and the RMQ version,
which is more limited, will get the name BSP2rmq.
qbsp will only create the BSP29 or BSP2 formats, but will cope with a
BSP2rmq format file for an -onlyents compile. The rest of the tools
can use any of the three formats.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 11:48:37 +09:30
Kevin Shanahan
5facda6ff9
common: constify vec3_origin
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 13:30:05 +09:30
Kevin Shanahan
51419621ec
common: add the bsp2/bsp29 data types
...
Rename the default bsp29 data types and add the bsp2 data types to
the common bspfile.h. Propogate the bsp29 names into the other tools as
simple renames for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 13:25:16 +09:30
Kevin Shanahan
69c86e59b8
common: move AMBIENT and MAXLIGHTMAP definitions
...
Keep the ambient sound definitions near the leaf and lightmaps limit near
the face definition.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 12:20:57 +09:30
Kevin Shanahan
58c6335434
qbsp: don't bail out on 65535 verticies for bsp2 output
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 17:09:23 +09:30
Kevin Shanahan
85581b6c0c
qbsp: output leafs, nodes and marksurfaces in bsp2 format
...
This completes the basic BSP2 support.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 17:09:10 +09:30
Kevin Shanahan
ce26465f57
qbsp: output clipnodes in bsp2 format
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 16:39:24 +09:30
Kevin Shanahan
083dc9fda1
qbsp: add output of faces and edges using bsp2 format
...
Won't produce a working bsp2 file yet, but if you ask for bsp2 on the
command line now, faces and edges will be output in bsp2 format.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 16:20:55 +09:30
Kevin Shanahan
9c3613e47f
qbsp: duplicate the MemSizes array for the two BSP formats
...
Kind of taking a step backwards here to where we were, but make the
MemSizes array dynamically changable so that we can switch out and
allocate BSP2 sized elements when we want to write a file in that format.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 14:36:40 +09:30
Kevin Shanahan
bf3ea6374c
qbsp: separate the lump numbering from the memory sizes array order
...
Some of the bsp2 data structures are bigger than the bsp29 structures, so
we need to know the difference in allocation size. Stop using the data
structure enum for lump numbers.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 12:22:21 +09:30
Kevin Shanahan
2d65515d0f
qbsp: add bsp2 data types to bspfile.h
...
In preparation for bsp2 support, add the data types for bsp2 structures
to bspfile.h and rename the bsp29 structures to properly differentiate them.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 10:25:17 +09:30
Kevin Shanahan
32973e6779
qbsp: re-format the memsize global array
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 10:13:11 +09:30
Kevin Shanahan
330d5270dd
qbsp: separate out bspfile.h from qbsp.h
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 09:46:23 +09:30
Kevin Shanahan
d7d6c4939c
qbsp: minor cleanup in FindFaceEdges
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 17:14:36 +09:30
Kevin Shanahan
876ac97cbe
qbsp: small cleanups in GetVertex
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 17:01:24 +09:30
Kevin Shanahan
0269ad8edb
qbsp: show the error margin when non-convex faces are found
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:57:40 +09:30
Kevin Shanahan
aa4f577a6d
qbsp: constify some more arguments to GetEdge
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:41:44 +09:30
Kevin Shanahan
ad25768498
qbsp: exit with error if vertices exceed 65535
...
Unable to represent this in the bsp29 format, so let the user know instead
of silently corrupting the bsp.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:11:41 +09:30
Kevin Shanahan
0bf7fc3374
qbsp: remove ununsed c_tryedges variable
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 15:05:21 +09:30
Kevin Shanahan
ca02e17b60
qbsp: minor cleanups to CheckFace
...
Print the length of the degenerate edge if one is detected,
Rename a few variables, etc.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-16 13:03:45 +09:30
Kevin Shanahan
221d6ca2a3
qbsp: make sure to add animating texture frames in order
...
We take care of adding extra animation frames during loading of the map
file to ensure that we add lower-numbered texture frames before the higher
numbered frames. Most Quake engines will choke on a BSP if the texture
frames are presented out of order (including the original).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-13 16:27:05 +09:30
Kevin Shanahan
272816d24f
qbsp: increase MAXTOKEN to 1024 to cope with long "wad" keys
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-05 10:08:49 +09:30
Kevin Shanahan
e3a5b57ba4
qbsp: add "-forcegoodtree" command line option
...
Normally we build a fast, unoptimized bsp tree for the world before
culling outside surfaces. This command line switch forces the use of
the more expensive algorithm for this processing stage. Seems to have
a positive effect on the final BSP in terms of reduced marksurfaces
and smaller file size, at the expense of longer processing time.
Marked experimental for now, as it may be removed later (either by
making this behaviour the default or removing it altogether).
Credit to Rebb from func_msgboard for implementing this tweak first in
his qbsp util.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-25 13:59:24 +09:30
Kevin Shanahan
7882af13a9
qbsp: replace global face list with local in tjunc_fix_r
...
Explicitly pass the face list around to be added to as needed instead
of implicit reference to the global 'newlist'.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-25 11:00:24 +09:30
Kevin Shanahan
06166f43d8
qbsp: allocate the superface for tjunc fixes dynamically
...
Remove the global static buffer and allocate the superface when
processing tjuncs. Also check that we are not overflowing the buffer
before adding more vertices - probably something went wrong if this
ever overflows, so better to crash with a definite error than scribble
random memory.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-25 10:39:00 +09:30
Kevin Shanahan
53a340ff04
qbsp: trivial typo in comment
...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-24 14:04:23 +09:30