Commit Graph

269 Commits

Author SHA1 Message Date
Kevin Shanahan a58e461dda qbsp: use local pointer instead of pCurEnt in LoadMapFile()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:53:21 +10:30
Kevin Shanahan 76ba40f621 qbsp: pass entity into Export{Draw,Clip}Nodes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:49:27 +10:30
Kevin Shanahan 6faca2fc86 qbsp: pass entity down through MakeFaceEdges()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:28:09 +10:30
Kevin Shanahan d6bcd02e20 qbsp: pass entity into SolidBSP()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:14:06 +10:30
Kevin Shanahan 3713c4492b qbsp: pass entity into TJunc, capitalise function name
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:09:05 +10:30
Kevin Shanahan 36360e273d qbsp: pass entity down into PortalizeWorld()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:05:45 +10:30
Kevin Shanahan 51b6089318 qbsp: pass entity into CSGFaces()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:01:32 +10:30
Kevin Shanahan 158c422476 qbsp: pass entity into Brush_LoadEntity()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 16:56:56 +10:30
Kevin Shanahan c0430051b9 qbsp: pass brush list into FreeBrushsetBrushes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 16:52:01 +10:30
Kevin Shanahan a6990fb2b6 qbsp: pass entity into AddToBounds
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 16:43:37 +10:30
Kevin Shanahan 262ffab5d5 qbsp: replace last malloc with AllocMem
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-09 17:38:56 +10:30
Kevin Shanahan b5c84dafa3 trivial: whitespace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-09 17:38:36 +10:30
Kevin Shanahan ac75b94345 vis: include unistd.h header for unlink() call
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-09 16:55:19 +10:30
Kevin Shanahan 4161d10a68 vis: add saving and resuming of vis state to/from disk
Inspired by the implementation of Benjt Jardrup, save the current state of
the vis job to disc at regular intervals so that we can resume from that
point in case the computer needs to be rebooted/shutdown or crash/power
issues occur.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-09 16:40:37 +10:30
Kevin Shanahan fb3966eb02 common: use lockless logprint for Error() function
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-09 16:36:35 +10:30
Kevin Shanahan 06e50087ad vis: remove unneeded carriage-returns from output
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-08 16:53:30 +10:30
Kevin Shanahan f1dcf001ab common: don't interrupt thread progress when no threads running
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-08 16:51:36 +10:30
Kevin Shanahan 0e343c4cf8 build: fix linking utils with pthreads
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-08 16:47:17 +10:30
Kevin Shanahan a56030fad0 common: make logprint properly interrupt the thread progress display
Logprint will notify the threads code that the progress meter has been
interrupted and the progress meter will re-print the next time it needs to
be updated.

Unfortunately this makes all the utils depend on the thread code, but not
a big issue.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-08 16:37:48 +10:30
Kevin Shanahan 742fa4b6e5 common: fix progress indicator when start > 0
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-08 15:09:45 +10:30
Kevin Shanahan 3382f9ca96 common: catch up thread progress bar if not starting from zero
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 21:14:14 +10:30
Kevin Shanahan 8d4bbbe3dc light: use the common threads progress indicator
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 21:12:53 +10:30
Kevin Shanahan 3e20dae28e common: add start arg to RunThreadsOn to set initial progress
In case we are not starting work from 0, allow this to be set...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 20:51:04 +10:30
Kevin Shanahan 853761d0d6 common: remove pacifier argument from RunThreadsOn
Set to true everywhere, just use it unconditionally.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 20:46:33 +10:30
Kevin Shanahan f0d3172d77 vis: calculate shift from loop variable instead
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 19:44:48 +10:30
Kevin Shanahan 148b07ef17 vis: remove old progress output message
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 19:38:36 +10:30
Kevin Shanahan 37a9935643 common: remove commented out "less portable" timing code
Precise timing is not important for the job vis does.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 19:36:16 +10:30
Kevin Shanahan 6ea82e47b0 vis: remove some code from old threads implementation
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-19 12:37:32 +10:30
Kevin Shanahan 815fd70265 vis: use leafbits_t struct and helpers to represent vis bit strings
Importing parts of this from TyrQuake - means that the base type used for
managing the bit vectors is unsigned long. Not really a performance win or
anything here, just a bit nicer to not have to cast from (byte *) to
(long *) - just adds a little extra work before writing out the compressed
data.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-19 12:12:47 +10:30
Kevin Shanahan 498286faa1 common: output thread progress in 2% increments
Provides a bit more granularity than the old meter which only updated
every 10%.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-18 17:49:08 +10:30
Kevin Shanahan c5ecfad903 common: flush stdout after printing log messages
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-18 17:48:51 +10:30
Kevin Shanahan 0192b3d732 vis: remove the MAX_PORTALS limit
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 17:49:20 +10:30
Kevin Shanahan ecb66fb2aa vis: convert full vis to use the thread progress code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 14:01:26 +10:30
Kevin Shanahan b538bed05f trivial: whitespace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 11:29:11 +10:30
Kevin Shanahan 686d4451b8 vis: thread the base portal vis
Make the base portal vis thread safe and run on multiple threads. Use the
common thread progress indicator code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 11:27:29 +10:30
Kevin Shanahan c42f0e26b4 vis: use the common threads code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 10:38:50 +10:30
Kevin Shanahan af9da631fd vis: create two separate verbosity levels
Add -vv option to hide extra verbose messages behing. Move a couple of
debug messages to the extra verbose level.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 10:22:55 +10:30
Kevin Shanahan 662a745202 qbsp: use correct array indicies comparing texinfo
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 09:38:44 +10:30
Kevin Shanahan 7ee8bc183b light: use the common threads code
Make light use the common threads code.
The common progress indicator code is still not used.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 09:35:26 +10:30
Kevin Shanahan 557a1faf20 common: make the common thread code usable on Win32/Linux
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 09:33:50 +10:30
Kevin Shanahan 2bbcdff931 vis: Try to propogate some extra vis info from completed portals
When a portal is completed, check the updated vis information for leafs
that can no longer be seen from the leaf the portal is attached to. Update
the portals on these no-longer-visible leaves to indicated that they can
no longer see our leaf.

Seems to be at least a small gain on my test maps. I suspect there is
some further improvement to be gained by taking better advantage of this
optimisation by changing out choice of portals in GetNextPortal. Couldn't
find anything trivial that worked though.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 09:30:56 +10:30
Kevin Shanahan 725da016a4 vis: use INT_MAX in GetNextPortal
Tidy up variable names a little.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-25 21:30:00 +10:30
Kevin Shanahan a10316d7c9 vis: rename vstatus to pstatus
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-25 21:28:20 +10:30
Kevin Shanahan 0908b25f47 build: don't need (or want) -W arg to pwd on Windows
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 21:59:29 +10:30
Kevin Shanahan 1c8137d400 light: remove stale comment about MAXLIGHTMAPS
Yes, it really is 4.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:54 +10:30
Kevin Shanahan ef6c4c30c5 light: remove unused accounting variable
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:40 +10:30
Kevin Shanahan c51eb01291 light: remove workaround for old compiler bug
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:10 +10:30
Kevin Shanahan 6fab0a5358 light: make pthreads support work
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:14:39 +10:30
Kevin Shanahan f85b221da6 common: fix varargs use in log{,v}print
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 13:02:41 +10:30
Kevin Shanahan e100c9642b common: add prinf format attribute to logprint/logvprint
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 13:02:19 +10:30