Concatenated source (Linux port project)
========================================

bjptools 09/09/08	// gb

1. Made treeqbsp compile and work under Linux; commented out
   the problem code (wildcard in wad paths, wad.cpp) for now.
   So you should all make proper wads for your maps.
2. All tools log to hidden files (like .qbsp.log) now.
3. Included txqbsp source + set up the Makefile for it.
4. Included treeqbsp 1.62 source for reference, may be removed later.
5. Included Willem's threading vis/light code for reference;
   implementation pending.
6. Found out the .cpp files are (C) Greg Lewis (from original Treeqbsp).
   Included copyright notice and GPLed them (no apparent other license.)


bjptools 09/07/08	// gb

1. Concatenated vis/light/bspinfo and treeqbsp source
2. Cleaned up directory structure (added common/)
3. Added Linux Makefile
4. Made vis and light compile under recent Gentoo Linux
5. Ported most of qbsp (stopped at wad.cpp)
6. Added id copyright note to id's files and added COPYING
7. Broke down existing readmes into README, AUTHORS and Changelog
8. Added PORTING to monitor porting progress
9. renamed C++ header files to .H


Enhanced TreeQBSP
=================

The changes from the TreeQBSP 1.62 source code are as follows :

TreeQBSP 2.05 (Apr 10 2007)

1. Fixed rare crash bug when calculating MakeFaceEdges.


TreeQBSP 2.04 (Dec 4 2006)

1. Fixed bug when having >32k clipnodes.


TreeQBSP 2.03 (Jul 27 2005)

1. Fixed premature abort/crash bug that occurred when having curly braces or parenthesises in
   texture names.
2. Added coordinates to several portal error messages.


TreeQBSP 2.02 (Mar 10 2005)

1. Increased plane capacity again to avoid compiler sometimes aborting with error message "Internal
   error: numbrushplanes >= cPlanes" due to new hull expansion.


TreeQBSP 2.01 (Feb 12 2005)

1. Improved handling of complex maps such as terrain. This is done by increasing precision when
   identifying unique planes (faces) and modifying hull expansion logic. This reduces the risk of
   clipping errors and creates much smoother clipping hulls which can help player/monster
   movements.

   All maps don't benefit from this, therefore two new options have been introduced; "-oldexpand"
   which just disables the new expansion logic and "-epsilon x" (default 0.01) which sets the
   plane identifying tolerance. To revert to previous compiler behaviour, just add options
   "-oldexpand" and "-epsilon 0.05".

   The default settings have been chosen for overall best results. If you have a big map that
   still doesn't build correctly, you can try lowering the epsilon even more, e.g. 0.001. In most
   maps the default settings have little effect on # clipnodes, but some maps can see either a
   significant increase or decrease. Thanks to Tyrann for this one.
