Commit Graph

78 Commits

Author SHA1 Message Date
Kevin Shanahan 35024bfa7d common: make dtexdata a union
Just having one base pointer was kind of annoying because you have to cast
to get to the lump offsets, then cast to byte * to find the miptex, etc.
Now we can access the same pointer using the correct types in each case.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 16:34:30 +09:30
Kevin Shanahan 37a3a98eff common: make WriteBSPFile take a bspdata struct as input
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 15:52:31 +09:30
Kevin Shanahan 9c8cbfd601 vis: add the -noambient* options to disable auto ambient sounds
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-28 08:28:47 +10:30
Kevin Shanahan 34401e91ee vis: change the default testlevel to 4
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-14 11:36:41 +10:30
Kevin Shanahan 7b36c6fd2f build: query git for version info and print consistently for each util
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-07 14:26:14 +10:30
Kevin Shanahan c0f9b19868 vis: add detail brush / prt2 support
First pass at detail support as implemented in tyr-qbsp, using the PRT2
file format (hopefully nobody else already decided to use that?)

Because the "leaf" terminology is pervasive across the source, I've left
it there for now (so "leaf" usually now means "cluster") and added a few
variables with the "_real" suffix when they actually mean the real leafs
and not the clusters which vis still calls leafs. A bit disgusting, but it
actually works so I'll go through and clean up naming, etc. later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-25 12:32:35 +10:30
Kevin Shanahan 3e12ff141d vis: pass the input buffer length into CompressRow
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-25 12:26:19 +10:30
Kevin Shanahan 5c0826168a vis: fix memory leaks in state load/save paths
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-12 09:33:31 +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 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 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 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 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 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
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 2c2f3c8eb6 Import initial sources 2006-08-28 23:58:10 +09:30