Commit Graph

4214 Commits

Author SHA1 Message Date
Tyrann ad964e7f28 trivial: remove some redundant assignments and unused variables 2012-01-06 21:34:47 +10:30
Tyrann ce369bfdd6 Use offsetof() consistently
And include stddef.h where we do use it
2012-01-06 21:32:53 +10:30
Tyrann d20e0cc8d4 Mark cmdlib's Error() function noreturn
Reduces compiler warning noise
2012-01-06 21:00:41 +10:30
Tyrann 7763d7d9fe Rewrite Makefile
Pretty much completely rewrite the Makefile using concepts from my
tyrquake Makefile. So we get quiet compiles, cross compiles and
properly generated dependencies.
2012-01-06 20:57:58 +10:30
Tyrann bcb8e0990d [PATCH] light: increase MAX_TSTACK
Managed to hit this limitation recently, so bump it up.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-01-19 21:21:20 +10:30
Tyrann 8a7304a54d [PATCH] TyrUtils v0.4
Quick release to fix the ongoing saga that is my crappy .lit coloured lighting
support. I really did test it this time...

I bumped the qbsp version as well, just to track the utils "package" version.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-25 11:18:00 +09:30
Tyrann a97a880bd0 [PATCH] light: fix alignment (again) on lit data
I really should do more testing before I embarress myself by releasing stuff
so obviously broken. Use the right pointer to align lit_filebase against.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-25 06:32:10 +09:30
Tyrann 8e774a9b30 [PATCH] TyrUtils v0.3
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 21:08:33 +09:30
Tyrann 9da84b6ee1 [PATCH] qbsp: use fast sphere test in SplitFace
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 21:04:28 +09:30
Tyrann 1d2cc1b780 [PATCH] qbsp: copy face sphere attributes in NewFaceFromFace
Makes sure we maintain the sphere, e.g. in SplitFace.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 21:04:23 +09:30
Tyrann accc80ef2f [PATCH] qbsp: always fix tjunctions, remove option
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 21:04:16 +09:30
Tyrann 11ca5bf377 [PATCH] qbsp: Remove unneeded plane variable
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 20:46:32 +09:30
Tyrann 7ce4402dfc [PATCH] qbsp: Use fast sphere test in FaceSide
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 20:46:28 +09:30
Tyrann 67981816c7 [PATCH] qbsp: Set up sphere around face for fast intersect checks
Set up a sphere around each face so we can do quick tests against planes to
see if there's any chance that it intersects the face. Since we're only using
it for a fast check, don't bother shrinking the sphere when a face gets cut or
split, just grow it when necessary (only in TryMerge AFIACT).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 20:46:22 +09:30
Tyrann 17c994c430 [PATCH] qbsp: Fix mem leak in DividePlane
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 20:46:17 +09:30
Tyrann 20008a120a [PATCH] light: update version number
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 16:54:59 +09:30
Tyrann 9209eec0a1 [PATCH] light: Fix litfile memory allocation
Gah! Brown paper bag material here. Memory for the Lit data was never getting
allocated and writes were happening in no man's land off the end of the
lightdata area.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 16:46:22 +09:30
Ozkan Sezer 4b4da3e2d7 [PATCH] common: SetQdirFromPath fixes and documentation
Add somewhat better documentation for SetQdirFromPath which is actually a
painful functionality. Fixes a couple of corner cases like where the given
path contains no separator characters.

Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Edited-by: Tyrann <tyrann@disenchant.net>

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-08 21:04:50 +09:30
Ozkan Sezer 32d0cd9417 [PATCH] common: fixed a minor bug in ExpandPath of tyrutils
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-08 20:40:47 +09:30
Tyrann 2ef9568778 [PATCH] TyrUtils v0.2
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 21:02:00 +09:30
Tyrann 2ed0beb1c0 [PATCH] qbsp: Tweak epsilons
The choice of the various epsilon values is critical to having geometrically
complex maps compile correctly.

The one which seems most important (so far) is the ANGLE_EPSILON. This one
needs to be quite tight to avoid "bad things" happening when you create small
angles between adjacent surfaces.

Another epsilon inter-relationship I discovered, is that it seems
CONTINUOUS_EPSILON needs to be larger than EQUAL_EPSILON. It seems to play
havoc with the t-junction code otherwise.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann fba05c351a [PATCH] qbsp: Increase MAX_BSP_CLIPNODES
Offsets pointing to clipnodes were originally used as signed short (16-bit)
numbers, so that negative numbers could represent the various content types of
leaf nodes. However, only a small number of these types are required, so we
now make use of the rest of the clipnode range.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann 0a11bfd06b [PATCH] qbsp: Give enough space for the bsp stats output
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann 03edc38292 [PATCH] qbsp: Fix typo in PrintLeakTrail
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann 687d0d03b0 [PATCH] qbsp: Factor out WritePortals portal skip logic
When writing out portals for a node, we can skip over portals that separate
volumes with the same contents. The existing logic I find very hard to follow,
so I've separated that out in an attempt to make it more understandable.

While we're at it, equivalent logic is required in NumberLeafs, so re-use.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann d5f000838f [PATCH] qbsp: Remove big mapentity_t union
Remove the big union in mapentity_t, collecting together the information for
each lump in a struct. Still not 100% sure where I'm going with this, but I
think this will help me with removing some of the reliance on globals further
along (which will be important once it comes to multi-threading).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-21 23:18:56 +09:30
Tyrann 1cfdcdb85a [PATCH] qbsp: Link against math lib
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-21 23:18:56 +09:30
Tyrann e71ab5bf24 [PATCH] qbsp: Remove weird check of cTexdata in qbsp.c::ProcessFile
Ugh, looks like this extraneous line snuck in with commit 6bb3ad32