2. Removed option "-altexpand" as it's replaced by the new logic.
3. Increased MAX_FACES (# faces on a brush) from 128 to 512 to accommodate the new hull expansion.
4. Increased plane capacity again to avoid compiler sometimes aborting with error message "Internal
   error: numbrushplanes >= cPlanes" due to new hull expansion.
5. Changed some of the "Brush not closed" warnings into "Too few/many faces in brush" and kept the
   brush if possible.
6. Added coordinates to the "Found a non-convex face" error.
7. Fixed minor bugs in verbose printout handling.


TreeQBSP 2.00 (Oct 1 2004)

1. Changed warning for # faces exceeding normal engine capacity from 64k to 32k.


TreeQBSP 1.99 (Sep 11 2004)

1. Added new option "-q2map" that enables support for Q2/Q3 map file format from editors like
   GtkRadiant. Thanks to Riot for this one.
2. Added automatic healing to point off plane warnings by adjusting the points to the plane.
3. Added error messages for various objects exceeding theoretical bsp limits.
4. Added warnings for various objects exceeding normal engine capacity.


TreeQBSP 1.98 (May 22 2004)

1. Minor improvement of compiling speed for maps that spend a lot of time in the SolidBSP stage.
   Thanks to Tyrann for this one.
2. Added coordinates to the "Face coordinate out of range" error message.


TreeQBSP 1.97 (Apr 23 2004)

1. Added a check for each axial brush forming a closed volume. If a brush is not closed, the bsp
   file might get corrupt and crash the engine.
2. Added error messages for various objects exceeding theoretical bsp limits.
3. Added warnings for various objects exceeding normal engine capacity.
4. Removed the clipnode limit of 32k, but there will still be a warning.


TreeQBSP 1.96 (Mar 8 2004)

1. Fixed a crash bug that occurred when using "-onlyents" with a map without brushes. Bug was
   introduced in 1.90.
2. Added support for wildcard "*" in wad file specifications, e.g. "c:\wads\*.wad".
3. Added new option "-verbosetex" to enable more texture information printout. At this time, it
   will print the wad name for each found texture. Using "-verbose" will also enable this.
4. Added a correction when using Valve 220 format and texture scale 0. It will now be set to 1,
   same as Classic Quake format.
5. Changed some memory printout texts for clarity.


TreeQBSP 1.95 (Feb 18 2004)

1. Added support for Valve WAD3 format.
2. Fixed a bug that in large maps sometimes could produce a crippled leak line.
3. Improved results when using the "-altexpand" option. This sometimes helps reducing # clipnodes,
   getting rid of leaks or clipping errors. Thanks to XP-Cagey for this one.
4. Moved the missing texture handling to the beginning of map processing.
5. Added new option "-nofillvis" which disables filling of hull 0 (the visible hull). This can
   shorten the turnaround time when compiling large maps that spend a lot of time in the hull 0
   SolidBSP stage. Note that no portal (prt) file is generated and the produced bsp may not be
   loadable in the engine.
6. Added new option "-hilimit" to set a special extreme capacity mode. When enabled, some bsp
   format limits (e.g. max # nodes) can be exceeded. Use with caution.
7. Added detection of file seek errors.
8. Restored printout of animating textures if not 0.
9. Changed bsp summary printout for higher capacity.


TreeQBSP 1.94 (Feb 3 2004)

1. Added support for Valve 220 map file format from editors like WorldCraft 3.3 and Hammer.
   However, wads still need to be in WAD2 (standard Q1) format. See also notes below. Thanks to
   Riot for this one.


TreeQBSP 1.93 (Jan 29 2004)

1. Added coordinates to the "New portal was clipped away in CutNodePortals_r" warning message.
   This warning indicates brush misalignments.
2. Minor code cleanup.


TreeQBSP 1.92 (Jan 11 2004)

1. Added new option "-noents" that removes all entities except world and players. This is very
   convenient when dealing with architecture related problems. Recommended together with the
   "-solid" or "-hull #" options.
2. Fixed a bug that sometimes caused incorrect face and brush summary printout.


TreeQBSP 1.91 (Nov 24 2003)

1. Added a warning for different # models in bsp and map when using "-onlyents".


TreeQBSP 1.90 (Sep 18 2003)

1. Increased plane capacity to avoid compiler sometimes aborting with error message "Internal
   error: numbrushplanes >= cPlanes".
2. Fixed a crash bug which occurred when the world wasn't the first entity.
3. Added a check for no entities in map.


TreeQBSP 1.89 (Aug 26 2003)

1. Fixed a crash bug that could occur if using a rotate_object with a target that had no origin
   key. Also, improved information for bad rotate targets and removed repeated printouts.
2. Changed error "Too few faces in brush" into a warning.
3. Changed warnings "No entities in empty space ..." and "No info_player_start ..." into critical
   warnings (always printed).
4. Added line # to the "Multiple info_player_start ..." warning message.


TreeQBSP 1.88 (Jul 29 2003)

1. Added coordinates and texture printout to the "Didn't split the polygon in SubdivideFace ..."
   error message. This error usually means that a texture is scaled too small.


TreeQBSP 1.87 (Jul 15 2003)

1. Improved compiling speed for maps that spend a lot of time in the CSGFaces stage. There is a
   new option "-oldcsg" if you prefer the old method. Thanks to Tyrann for this one.
2. Added new option "-altexpand" that enables an alternative brush expansion method. This might
   help solving some clipping errors. Beware that # clipnodes normally increases. Thanks to Tyrann
   for this one.
3. Reduced memory requirements, typically about 25%.
4. Added new option "-priority #" to set the thread priority 0-2 (below/normal/above, default 1)
   in order to make the compiler more flexible in the Windows environment.
5. Added printout of map title ("message" in worldspawn).
6. Changed warning "No valid wad files ..." into a critical warning (always printed).
7. Improved linearity in the SolidBSP progress feedback.


TreeQBSP 1.86 (Jun 11 2003)

1. Added new option "-numpercent" to select a numerical progress indicator instead of the default
   bars. Note that this only works properly in the operating system console.
2. Removed progress info from the first SolidBSP part.


TreeQBSP 1.85 (May 18 2003)

1. Added new option "-expand #" which makes all brushes expand a selectable distance (recommended
   values are 0.5-2.0). This will have the effect of automatic sealing of tiny gaps that cause
   leaks. However, brush overlaps and therefore compile time will increase. Some texture issues
   may also occur, since the compiler adds new faces that lacks specific texture info.
2. Added new option "-nofillclip" which disables filling of hull 1 (the player clipping hull).
   This can help when having troublesome clipping problems, i.e. the player walking/falling
   through walls/floors. Beware that # clipnodes will increase and may exceed the limit in large
   maps.
3. Added new option "-hull #" that selects which hull (0-2, default 0) that should be made
   visible. This is highly experimental and should only be used for tracking down difficult leaks
   in hulls 1/2 or educational purposes. Look out for HOM effects in hulls 1/2, that might
   indicate clipping errors.
4. Added new option "-percent" to be used after "-quiet".


TreeQBSP 1.84 (May 14 2003)

1. Changed option "-leak #" to select which hull (0-2) to generate a pointfile for. Default value
   is -1, which means any hull. As before, by selecting an invalid hull # (e.g. 3), you might be
   able to force the output of a prt file even if there is a leak.
2. Added new option "-solid" which removes all liquid worldbrushes and treats sky as solid. This
   can be really helpful when hunting for leaks and/or increasing loadability in the engine.
3. Changed error "CheckFace: Face with too few ..." and some of the "Mixed face contents ..."
   errors into warnings.
4. Added new option "-quiet" which just enables "-noverbose -nowarnings -nopercent".


TreeQBSP 1.83 (Apr 3 2003)

1. Improved check for invalid wad files.
2. Added line # to and removed entity information from the "Entity with no valid brushes" error
   message.
3. Added line # to the "No target for rotation entity" warning message.
4. Added new option "-nowarnings" which disables most warning printouts to screen.
5. Added printout of total # warnings.
6. Changed the various verbose options so that log file will always be unaffected by limiting
   options like "-noverbose". Also, "-verbosemem" will now only cause output to log file. This
   makes it possible to have a really compact screen printout but still have all details in the
   log file. Try options "-noverbose -nowarnings -nopercent" and see how it looks.
7. Added filename to general file handling errors messages.


TreeQBSP 1.82 (Mar 11 2003)

1. Fixed a bug where the compiler could generate a bsp with too many clipnodes (max = 32767). This
   could happen when the worldbrush clipnodes were less than the limit, but adding the entity brush
   clipnodes would cause overflow.
2. Added a check for multiple world entities.
3. Added a check for entities with empty "classname" key.
4. Improved line information when checking entities.


TreeQBSP 1.81 (Feb 17 2003)

1. Removed "Total" column from verbose memory summary printout due to overflow risk.


TreeQBSP 1.80 (Nov 15 2002)

1. Fixed a crash bug that could occur if there were no brushes in the worldspawn entity.
2. Fixed a crash bug that could occur if there was an entity without the key "classname".
3. Added a check for too few faces in a brush. Now there must be at least 4 faces in each brush.


TreeQBSP 1.79 (Aug 19 2002)

1. Fixed a bug which caused the compiler to abort if the warning message "... Brush plane with no
   normal" occurred.


TreeQBSP 1.78 (Jul 24 2002)

1. Added map file line information to the error message when exceeding MAX_FACES (128).


TreeQBSP 1.77 (Jul 16 2002)

1. Added automatic sorting of brush faces while loading the map file. The compiler is very
   sensitive to different face ordering so the deterministic sorting has two benefits. The first
   is independence of the editor saving order, especially QuArK has problems with this. The second
   is that the sort order has been chosen in an attempt to minimize error/warnings and to increase
   speed in most maps. There is a new option "-nosortface" to disable this behaviour.
2. Added map file line information to the "Couldn't create brush ..." warning message.
3. Fixed a bug that was causing data corruption when exceeding MAX_FACES (128).


TreeQBSP 1.76 (Jun 25 2002)

1. Improved compiling speed when there are large brushes covering parts of the map (for testing
   purposes). Thanks to Tyrann for this one.


TreeQBSP 1.75 (Jun 14 2002)

1. Fixed a bug in the simplified leak line handling. This seems to cure the problem where the line
   sometimes goes right through solid brushes. The simplification process is now also a lot
   faster. Thanks to Tyrann for this one.
2. Added new option "-simpdist #", which sets the "simplification distance" (default 100) that
   is used when simplifying the leak line. Lower values can make the process faster but the line
   will probably be longer.


TreeQBSP 1.74 (Jun 6 2002)

1. Added new option "-fill", which will force filling in hulls 1/2 when there are leaks. This is
   very useful in large maps when the leaks cause the max # clipnodes (32767) limit to be exceeded
   which aborts the compile. The forced filling will probably cause the player and most other
   entities to be stuck when loading the map in Quake. Use noclip to move around and find the
   leaks by loading the pointfile.
2. Changed logic of the simplified leak line. This results in a slightly longer leak line but the
   position of the hull breach is more precise and the process is faster.
3. Increased the default value for the distance between dots in pointfiles from 2 to 4. This cuts
   the total # dots in half while still maintaining a visible trail.
4. Added validation of the "-leakdist" option value.
5. Added a progress bar to leak line simplification when it's lengthy.


TreeQBSP 1.73 (May 21 2002)

1. Fixed a bug that caused bsp corruption when using option "-onlyents" (only update entities).
2. Added check to prevent using a sourcefile with the extension ".bsp".


TreeQBSP 1.72 (May 8 2002)

1. Added support for enhanced texture positioning in QuArK. The standard format is still
   automatically supported. If you are using QuArK and don't want the new support, it can be
   disabled with a new option "-oldtexpos". See also notes below.


TreeQBSP 1.71 (Apr 15 2002)

1. Increased MAXEDGES from 32 to 64. This allows more complex brush arrangements in the map.


TreeQBSP 1.70 (Mar 4 2002)

1. Increased floating point precision from float (32-bit) to double (64-bit). This helps avoiding
   problems in some maps and improves tjunction calculations.
2. Due to the increased precision, memory requirements nearly doubled. To compensate for this,
   another reduction was made and requirements are now about the same as before.
3. Changed hull file handling. If they exist at startup, they will be removed to avoid confusion.
4. Removed option "-noclip" as it didn't work anyway.


TreeQBSP 1.69 (Feb 14 2002)

1. Reduced memory requirements, in some situations up to 40%.
2. Doubled map file loading speed.
3. Increased MAXTOKEN (size of a token string in the map file) from 256 to 1024.
4. Added new option "-verbosemem" to enable extra memory printout without extra map info.
5. Changed verbose memory summary printout slightly.


TreeQBSP 1.68 (Jan 29 2002)

1. Fixed a bug where the prt file was generated twice. Also changed the Portalize printout
   slightly.
2. Added coordinates to the "Face with too few points ..." error message.
3. Added # faces and texture (max 4 unique) printout to the "Couldn't create brush faces" warning
   message.
4. Changed prt file handling so vis portals between adjacent sky brushes are only generated when
   option "-transsky" is used (not recommended).
5. Fixed a small memory leak.
6. Minor adjustments to handle larger values in printouts of big maps.


TreeQBSP 1.67 (Jan 14 2002)

1. Increased MAX_HULL_POINTS from 64 to 512 and MAX_HULL_EDGES from 128 to 1024. In some maps you
   could get a "Internal error: num_hull_points ..." message which aborted the compilation.
2. Fixed a bug in the MakeFaceEdges calculations. In some maps you could get a "Internal error:
   map.rgEntities[map.iEntities].iVertices ..." message which aborted the compilation.
3. Added simple progress bars to calculation intensive parts. The bars display one character for
   each 10% completed and the positions for 50% and 100% are marked with a '+', i.e. "----+----+".
4. Added handling of a default wad file. If no wad files are specified or none can be found, then
   a wad file with the same name in the same directory as the map file will be used.
5. Added face contents printout to the "Mixed face contents" error message.
6. Added entity printout to the "Entity with no valid brushes" error message.
7. Added check for too long texture names in map file.
8. Restored the defaults for the "-nopercent" option due to the new progress bars.
9. Fixed bugs in general path name handling.
10.Fixed bugs in the _wad/wad key handling.
11.Changed coordinate printouts slightly.
12.Improved internal error handling slightly.


TreeQBSP 1.66 (Jan 2 2002)

1. Added entity classname to the leak printout (e.g. "item_shells").
2. Fixed a bug in memory summary calculations and changed printout slightly.
3. Fixed a bug in printout of "Degenerate edge" error and turned it into a warning.
4. Changed elapsed time printout slightly.


TreeQBSP 1.65 (Dec 13 2001)

1. Added new option "-leak #" (default 1) to select which leak to generate a pointfile for. Note
   that when using an invalid leak # (e.g. 0), you might be able to force the output of a prt
   file even if there is a leak. The Vis process will probably be substantially extended in this
   case.
2. Improved handling of texture names when used in mixed upper/lower case in map/wad files or when
   there are ending garbage characters in wad files. This probably covers the undocumented changes
   made between version 1.62 to 1.63. Thanks to Maddes at Quake Info Pool
   (http://www.inside3d.com) for this one.
3. Reversed the defaults for the "-tjunc" option. Now you must add "-notjunc" to disable tjunction
   calculations. Most people will want to keep it enabled, since it can significantly reduce the
   "sparkle" effect between brushes in GLQuake. Enter "gl_clear 1" in the GLQuake console, move
   around in the map and look at the walls to more easily see this effect.
4. Fixed log file so it flushes to disk while running.
5. Fixed a small memory leak.
6. Fixed a file handle leak.
7. Fixed a bug in the printout of the por file name.


TreeQBSP 1.64 (Dec 4 2001)

1. Added support for floating point values in map files. This makes it very usable in QuArK as an
   alternative to TxQBSP, especially for low-end systems. However, there is no support for the
   enhanced texture positioning scheme used in QuArK. Also note that TreeQBSP still handles
   normal integer map files if you use another editor.
2. Improved handling of pointfiles when there are leaks in different/several hulls.
3. Improved speed of leak line simplification ("new style") and added a descriptive message.
4. Improved display output in the QuArK console so it updates while running.
5. Fixed a bug in the por file (alternate pointfile for BSP editor) generation.
6. Fixed a bug in the "-subdivide" option handling.
7. Fixed a bug in map file line counter (used in warning/error messages).
8. Added the VC compiler switch /Op ("Improve floating point consistency") which eliminates the
   differences in results that otherwise occur between debug and release version of the TreeQBSP
   program. This is a rather significant matter, since one of the points with QuArK seems to be
   improved precision in calculations. Unfortunately, this disables some optimization and makes
   the program slower (~20-30%). Better slow than sorry ...
9. Reversed the defaults for the "-nopercent" option. Now you must add "-percent" to enable
   percent completion information.
10.Improved visual information for several warnings/errors.

============================================================================================

Enhanced RVis/Light/BspInfo utilities
=====================================

The changes from the original Vis, RVis, Light and BspInfo source code are as follows :

RVis 2.31, Light 1.43 and BspInfo 1.27 (May 1 2006)

1. Light: Fixed a crash bug that could occur when the warning "Texture axis perpendicular ..." was
   printed. This also means that the printed coordinates have been invalid.
2. Added many more checks for corrupt bsp data. The checks are always enabled for RVis and Light,
   while BspInfo needs the new option "-chk" to do the same.
3. BspInfo: Improved so errors during bsp load will not abort program when using wildcards.
4. RVis: Changed so verbose printout will update better and now always contains the extra progress
   bar for each portal.


Light 1.42 (Dec 28 2005)

1. Fixed a bug that could cause invalid lighting when using "-soft" and "-tyrlite"/"-tyrlite95"
   options together with overriding worldspawn minlight with a lower value from command line.
2. Changed so all non-light entities that has a "light" key will also be considered unsourced
   lights.


Light 1.41 (May 23 2005)

1. Added multi target check for any entity except lights. This means that any "target*",
   "targetname*" or "killtarget*" will match each other, e.g. "target" "name" will match
   "targetname3" "name" or "killtarget10" "name". Max 16 targets are allowed for each of the three
   variants in each entity.
2. Added warnings for potentially missing triggers also for trigger_teleports.
3. Added warning for missing targetname for func_spawn*.


RVis 2.30 (Mar 25 2005)

1. Added new options "-noambient", "-noambientlava", "-noambientsky", "-noambientslime", and
   "-noambientwater" to better control ambient sounds.


Light 1.40 (Feb 14 2005)

1. Improved handling when the warning "Too many light styles ..." appears. If "-soft" option is
   enabled, normal light (style 0) and minlight will always be kept since they are most likely
   dominant. Also added warning when minlight overrides. 
2. Added warnings for potentially missing triggers in each skill. Only specific targets are
   checked (all func_* and most trigger_*). The warnings can be disabled with the "-noskill"
   option.
3. Added new option "-nowrite" which does the same as "-onlyents" but with bsp write disabled.
   Useful when only checking entities.
4. Disabled "Elapsed time" printout when using options "-onlyents" or "-nowrite".


Light 1.39 (Oct 29 2004)

1. Added new option "-shadowsense #" which sets the angle (shadow) sensitivity for 2nd sunlight,
   see details below.
2. Added new option "-sunlight3 #" and "_sunlight3" key which just enables 2nd sunlight and at the
   same time sets the shadow sensitivity to 0.4, see details below.
3. Added warning for having targeted (switchable) sourced lights.


Light 1.38 and BspInfo 1.26 (Oct 5 2004)

1. Light: Added new option "-gate #" which enables Fade Gate (default 0.0). This can dramatically
   speedup processing with only minor light distortion, recommended gate value is 1.
2. Light: Speedup of maps with many spotlights.
3. Light: Added new option "-tyrlite95" which enables closer TyrLite 0.95 emulation, see details
   below.
4. Light: Added new option "-noanti" which disables antilights.
5. Light: Added warning for having targeted (switchable) lights with style < 32 set (style
   overrides).
6. Light: Fixed bug when having targeted lights with style < 32 set.
7. Light: Fixed bug when using "-noflash" option and having targeted lights with style < 32 set.
8. BspInfo: Changed warning for # faces exceeding normal engine capacity from 64k to 32k.


Light 1.37 (Sep 21 2004)

1. Fixed a serious bug that invalidated light data when using "-onlyents" option. Bug was
   introduced in 1.36.


RVis 2.29, Light 1.36 and BspInfo 1.25 (Sep 13 2004)

1. Light: Changed error "Bad surface extents" into a warning with more information. Ignoring this
   might cause bad lighting in the specified area. One cause is excessive # vertexes in bsp.
2. Light: Added printout of # light casts that will be made. This is the product of the total
   amount of light emitting objects and the total amount of surface points. It is not affected by
   the "-fast" option.
3. RVis: Speedup of ambient sound calculations.
4. Light: Added detection of entity compression when using the "-detect" or "-unsup" options.
5. Light: Added texture name to several messages.
6. Light: Increased stack in raytracing from 64 to 128 for more complex maps.
7. Light: Added check for too many nodes in bsp.
8. BspInfo: Added warnings for various objects exceeding normal engine capacity.
9. Fixed a crash bug when a bsp lump object was partly beyond filesize.


RVis 2.28 and Light 1.35 (Aug 14 2004)

1. RVis/Light: Added new option "-priority #" to set the thread priority 0-2 (below/normal/above,
   default 1) in order to make the program more flexible in the Windows environment.
2. RVis: Strengthened check for portal file consistency.
3. RVis: Minor improvement in the linearity of the extra progress bar in slow portals.
4. Light: Added printout of # disabled flashing lights when using the "-noflash" option.


RVis 2.27, Light 1.34 and BspInfo 1.24 (Jul 2 2004)

1. Light: Fixed a bug that could cause light distortion if a non-light entity had a delay 4 (local
   minlight) key. Map must also use minlight and not options "-oldlight" or "-iklite". Bug was
   introduced in 1.30.
2. Light: Fixed a bug that caused minor light distortion when using "light" (minlight) key in
   worldspawn. This light would be cast as normal light entity in addition to its minlight
   function.
3. Light: Fixed a bug that could cause minor light distortion when using additive minlight in maps
   with sunlight.
4. Light: Fixed a bug that disabled 2nd sunlight if sun mangle wasn't explicitly set.
5. Light: Fixed a bug that caused sunlight to be slightly different depending on whether sun
   mangle was explicitly set or not. In some emulation modes, the old behaviour is maintained.
6. RVis: Fixed a crash bug when portal (prt) file was inconsistent (too few portalleafs).
7. RVis: Added check for bsp+portal file mismatch.
8. RVis: Added warning for bsp+state file mismatch when loading state file.
9. RVis: Added more info to several error messages.
10.BspInfo: Fixed minor bug when using "-cutvislight" option.
11.BspInfo: Minor light statistics printout change.


RVis 2.26, Light 1.33 and BspInfo 1.23 (Jun 2 2004)

1. Light: Added new option "-solidsky" that enables also solid sky brushes to cast sunlight. This
   method isn't perfect but normally it produces pretty good results.
2. Light: Fixed a bug that prevented the "-oldlight" and "-iklite" options from disabling
   antilights.
3. Light: Fixed a bug that sometimes caused minor light variations when using the "-oldlight" or
   "-iklite" options.
4. Light: Fixed a bug that caused invalid lighting when light entity keys "target" or "targetname"
   were set to empty strings ("").
5. RVis: Fixed a crash bug when all textures were missing in bsp.
6. RVis: Minor speedup and memory reduction.
7. BspInfo: Fixed minor bug in light statistics printout.
8. BspInfo: Minor printout change.


Light 1.32 and BspInfo 1.22 (May 6 2004)

1. Light: Added support for new attenuation formula (delay 5 lights), see details below. Thanks to
   Kinn for this one.
2. Light: Added new option "-kinn" which translates all delay 2 lights into delay 5.
3. Light: Added new option "-addmin" which enables additive minlight (same as ArghLite). This may
   help reducing the sometimes uniform minlight effect.
4. Light: Changed so sunlight isn't affected by the additive minlight in ArghLite emulation.
5. Light: Minor speedup.
6. Light: Minor improvement of TyrLite emulation when using antilights.
7. Light: Added printout of total capped light amount when using the "-lightcap" option.
8. BspInfo: Added warnings for various objects exceeding normal engine capacity.
9. BspInfo: Fixed a crash bug when using option "-prt" on a bsp with too many nodes or leafs.
10.BspInfo: Added printout of # fullbrights (light > 255) when using the "-lightstat" options.


Light 1.31 (Apr 14 2004)

1. Added recognition of a new key "_softangle" in each light entity that sets the angle of an
   inner spotlight cone for a softer transition, see details below.
2. Expanded the "-fast" option so you can now also specify "-fast #" (default 2, same as before).
   Higher values are faster but with less quality, recommended values are 2-8. Light quality
   varies greatly with map but should be sufficient for checking general light levels.
3. Added new option "-onlyents" which only updates switchable light entities and doesn't alter the
   actual light data. This is convenient after doing an "-onlyents" run with qbsp which might
   disable switchable lights.
4. Added new option "-srclight" which disables all unsourced light entities (classname "light").
5. Added new option "-noglobrange" which disables global range. Only useful with "-arghlite" or
   "-tyrlite" options.
6. Fixed a bug which sometimes caused minor light distortions when using "-fast".
7. Fixed a bug which caused minor light variations when using sunlight, odd range values and not
   "-globrange".
8. Fixed a bug which sometimes caused entity "style" keys to be incorrectly omitted.
9. Disabled usage of the "_anglesense" key in local minlights.


RVis 2.25, Light 1.30 and BspInfo 1.21 (Mar 18 2004)

1. Light: Added support for local minlights (delay 4 lights), see details below.
2. Light: Added new option "-anglesense #" which sets the angle sensitivity globally, see details
   below.
3. BspInfo: Added new option "-copyents" which copies all entities in the bsp and writes them to a
   text file with extension ".ent".
4. Fixed a bug which aborted bsp load if there was a texture index table but all textures were
   missing.


RVis 2.24, Light 1.29 and BspInfo 1.20 (Feb 16 2004)

1. Light: Added basic support for antilights, see details below. Thanks to Tyrann for this one.
2. RVis: Removed the vis limitation (MAX_MAP_VISIBILITY) of 4 MB.
3. Changed some printouts for higher capacity and clarity.


BspInfo 1.19 (Jan 29 2004)

1. Added new option "-prt" which generates a portal (prt) file from the bsp, similar to the
   bsp2prt utility. BspInfo has larger capacity and produces a better portal file with fewer
   leafs/portals, which helps vis. On older operating systems, it's also several times faster and
   requires less memory.
2. Added new option "-nowatervis" which disables portal information for transparent water when
   using the "-prt" option.
3. Added new option "-quiet" which disables the bsp summary printout.


RVis 2.23 and Light 1.28 (Jan 2 2004)

1. Light: Added new option "-softdist #" which controls directional tolerance, see details below.
2. Light: Added recognition of the key "_anglesense" also in worldspawn, thereby affecting the
   sunlight. This can have quite a large effect on the sunlight appearance, see details below.
3. RVis: Added persistence of the high resolution percent mode in the state file.
4. RVis: Added calculation and printout of the total time spent in state file handling. This is
   the extra time that the AutoSave feature costs. It will only be printed for fullvis runs and
   only if it's at least one second.


RVis 2.22 and Light 1.27 (Dec 14 2003)

1. Light: Improved the accuracy of all emulation modes, see details below.
2. Light: Added new option "-tyrlite" which enables closer TyrLite emulation, see details below.
3. Light: Added new option "-etp" which enables support for QuArK/Hammer ETP, see details below.
   Thanks to Tyrann for this one.
4. Light: Added new option "-lightcap #" which sets a maximum light entity intensity. Any light entity
   that is brighter than this level gets capped.
5. Light: Added new option "-detect" which enables printout of detected keys summary. Enabling "-unsup"
   will also activate this printout.
6. Light: Added a warning for multiple light values in each entity. The last "light" value will be used.
7. Light: Added a warning for misplaced sunlight key (should be in worldspawn).
8. Light: Added a check to prevent multiple emulation mode activation.
9. Light: Added a printout when "-oldlight" mode is enabled.
10.RVis: Minor speedup of Base processing, typically about 10%.
11.RVis: Fixed a minor potential bug in ambient sound calculations.


Light 1.26 (Nov 13 2003)

1. Added new option "-iklite" which enables IKLite emulation, see details below. Thanks to Iikka
   Kernen for this one.
2. Added new option "-ikangle" which enables an angle sensitivity partly similar to IKLite.
   Sensitivity for delay 3 lights is set to 1 and for delay 2 lights it is set to 0.
3. Added recognition of a new key "_anglesense" in each light entity that controls the angle
   sensitivity, see details below.
4. Added new option "-arghlite" which enables ArghLite emulation, see details below.
5. Added new option "-dlx" which enables partial LightDLX emulation, see details below.
6. Removed option "-nodelay" which is replaced by "-arghlite".
7. Fixed a bug which could cause light bleeding and prolonged processing time when using the
   "-soft" option on a map with delay 1-3 lights.
8. Added new option "-norev" which prevents the usual entity key order reversal. This helps when
   doing binary comparisons between bsp files.
9. Fixed a bug which caused the printout of # switchable light styles to behave unexpectedly.


RVis 2.21, Light 1.25 and BspInfo 1.18 (Oct 29 2003)

1. Light: Added new option "-nodelay" which disables the entity delay feature.
2. Light: Added new option "-noflash" which converts flashing light entities into normal ones.
3. Light: Changed error "Texture axis perpendicular ..." into a warning. Ignoring this might cause
   bad lighting in the specified area.
4. Light: Changed error "LoadEntities: not 2/3 values for mangle ..." into a warning.
5. Light: Fixed minor bugs in the unsupported key handling and improved information for several
   errors and warnings.
6. Light: Fixed a bug which disabled maxlight when using the "-globrange" option.
7. Light: Fixed a bug that in rare cases could abort processing of entity section.
8. Light: Fixed a crash bug when an entity had no classname.
9. Light: Fixed a crash bug when loading bsp files with corrupt node data.
10.Fixed a crash bug when loading bsp files with corrupt lump info.
11.Fixed a crash bug when loading bsp files with corrupt texture index data.
12.BspInfo: Fixed a crash bug when there were no textures in bsp.
13.BspInfo: Fixed a memory leak when using the "-cutvislight" option.


Light 1.24 and BspInfo 1.17 (Oct 15 2003)

1. Light: Added new directional tolerance feature to the "-soft" option, see details below.
2. Light: Fixed a bug which in some cases prevented usage of the "-soft" option.
3. Light: Fixed a bug which sometimes caused min/sunlight to be slightly lower than specified.
4. Light: Fixed a bug which sometimes caused minor light variations.
5. Light: Fixed a bug which sometimes caused unnecessary warning "Too many light styles ...".
   Thanks to Tyrann for this one.
6. Light: Added entity # to several error messages.
7. Light: Added printout of # faces in map.
8. Light: Added warning for multiple worldspawn entities.
9. BspInfo: Added new options "-lightstat", "-lightstat2" and "-lightstat3" that enable printout
   of statistical light data. The first just prints a brief summary and the other two add an ASCII
   graphics representation with auto/fixed scale of the light distribution in the bsp. The summary
   contains the three highest peak light levels and mean & standard deviation values. Note that
   complete dark spots (level 0) are not included due to random noise problems.
   This can help in determining what light options that have been used to build a bsp and also to
   better understand how a map is lit and e.g. if there are many areas with fullbright lighting.
10.BspInfo: Added a more descriptive option printout.


Light 1.23 (Sep 25 2003)

1. Added new option "-soft" to reduce jagged shadows, see details below.
2. Added new option "-globrange" which makes the "-range #" option affect global light levels
   (sun/min/maxlight) as well (for compatibility with TyrLite).


Light 1.22 (Sep 15 2003)

1. Added new option "-extra4" which enables 4x4 oversampling instead of the normal 2x2 for even
   higher quality. This also adds more suns for the 2nd sunlight. Naturally, this is a lot slower
   but for some maps it makes a difference, typically for bright maps with high-contrast shadows.
2. Fixed a bug which caused bad "ripple" shadows when using "-fast" option. Now also sunlight is
   affected by "-fast".
3. Fixed a bug where entity "style" keys could be incorrectly inserted or changed.
4. Reduced processing time with up to 20% in some cases.


Light 1.21 and BspInfo 1.16 (Sep 4 2003)

1. Light: Added support for wait/delay/mangle keys in light entities, see details below. Thanks to
   Tyrann for this one.
2. Light: Added new option "-fast" which cuts the processing time in half. When used without
   "-extra", there are visible shadow artifacts in some spots, but it should still be useful for
   quickly checking out the lighting. When used together with "-extra", these artifacts are hardly
   visible, making it useful even for release builds.
3. Light: Added support for old TyrLite _sun_mangle format "x y z".
4. Light: Fixed a bug that could cause an abort with error message "FindFaceOffsets: numfaces ...
   exceeded".
5. Light: Changed error "Bad sun mangle pitch ..." into a warning. This means that it's now
   possible to have sunlight that shines upwards (normally completely pointless).
6. Light: Changed error "FindFaceOffsets: Couldn't find entity for model ..." into a warning.
7. Light: Added new option "-unsup" which enables detailed printout of unsupported keys.
8. BspInfo: Added new option "-texname" which repairs missing texture names with "noname1",
   "noname2" etc. Experimental.
9. BspInfo: Added printout of missing textures.


RVis 2.20, Light 1.20 and BspInfo 1.15 (Aug 4 2003)

1. Removed most of the bsp data limits except for vis/light/entities (4/4/1 MB). This also means
   that normally, less memory is required for processing.
2. RVis: Fixed a bug that allowed for changing fullvis level unnoticed when reloading a saved
   state file. Now the fullvis level is also saved and will override any command line option.
3. Light: Fixed a bug where random garbage bytes could be written to the light data lump.
4. RVis: Minor reduction of state file size. The 2.20 version can still read 2.19 state files.
5. RVis/Light: Added high resolution percent printout to the AutoRate feature. When enabled,
   percent is printed in the form 12.34% instead of 12.3%. It is activated when the same
   percentage value has been printed repeatedly.
6. RVis/Light: Removed printout of estimation when it's not done yet.
7. RVis/Light: Minor adjustments to estimation handling.
8. RVis: Minor adjustments to extra progress bar handling.


RVis 2.19, Light 1.19 (Jul 24 2003)

1. RVis: Added an AutoSave feature for securing long vis runs, see details below.
2. RVis: Added new option "-visdist #" that makes it possible to set a maximum distance that vis
   will consider visible. This can be useful when tracking down spots with high r_speeds. With
   careful map design, this feature might make it possible to lower r_speeds in areas where normal
   vis-blocking doesn't help. This is done by using simple brushes (e.g. closed doors) to hide the
   HOMs that is a result of the range limited vis. Thanks to KrimZon (slightly.quakesrc.org) for
   this one.
3. RVis: Removed the max numportals limitation of 65536.
4. RVis/Light: Added an AutoRate feature for the progress feedback which tries to adjust the
   percentage rate down to avoid long periods with no updates. Using the "-rate" option will
   disable AutoRate.
5. RVis: Added an extra progress bar when processing one portal is very slow, see details below.
6. RVis/Light: Added possibility to set the percentage rate as a float (e.g. 0.2) in the "-rate"
   option.
7. RVis/Light: Changed time format when hours > 0 to "HHh MMm" (e.g. 12h 13m). There is a new
   option "-oldhformat" if you prefer the old format "HH:MM:SS" (e.g. 12:13:14).
8. RVis/Light: Fixed small bugs in timing calculations.
9. RVis: Added printout of "Session time" when an AutoSave state file is loaded at startup. This
   is the totally accumulated time spent in Base/Full and is useful in disrupted sessions.
10.RVis: Changed default Full vis level from 2 to 4, i.e. if you don't specify "-fast", a level 4
   vis will be made.
11.RVis/Light: Added a more descriptive option printout.


RVis 2.18, Light 1.18 and BspInfo 1.14 (Jun 25 2003)

1. Light: Added support for sunlight, see details below. Thanks to Tyrann for this one.
2. Light: Added support for a 2nd sunlight, see details below.
3. Light: Added recognition of "_maxlight" key in worldspawn for maxlight values ("maxlight" is
   still supported but causes a warning at engine startup).
4. Light: Added support for "_dist" and "_range" keys in worldspawn. The command line overrides
   worldspawn settings.
5. RVis/Light: Added simplified progress feedback, see details below.
6. Light: Added new option "-nowarnings" which disables printout of the more repetitive warnings
   to screen.
7. BspInfo: Added new option "-extents" which extracts non-brush entities from the bsp and writes
   them to a text file with extension ".ent". All other entities remain in the bsp. Experimental.
8. BspInfo: Added new option "-cutvislight" which just deletes the light/vis data lumps.
   Experimental.
9. RVis/Light: Improved timing precision.
10.RVis: Added recognition of "-verbose" option ("-v" still works).
11.RVis: Removed printout of c_chains when "-fast" option is used.
12.BspInfo: Changed name of "-fixup" option to "-limit" for clarity.


Light 1.17 (May 20 2003)

1. Added support for Hipnotic/Ritual entity rotation.
2. Added coordinates to the error message "Texture axis perpendicular to face".


RVis 2.17, Light 1.16 and BspInfo 1.13 (Apr 30 2003)

1. BspInfo: Added new option "-fixup" for repairing bsps that appear to have exceeded the Q1 map
   limits. This is experimental and should only be used when required. Backup original file before
   usage.
2. Fixed a bug where loading and saving a bsp would cause random garbage bytes to be written at
   the end of each data lump. These bytes aren't harmful but may be confusing in a file
   comparison.


RVis 2.16, Light 1.15 and BspInfo 1.12 (Mar 25 2003)

1. Fixed a bug in printout of bsp version when mismatch.


Light 1.14 (Aug 15 2002)

1. Added min/maxlight support using options "-light #"/"-maxlight #" or "light"/"maxlight" keys in
   worldspawn. Note that these light levels are normally not affected by the "-range" option. This
   makes the combination of global options more useful.
2. Added support for disabling all light entities using option "-nolight". Using this option
   together with e.g. "-light 50" is very efficient for quickly setting a low light level in the
   map. This in turn is very useful when looking for thin brush seams or tjunction effects.
3. Added more relevant info to the warning message "Entity at ... has unmatched target".
4. Added a warning message when there are unsupported light keys detected and a recommendation for
   proper light tool (TyrLite/IKLite).
5. Reduced memory requirements, typically about 50%.
6. Added several safety checks when reading entities to prevent data corruption.
7. Clarified error message when light data size is exceeded.


RVis 2.15, Light 1.13 and BspInfo 1.11 (Jul 30 2002)

1. RVis: Fixed a serious bug that caused data corruption when vising a map with more than 16384
   numportals. The limit is now set to 65536 and a safety check is added to prevent corruption.
2. RVis: Removed the limitation that causes the error message "Leaf with too many portals".
3. Increased two bsp data limits : MAX_MAP_VISIBILITY and MAX_MAP_LIGHTING from 1 to 4 MB. This
   allows for more complex maps that QBSP compilers now are capable of.
4. RVis/Light: Fixed bugs in the option handling.
5. RVis/Light: Improved printout when warning messages appear.


BspInfo 1.10 (May 29 2002)

1. Increased several bsp data limits : MAX_MAP_ENTITIES from 1024 to 4096, MAX_MAP_ENTSTRING from
   64KB to 1MB, MAX_MAP_PLANES from 8192 to 32768 and MAX_MAP_TEXINFO from 4096 to 8192. This
   allows for more complex maps that QBSP compilers now are capable of.
2. Added safety check to ensure data integrity when the bsp data limits are exceeded.
3. Fixed a bug in printout of surfedges.
4. Added printout of models.
5. Added handling of file name wildcards.
6. Minor adjustments to handle larger values in printouts of big maps.
7. Added version number. The original BspInfo is assumed to have version 1.00.


RVis 2.14 and Light 1.12 (May 28 2002)

1. Made option parsing case insensitive.


RVis 2.13 and Light 1.11 (May 17 2002)

1. Increased several bsp data limits : MAX_MAP_ENTITIES from 1024 to 4096, MAX_MAP_ENTSTRING from
   64KB to 1MB, MAX_MAP_PLANES from 8192 to 32768 and MAX_MAP_TEXINFO from 4096 to 8192. This
   allows for more complex maps that QBSP compilers now are capable of.
2. Added safety check to ensure data integrity when the bsp data limits are exceeded.
3. Added printout of percent estimated time completed.
4. Light: Fixed a bug when writing entity strings longer than 128 byte to the bsp file.
5. Light: Added log file (LIGHT.LOG) handling.
6. Light: Added coordinates to the warning message "Too many light styles on a face".
7. Light: Removed option "-threads" as it didn't work anyway.


RVis 2.12 (Apr 16 2002)

1. Added log file (VIS.LOG) handling.
2. Added printout of # leafs (if more than one) where the "max leafs visible" can be seen.
3. Added coordinates to the complete leaf list when "-v" (verbose) is used.
4. Minor adjustments to improve printouts.


RVis 2.11 (Apr 9 2002)

1. Changed the error message "Leaf portals saw into leaf" into a warning and added coordinates.
2. Added coordinates to the error message "CheckStack: leaf recursion".
3. Added printout of max leafs visible with coordinates. This indicates the position in the map
   where the framerate will be low. Note that only worldbrushes count here, no entities.
4. Minor adjustments to handle larger leaf values in printouts of big maps.
5. Removed option "-threads" as it didn't work anyway.


RVis 2.10 and Light 1.10 (Jan 16 2002)

1. Fixed a bug in estimation when using option "-rate" with percent parameter 0 and process is
   lengthy.
2. Added version numbers. The original Vis is assumed to have version 1.00, RVis 2.00 and Light
   1.00.


RVis/Light, no version number (Nov 5 2001)

1. Improved overall estimation accuracy.


RVis/Light, no version number (Nov 2 2001)

1. Improved estimation accuracy at the beginning of a process.


RVis/Light, no version number (Oct 31 2001)

1. Added useful progress feedback and an option to control it, see details below.
2. Added a check for read-only file before processing.