While I'm here, I see no reason to zero pWorldEnt->cTexdata just above
either. It should already be zero'd memory from the malloc of map.rgEntities.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-21 23:18:56 +09:30
Tyrann 5b9cb50f11 [PATCH] qbsp: Fix AddHullEdge logic
Fix the logic that decided which edges were to be added to smooth the clipping
hulls. The original logic is completely backwards and throws away all the hull
edge clipping planes you want, while potentially keeping the worst corner
cases.

This patch corrects that logic - for that reason, regressions are expected as
we will now be adding more planes to the maps and clipping more things at
wierd angles. Compile times will probably increase and clipping errors will be
more common, at least until some more tuning of the various epsilons is done.

While we're hacking the function, hoist some calculations from the inner loops
up to the outermost loop. Not that this function is that performance critical.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-20 21:21:17 +09:30
Tyrann e1d076bbea [PATCH] qbsp: Re-use PlaneEqual functions in TestAddPlane
Small cleanup to TestAddPlane - re-use the PlaneEqual and PlaneInvEqual
functions and replace the "counts" array with simple booleans to record which
side of the plane has points.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-20 21:21:17 +09:30
Tyrann 01bda0c407 [PATCH] qbsp: Use hash in FindPlane
Use a hash to speed up FindPlane for maps that have huge numbers of
planes. Not many maps have enough planes that this is a win, but those maps
are the ones where speed matters most. :)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-20 21:21:17 +09:30
Tyrann 984d696b46 [PATCH] qbsp: Make NormalizePlane tell us when the plane is flipped
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-20 21:21:17 +09:30
Tyrann de9f49f954 [PATCH] qbsp: Add missing float.h include from last patch
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-20 15:05:37 +09:30
Tyrann 1465e15bea [PATCH] qbsp: Use real int/float/double limits
Instead of just assuming that 9999 or similar is "big enough", use the
implementation defined type limits.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 20:17:23 +09:30
Tyrann 5a4499dc48 [PATCH] qbsp: select better non-axial split planes
Make ChooseMidPlaneFromList a bit more picky about the non-axial planes it
selects. This can matter a lot for maps which have a lot of non-axial-aligned
brushwork (e.g. terrain, etc.) The number of clipnodes can skyrocket if planes
are not chosen with at least a small amount of care.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 20:17:23 +09:30
Tyrann 00132a9ff0 [PATCH] qbsp: Factor out split plane metrics in solidbsp
Factor out the common split plane metric code from the SelectPlane*
functions. While we're at it, make it also work for non-axial planes using the
DivideBounds function.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 20:17:23 +09:30
Tyrann 6add073624 [PATCH] qbsp: implement sloping cuts for DivideNodeBounds
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 20:17:23 +09:30
Tyrann 0b70607015 [PATCH] qbsp: flush stdout when printing messages
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 20:17:23 +09:30
Tyrann 5cd1832e09 [PATCH] qbsp: remove trailing '/' from wadpath
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 05:32:46 +09:30
Tyrann f689c241e4 [PATCH] qbsp: Log to <mapname>.log instead of qbsp.log
To make testing easier, log the output of the job to mapname.log, rather than
qbsp.log. Probably more desirable to make the logfile selectable in the long
term, but this will help for now. Note that we now don't open the log file
until after parsing the command line options, so the Message function needs to
check the file handle before writing to it.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 05:32:46 +09:30
Tyrann 165055db7b [PATCH] qbsp: Add -wadpath option
Add the "-wadpath" command-line argument to allow the user to specify a
directory where wad files can be found. If no wadpath is given, the path
defaults to the directory where the map file is located. Absolute path names
in the worldspawn "wad" key should also work.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 05:32:46 +09:30
Tyrann eb7c5d5cca [PATCH] qbsp: Fix off-by-one error in command line parser string
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 05:32:46 +09:30
Tyrann 6bd69a0519 [PATCH] qbsp: Remove malloc retry logic
If we run out of memory, then too bad. Qbsp never _really_ takes so long that
you'd really care too much about starting again. Simplifies portability.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-19 05:32:46 +09:30
Tyrann b22ed2107a [PATCH] qbsp: Fix subdivide option parse error
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 22:52:02 +09:30
Tyrann c1380abe3b [PATCH] qbsp: Allow arbitrary length command lines
The options are currently parsed as a big text array, so that the parsing
function can be shared with the code to load options from a file. Anyway,
dynamically allocate the array to copy in the command line arguments rather
than restricting it to 512 bytes.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 22:52:02 +09:30
Tyrann c2084c0885 [PATCH] qbsp: Replace hard coded epsilons with defines
Fix numerous places where epsilons have been hard-coded, substituting one of
the defines from qbsp.h.

A couple of epsilons have actually been changed in this patch; the one used to
detect degenerate QuArK texture coordinates has been loosened (so the test is
actually a little more strict). The other is the test for flipped portals. If
my understanding is correct, then result would actually be < 0 if the portal
winding normal flipped, so this change _should_ be harmless.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 22:52:02 +09:30
Tyrann b7f84130de [PATCH] qbsp: Collect all epsilons together in qbsp.h
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 22:52:02 +09:30
Tyrann c221cc2f08 [PATCH] qbsp: Update IntroString / version number
I better replace the IntroString with my own, so it's obvious people are
running a modified version.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 13:47:08 +09:30
Tyrann 2e4a4a917f [PATCH] bsputil: Attempt correct byte-swapping in bsp -> wad export
Untested, but this should be all that is required.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 13:02:07 +09:30
Tyrann 05dab0640e [PATCH] qbsp: Tidy up PrintOptions
Let PrintOptions break the "80-columns" rule; it's less hideous that way.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 12:09:42 +09:30