[WDJ]	wesleyjohnson

START: 11/1/2009

*** w1_softerror
patchfile= w1_softerror
- committed revision 544   by smite-meister
Adds a I_SoftError function, as an alternative to I_Error function
Softerror function prints message once, ignores messages already
printed, and returns to caller.
Changes some I_Error calls to I_SoftError

*** w2_doordelay
patchfile= w2_doordelay
- committed revision 546    by smite-meister
Adds a Doordelay control variable and menu item
Alters the time that a door stays open.  Allows players to
succeed in overly difficult wads without resorting to noclip.

*** w3_gamma
patchfile= w3_gamma
- merged with w25_gamma
Adds another, darker, gamma table.
See newer gamma generator.

*** w4_zalloc
patchfile= zalloc,  zalloc_v2
- merged with w22_zone
Two critical errors fixed in the Z_Malloc code.
See newer z_zone.c file, with more capability.

*** w5_heretic
patchfile= w5_heretic
- committed revision 548   by smite-meister
Fixes bug that used up an inventory item with saving the game.
Fixes bug that crashed program when player time > 15 min.  (no sucks message)

*** w6_time_wrap
patchfile= w6_time_wrap
- committed revision 549   by smite-meister
Fixes bug when time wrapped and program hung.

*** w7_flat
patchfile= w7_flat
- committed revision 564   by smite-meister
Removes old change had flats searching the entire file, ignoring
F_START and F_END.  This failed for at least one wad, that had the same name
on a sprite.  Changed to honor F_START and F_END, and only when that fails,
then search entire file (so that gothic2.wad also works).

*** w8_voodoo
patchfile= w8_voodoo
- committed revision 563    by smite-meister
Create voodoo dolls for extra player1 start positions.
This is necessary for many wads, which use the voodoo dolls for timers
and action activators.

*** w9_demo
patchfile= w9_demo
- committed revision 562    by smite-meister
Demo code is commented and all demo versions that cannot be played are
properly handled such as to prevent crashing the program.

*** w9.1_misc
patchfile= w91_misc
- merged with w23_comment
Comments

*** w9.5_opt_debug
patchfile= w95_opt_debug
- for debugging purposes, do not commit

*** w9.6_oldwater
patchfile= w96_oldwater
- HOLDING
- patches to oldwater
- some comments as to parameter that oldwater needed
- OLDWATER should be removed

*** w9.7_sound
patchfile= w97_sound
- todo
Patches sdl/i_sound to work.
 

*** w10_specials
patchfile= w10_specials
- committed revision 552   by wesleyjohnson, 
Fix, clean and comment, Legacy special linedefs.
Fixes linedef type specials, for Boom and Legacy
Adds comments for linedef type specials.
Fixes comments in some other associated files.

*** w11_status
patchfile= w10_status
- committed revision 553     by wesleyjohnson
Fix bug where life and ammo status would have bad background after
a save game.  R_FillBackScreen called by G_DoSaveGame, which then did not
refresh status display, because of unsatisfied global tests.

*** w12_drawpatch
patchfile= w12_drawpatch
- committed revision 554, 555,  by wesleyjohnson
Simplify the combination of DrawPatch and GetLump using PU_CACHE, by
creating a function that does both.  This brings most of the casual usage
of PU_CACHE into 3 DrawPatch functions.  This is in preparation for fixing
usage of PU_CACHE throughout the whole program.

*** w13_alloc_cache
patchfile= w13_alloc_cache
- merged with w22_zone
- Careful analysis of the PU_CACHE usage and fixing any usage where it
crosses another call of Z_Malloc.
- Adds additional PU_IN_USE, PU_LUMP, PU_CACHE_DEFAULT, to help prevent
memory allocated from be deallocated while in use.

*** docs
patchfile= w15_docs
- committed revison 565   by wesleyjohnson
- Update docs for release, and special linedefs
- Fixes docs for release 1.44
- Fixes editspec and associated docs to correctly describe the Legacy
special linedefs.

*** makefile
patchfile= w15_makefile
- committed revision 566   by wesleyjohnson
Fix makefile to work with older make, that does not understand some new
make syntax.
Clear up use of LINUX, FREEBSD, keep consistent with docs,
make new usage explicit.
Add debug, optimization controls.

*** gets
patchfile= w15_gets
- committed revision 567    by wesleyjohnson
Fix t_func.c to not use the function gets(), which is so bad the
compiler will warn of any use of it (it overruns the buffer).
Replaced it with fgets().

*** w16_segabor
patchfile= w16_segabor
- committed revision 571   by wesley johnson
Brings over the segabor patches from Legacy 143beta_macosx.
Fixes the SHORT bug, which overused the SHORT and LONG macros to do endian swaps.

*** w17_rdraw
patchfile= w17_rdraw
- committed revision 572   by wesley johnson
Rename of some rdraw variables to add the prefix rdraw_ to give them more unique names,
because they were named identical to some other variables in structs.  This makes it
much easier to grep or search for all uses, and to realize exactly which variable was
being used.

*** w18_SM
patchfile= w18_SM
- committed revision 573   by wesley johnson
Make use of ENUM values for legacy flat modes, instead of int literals.

*** w19_plane_limit
patchfile= w19_plane_limit
- committed revision 574   by wesley johnson
Correct R_MakeSpans to not overwrite startspan[] and to not corrupt yslope[] and
other static memory.  Limits the spans to valid ranges.
This bug was repeatably triggered by the big room in 3DHorror.wad.


*** w20
patchfile= w20_thing_status
- committed revision 575    by wesley johnson
Add limit checks to thing drawing code that handles things split by
a Legacy 3D floor.  Cures bug that such things overdraw the
status bar.

*** w21
patchfile= w21_dc_source
- committed revision 576    by wesley johnson
Cleanup of code in rdraw8, extraneous stmts, add comments,
fix some indentation.
Change some temps to use stdint types.

*** w22_zone
patchfile= w22_zone_alloc_patch
- committed revision 577    by wesley johnson
Reissue of w13_alloc_cache patch, with matching z_zone file.
Careful analysis of the PU_CACHE usage and fixing any usage where it
crosses another call of Z_Malloc.
Adds additional PU_IN_USE, PU_LUMP, PU_CACHE_DEFAULT, to help prevent
memory allocated from be deallocated while in use.

*** w23_comment
patchfile= w23_comment
- committed revision 578    by wesley johnson
Fix indentation to match surrounding, spelling.
Add comments to record.
Add {} on FOR and IF with multiple lines, to clarify reading.

*** w24_init_warnings
patchfile = w24_init_warnings
- committed revision 579    by wesley johnson
Fix stmts that give compiler warnings about variable be used uninit.
Large amount of re-indentation and added {} in p_spec.c.

*** w25_gamma
patchfile = w25_gamma
- committed revision 580    by wesley johnson
Replaces w3_gamma.  Compile option with multiple gamma table generators.
Adds control to select gamma table generator.
Removes old gamma tables.
Adds Effects menu, because video menu too crowded with added gamma
controls.

*** w26
Remove  screen.c.rej
patchfile = w26
- committed revision 584   by wesley johnson
Misc patches to remove compiler warnings, and cleanup interfaces.
No net effects on execution.

*** w27
patchfile = w27
- committed revision 585   by wesley johnson
Fix legacy.dat wadversion test to accept version 142 wad.
Misc patches to remove compiler warnings.

*** w28_setup
patchfile = w28_setup
- committed revision 586   by wesley johnson
Fix bug introduced in w24, where save game writes bad save files.
Caused by init of sectors to NULL, and is unexplainable.

*** w29_sound
patchfile = w29_sound
- committed revision 587  by wesley johnson
Fix (again) the heretic sound, where names are different than Doom.
Fix (again) some sound code for SDL.

*** w30_wad_swap
patchfile = w30_wad_swap
- committed revision 588  by wesley johnson
First part of extensive changes for problem of endian conversion of
patches as they are displayed.  Creates the support SWAP macros and
the wad functions for using them.

*** w31a_swap_patch
patchfile = w31a_swap_patch
- committed revision 589  by wesley johnson
Second part of changes for endian conversion.
Uses new macro names where needed in network code.
Removes endian code from draw patch code.
Creates new draw patch functions to simplify the usual _NUM and _NAME calls.
Extensive checking and comments on all endian swaps, fixed several places where
endian swaps were applied where they should not.

*** w31b_swap_patch
patchfile = w31b_swap_patch
- committed revision 590   by wesley johnson
Third part of changed for endian conversion.
Covers hardware and other subdirectories that were missed in part 2.

*** w32_round
patchfile = w32_p3
- committed revision 591   by wesley johnson
Gives alternative for round and roundf in video.  They are not standard library
and are C99 only.

*** w33_b_node
patchfile = w33_b_node2
- committed revision 592   by wesley johnson
Adds a test for indexes out-of-bounds before accessing the b_node array.
This stops legacy from having a segfault for some wads with minor flaws,
like using a Boom linedef 244 instead of 242.
Also fixes some indenting and add some brackets to make readable.

*** w34_zone
patchfile = w34_zone
- committed revision 593   by wesley johnson
Fix possible failing of Z_FreeTags when it combines free blocks.
Change size_t to uintptr_t, per stdint.h.
Mark free blocks with id.
Remove id and tag as PU_INVALID, blocks that are destroyed.
Create PU_PRIV_CACHE level, which does not get purged until 2nd pass of
trying to allocate in Z_Malloc.  These can be used for those cached
blocks that require considerable processing to create, like multi-patch
textures.

*** w35_texture_generate
patchfile = w35_texture_generate
- committed revision 594   by wesley johnson
Fix segfault in phobiata.wad.  It has a texture of one patch, but that
patch is smaller than the texture.  The draw routine segfaults upon
trying to access texture columns that are not in the patch.
The new function will create in the patch cache a new patch of the dimensions
of the texture, using the patch columns.  All columns will exist.
Wad structures in the headers are changed to use stdint types, so they are
not dependent upon machine word size.
Comments are added to document discovered information.
Some names are changed to better reflect their intended usage, and
reduce confusion with the same name in different usage.

*** w36_draw_clip
patchfile = w36_draw_clip
- committed revision 595   by wesley johnson
Fix segfaults due to low level draw using bad ylookup[].
The video column lookup table, ylookup[], is only as wide as the view window.
The low level draw routines RANGECHECK now checks against the view window
instead of vid.width and vid.height.
All callers of the low level draw routines now check their parameters
against the view window boundaries before calling.
Added some tests to intercept bad sprite ptrs caused by wads without all
the sprites present.
Comments are added to document discovered information.
Some names are changed to better reflect their intended usage, and
reduce confusion with the same name in different usage.

*** w36b_draw_clip
patchfile = w36b_draw_clip
- committed revision 599   by wesley johnson
Move some {} and put \n on some I_SoftError.

*** w37_multi_patch_texture
patchfile = w37_multi_patch
- committed revision 600   by wesley johnson
Added capability to combine patches (from a multi-patch texture) into
one patch, that has transparent regions.  This is needed for phobiata.wad
and makes a great difference in the appearance.  The gates and fences
can now be seen through.
Added texture_model field to texture to replace using test on
numpatches to determine drawing routine.

*** w37_things_print
patchfile = w37_things_print
- committed revision 601   by wesley johnson
I_SoftError messages in things.c were missing a \n.

*** w38_enemy
patchfile = w38_enemy
- committed revision 602   by wesley johnson
Fixed some test logic to include testing for valid ptr to target before
using the ptr.  This stops segfaults that happen in heavy fighting.

*** w37_compiler_msg
patchfile = w37_compiler_msg
- committed revision 603   by wesley johnson
Fixed switch stmts to not give compiler message.  This was done before
in w37 but got lost before commit.

*** w39_overflow
patchfile = w39_overflow
- committed revision 607   by wesley johnson
Stops overflow in sofware rendering from drawing large bars on screen.
Cleans up display of phobiata.wad map07.

*** w39b_overflow
patchfile = w39b_overflow
- committed revision 611  by wesley johnson
Intercept top < bottom errors in software rendering so they do not interact with
overflow trap.

*** w40_makefile
patchfile = w40_makefile_v3
- committed revision 612   by wesley johnson
Restore user and debug controls in makefile.
Support edit of makefile to select system media, debug, optimization.
Dependency files generated from makefile.
Remove makedep.mak which was not being maintained.

*** w40_makefile_v4
patchfile = w40_makefile_v4b
- committed revision 614   by wesley johnson
Some dependencies not covered by previous patch.
Disable of automatic dependency generation was needed, user can choose.
DEBUG var set from command line is not modifiable in makefile.
- clashed with changes by smite

*** svn612_reaction
patchfile = svn612_reaction
- committed revision 615   by wesley johnson
Some adjustments to large compiler-error removal patches.
Some compilers put comments after macros into the macro expansion, with dramatic failure.
Adjusted and commented realloc of drawsegs, with alternative code.

*** w40_makefile_v4d
patchfile = w40_makefile_v4b
- committed revision 617   by wesley johnson
Make debugging easier by including video change.
Re-Re-adjusted CFLAGS.

*** w40_misc
patchfile = w40_misc
- committed revision 618   by wesley johnson
Misc. cosmetic and alignment.
Preparation for savegame improvements.

*** w40_tarray
patchfile = w40_tarray
- committed revision 619   by wesley johnson
Inconsistencies in t_array allocation.
Gave it some protection until issue is finally determined.
Some cosmetic improvements too.
Preparation for savegame improvements.

*** w40_GDESC
patchfile = w40_GDESC
- committed revision 620   by wesley johnson
Preparation for savegame improvements.
Made a table of most game strings and settings.
Table is now searched.
Added command line forcing switches to force a mode selection
without having to rename files.
Added wad_selection.txt documentation.
Removed game name string allocation that was lost memory.

*** w40_savegame
patchfile = w40_savegame
- committed revision 621   by wesley johnson
The big savegame change.
Added headers to savegame.
Savegame sync bytes are written and checked.
Provision for optional savegame sections.
Checks to not load savegames of different word length or endianess.
Checks that wad and game are same as when saved.
Made saving of raw structures more robust.  Easier for
programmer to support and helps avoid making silent errors in savegame.

*** w41_draw_clip
patchfile = w41_draw_clip
- committed revision 622   by wesley johnson
Revisit of w36_draw_clip.
Severe display artifacts observed on flats in Twilight.wad, but not in
other wads, which are fixed by this patch.
Remove a test on dc_x as it was skipping needed loop end operations.
Limit range of dc_x earlier, as calls to SegLoop can have x1..x2 range
exceed the screen.

*** w41_dehacked
patchfile = w41_draw_clip
- committed revision 623   by wesley johnson
Dehacked file pl2.deh (plutonia2) segfaults due to writing string over const.
String replacement changed to use Z_Strdup, and old string is abandoned,
as it could be a const.  There is no good test to recover allocated
strings, but dehacked does not encounter many of those, and executes only
once at load time.

*** w41_draw_clip_b
patchfile = w41_draw_clip_b
- committed revision 624   by wesley johnson
Phobiata.wad had a bright line on right edge of screen.
Test to limit rw_stopx changed from rdraw_viewwidth-1 to rdraw_viewwidth
because the loop range of dc_x is rw_x .. rw_stopx-1.

*** w41_sound
patchfile = w41_sound
- committed revision 625   by wesley johnson
Adds conditional code that makes sound work for systems with old SDL
versions.   When detecting an old version of the SDL mixer include file,
code is inserted to write the midi file to a tmp file and load it
the old way.

*** w41_makefile
patchfile = w41_makefile
- committed revision 626   by wesley johnson
Fixes dependencies so that they are recognized by MAKE.
This fix may only work on Linux.

*** w41_main
patchfile = w41_main
- committed revision 627   by wesley johnson
Makes the legacy home directory available to the savegame code.
Simplifies some of the directory string copies.
Preparation for savegame directories and files.
Removes some old code.

*** w41_savegame_time
patchfile = w41_savegame_time
- committed revision 628   by wesley johnson
Adds the level time to the savegame header.
Fixes error messages.
Handles a NULL mobj pointer, instead of I_Error on it.

*** w41_savegame_dir
patchfile = w41_savegame_dir
- committed revision 629   by wesley johnson
First cut at improving savegame menu system.
These are a work in progress, and are not finished.
Controled by defines  SAVEGAME99, SAVEGAMEDIR, as set in doomdef.h.
Adds ability to have 99 savegames.  Still cannot see more than 6.
Not all controls are finished.
Adds ability to have savegame directories.
This code works and is playable, but network game save will change in
future revision.

*** w42_message
patchfile = w42_message
- committed revision 630   by wesley johnson
Simple message function.

*** w42_savegame
patchfile = w41_savegame_dir
- committed revision 631   by wesley johnson
Cleaned up savegame menus.
Made legacy home string separately available.
Added directory and savegame delete.
Added directory and savegame scrolling.
Except for system dependent directory scanning, this finishes
the savegame revision.

*** w43_modelsector
patchfile = w43_modelsector
- committed revision 632   by wesley johnson
Clean up use of sector models for Boom deep water and Legacy water.
This changes uses of sector->heightsec to be a model sector reference,
and changes most tests against it to be against sector->model.
This excludes special colormap sectors from being treated as water
sectors and properly ignores their floor and ceiling levels.
Enforce protection against model sector=-1 at the time sector model is set,
thus removing many unnecessary tests and making code intent clear.
Change some repetitive array accesses to use ptrs, reducing code size.

*** w44_byteswap
patchfile = w44_patchfile
- committed revision 633   by wesley johnson
Finishes change from LE_SHORT, LE_LONG, to LE_SWAP16 and LE_SWAP32.
Fixes midi file big-endian uses to use BE_SHORT and BE_LONG.

*** w44_quicksave
patchfile = w44_quicksave
- committed revision 634   by wesley johnson
Fix quicksave getting clobbered by save or load.
Fix quicksave to be able to change save file.
Fix quickload to correct message

*** w45_naming
patchfile = w45_naming
- committed revision 637   by wesley johnson
Change some immature language to something more useful.
FIXED_TO_FLOAT_MULT
FIXED_TO_FLOAT( x )  : changed to use FIXED_TO_FLOAT_MULT
  changed divide to multiply, got smaller code
Comments, and other edits that do not change code generated.

*** w46_hardware1
patchfile = w46_hardware1
- committed revision 638   by wesley johnson
Changes to the hardware renderer to fix some problems, and to clean it
up so other fixes are easier.

SPRITE_LIGHTLEVEL : convert sprite drawing to use same lightlevel
calculations that software renderer has been using.

TERM_TRANSFORM : generates precalculated combined transform terms that
reduces transforms per vertex to only 5 multiplies and 5 adds for
sprites, and 8 multiples and 8 adds for world.

DOOR_CLOSED_FIX : code from software renderer for closed doors. Not
enabled yet, needs checking.

Reduced lightlevel K-factor in LUT table from 2 to 1.2 to better match the
software renderer brightness.

Tests that rejects empty lines for trigger copied from software
renderer, as it has more conditions that seem important.

Code from r_bsp that determines the light levels of ceiling and floor,
taking into account multiple floors.

Code from r_things that fixes the problem with sprites being lighted
from the sector only.  It takes into account the 3D floors.

*** w47_main_GDESC
patchfile = w45_main_GDESC
- committed revision 639   by wesley johnson
Tests of strife shareware were not recognized and caused segfault.
Finished Strife and Strife shareware additions.
Added needed lump recognition.
Added strife mode, (not implemented).
Fix change to -game switch so that unrecognized names cause error.
Other cosmetic and organizational adjustments and removed some old
comments and code.

*** w47_wad_selection
patchfile = w45_wad_selection
- committed revision 640   by wesley johnson
User documentation changed to reflect strife and -game switch changes.

*** w44_quicksave
patchfile = w44_quicksave
- committed revision 641   by wesley johnson
Commit quicksave again, quicksave changes are missing.
Fix quicksave getting clobbered by save or load.
Fix quicksave to be able to change save file.
Fix quickload to correct message

*** w47_naming2
patchfile = w47_naming2
- committed revision 642   by wesley johnson
Another FIXED_TO_FLOAT, and some commentary.

*** w48_wad_structure
patchfile = w48_wadstruct
- committed revision 643   by wesley johnson
Change structures used to access wad to use uint16_t and uint32_t.

*** w48_realloc
patchfile = w48_realloc1
- committed revision 644   by wesley johnson
Check for failure on calls to realloc.  Moved expansion of realloc structures
to subroutines.  Gets them out of the code that is executed frequently
so they do not occupy space in the processor cache.

*** w48_struct_comments
patchfile = w48_comments1
- committed revision 645   by wesley johnson
Comments added to main structures, as aid to debugging their use.

*** w49_animation_interpic
patchfile = w49_animinterpic
- committed revision 646   by wesley johnson
Two animation structures had the same name.
Renaming of structures and some variables, to make reading and search
easier.
Comments added.

*** w49_animation_textures_and_flats
patchfile = w49_animtex
- committed revision 647   by wesley johnson
Two animation structures had the same name.
Renaming of structures and some variables, to make reading and search
easier.
Comments added.
Eliminated storing -1 value in boolean field.
Eliminated extra entry needed for -1 terminator to list.
Changed test condition on one loop to instead test a count derived from
the other existing end-of-list indicator.

*** w49_medikit_message
patchfile = w49_medikit
- committed revision 648   by wesley johnson
Fix from DoomWiki (wrong) and prboom (right) to known Doom bug.
When health < 25 and pickup a medikit, gives an special message.
Message did not appear because medikit gave +25 health before the
test was done.  Changed to test for 50 health after adding +25.

*** w49_ouch_face_on_damage
patchfile = w49_ouchface
- committed revision 649   by wesley johnson
Fix from DoomWiki (and prboom) to known Doom bug.
When damage > 20, was supposed to give the ouch face.
The test subtraction was reversed, testing a negative damage.

*** w49_fraggle_proto
patchfile = w49_fraggle
- committed revision 650   by wesley johnson
Functions in fragglescript files did not have prototypes, changed to (void).
Changed misuse of name floor (a library function) to mfloor.

*** w49_floor_rename
patchfile = w49_floor
- committed revision 651   by wesley johnson
Rename usages of floor name (a library function) to mfloor.
Overloading of floor library function causes confusion with editors, and
potentional compile errors where the original library function gets used.
The bin size was reduced by about 1K.

*** w49_sector_rename
patchfile = w49_sectors
- committed revision 652   by wesley johnson
Clarify usage of sector numbers in structures and code, and the list of
lines.  Use more unique names.
Rename sector lines[] to linelist[], and added comments.
Fix another use of floor name.

*** w50_planelight
patchfile = w50_planelight
- committed revision 653   by wesley johnson
Split the R_GetPlaneLight function into two, to avoid the repeated
passing of a FALSE parameter.
Eliminated clutter of viewz test in parameter that is now done in function.
Reduced program size and faster execution.

*** w50_bsp_viewer_common
patchfile = w50_bspviewer
- committed revision 654   by wesley johnson
Removes common determinations on the viewer model sector to a Setup
function.
The viewer variables are used by R_FakeFlat and R_RenderSprite.
This code is much easier to read and understand, and is smaller.
Makes model floor and ceiling transitions more consistent.
Old code is retained for comparison until such time as correctness is clear.

*** w50_friction
patchfile = w50_friction
- committed revision 655   by wesley johnson
Investigating why prboom has different friction in mud than Legacy.
That may be due to control device issues and momentum.
Added some improvements from ZDoom and prboom, for heretic and hexen.
Comments and cleaned up some.

*** w50_blaze_door_sound
patchfile = w50_blaze_door_sound
- committed revision 656   by wesley johnson
Fix from WikiDoom to known Doom bug.
When blaze door hits someone and goes back up, it plays the wrong sound.
Added test for blaze door to play appropriate sound.

***
- committed revision 657   by wesley johnson
WDJlog.txt  update

*** w51_hardware_world
patchfile = w51_hardware_world
- committed revision 658   by wesley johnson
Hardware renderer use of world names fixed same as software renderer.
Some other name changes to more descriptive.

*** w51_textures
patchfile = w51_textures
- committed revision 659   by wesley johnson
Commented code as to the conflict between texture[0] and 0=no-texture.
Added a fix for the conflict that allows the first texture to be displayed.
Some changes to names and array accesses.

*** w52_no_texture
patchfile = w52_no_texture
- committed revision 660   by wesley johnson
Check for no texture, and prevent segfault.
Catches error when 3Dslab does not have side texture.

*** w52_attack_self
patchfile = w52_attack_self
- committed revision 661  by wesley johnson
Documents a fix for a monster attacking itself.
See WikiDoom bugs.

*** w52_2player_segfault
patchfile = w52_2player_segfault
- committed revision 662   by wesley johnson
Documents a bug that is not fixed.
When 2 players, with 2nd player not active, the second player will segfault
at the marked location, when the 1st player enters the lift on MAP01.
This would be the first act making a sound that the other player could hear.

*** w52_moving_sector
patchfile = w52_moving_sector
- committed revision 663   by wesley johnson
Found too many uses of variable "move" in code, so renamed and commented
some of them.

*** w52_model_sector_colormap
patchfile = w52_model_sector_colormap
- committed revision 664   by wesley johnson
Cleanup colormap setup in p_spec.c, and commented the special linedefs.
Rename the color mapping control sector as model_sector.

*** w52_colormap
patchfile = w52_colormap
- committed revision 665   by wesley johnson
Extensive visit of all the colormap code.
Comment uses of colormaps.
Cleanup colormap setup in p_setup.c, and commented special linedefs,
and removed incomplete hardware renderer code for colormap generation.
Have hardware renderer use the same colormap generator function as the
software renderer, and same linedef setup.
Cleanup the colormap generator, comment, and have it calc hardware
renderer fields too.

*** w52_skintable_translations
patchfile = w52_skintable
- committed revision 666   by wesley johnson
Too many uses of the term trans, confusing translucent and skin
translation.
The skin tables are renamed from translationtables to skintranstables,
and dc_translation becomes dc_skintran.
Define SKIN_TO_SKINMAP, MT_TO_SKINMAP, to bring indexing calculations
to one common place.
Create skin table lookup, which prepares code to have skin tables read
from files.
Rename the standard colormap tables as reg_colormaps, to differentiate
them from all the other things named colormap.

*** w52_lighttable
patchfile = w52_lighttable
- committed revision 667   by wesley johnson
Use LIGHTTABLE on colormaps, hiding table indexing calculations.
Renamed the fakefloor lightlist_t to ff_lightlist_t to differentiate it
from the other r_lightlist_t.
Renamed some list uses to ff_list, to differentiate them from other lists.
Fixed expand_lightlist, gave it an error message on failure.

*** w52_translucent
patchfile = w52_translucent
- committed revision 668   by wesley johnson
Spell out translucent, so can differentiate it from other trans operations.
Rename trans enum values to be readable.
Use translucenttable[xxx] syntax, instad of *(translucenttable + xxx).
Make table for translucent selection to GL conversion.

*** w52_draw_masked
patchfile = w52_draw_masked
- committed revision 669   by wesley johnson
The R_RenderMasked routines have some global parameters.  Rename them
with dm_ so they can be easily identified.
Simplify some colormap code segments where there were redundant tests.

*** w52_fog_sheet
patchfile = w52_fog_sheet
- committed revision 670   by wesley johnson
Fixes fog sheet bug, where fog sheet would not display in software renderer.
Adds code to clip the fog sheet properly.

*** w52_fog_floor_colormap
patchfile = w52_fog_floor_colormap
- committed revision 671   by wesley johnson
Provided alternative code where FF_FOG test for setting colormap was
unusual compared to other places in the code.  Not sure which is
correct.

*** w52_hw_colormap
patchfile = w52_hw_colormap
- committed revision 672   by wesley johnson
Bug fix, hardware renderer can now display Boom colormaps, and can now
display levels of colormap brightness.
Create R_ColormapAnalyze, to generate hardware rgba info from Boom colormaps.
Enhance the extra_colormap rgba field to be an array, selected by lightlevel.
This gives the opengl colormaps some lightlevel effect.
Enhance ColormapGenerate, to fill out the rgba lightlevel array.

*** w52_hw_transparent_wall
patchfile = w52_hw_transwall
- committed revision 673   by wesley johnson
Sprites behind transparent walls are not drawn.
Transparent walls are drawn after the sprites so they can be overlayed.
There was work already done, that needed to be enabled.
Made it clearer and added comments.

*** w52_hw_bsp_viewer
patchfile = w52_hw_bsp_viewer
- committed revision 674   by wesley johnson
Convert hardware renderer to use the same bsp viewer global variables
that are used in the software renderer, as in bsp.c.

*** w52_hw_brightness
patchfile = w52_hw_brightness
- committed revision 675   by wesley johnson
Adjust hardware brightness again, because rgba[] now gives some darkness.

*** w52_hw_no_texture2
patchfile = w52_hw_no_texture2
- committed revision 676   by wesley johnson
More no-texture tests needed in FakeFloor rover code, with wider protection.
A 3Dslab that is missing a side texture could cause a segfault, eventually,
when it is referenced during FakeFloor roving.

*** w52_VIEW_COLORMAP_GEN
patchfile = w52_view_colormap_gen
- committed revision 677   by wesley johnson
Turn off VIEW_COLORMAP_GEN debug enable, which had got left on.

*** w52_hw_extracolormap_surf
patchfile = w52_extracolormap_surf
- committed revision 678   by wesley johnson
Extracolormap_to_Surf, common function for hardware rgba[] handling,
because these operations are getting more and more complicated.
This was in w52_hw_colormap, but was found to be missing after
the latest commit.
GetPlaneLight changes in hw_main.c.
These were in w50_planelight, but were found to be missing after
this latest commit.

*** w53_drawsplats_looping
patchfile = w53_drawsplats_looping
- committed revision 679   by wesley johnson
The usual test and continue for draw range too high, in this case, left
the iteration variable unchanged, and thus stuck in a tight loop.
Changed to not use continue stmt.

*** w53_chexquest
patchfile = w53_chexquest
- committed revision 680   by wesley johnson
Fix chexquest problems.
Chexquest was showing bloody splats, provided by legacy.dat.
Added a GDESC_ flag to indicate that the iwad needs to have precedence.
Reduced the violence of the splats for chexquest mode.
Added code to detect and intercept Doom graphics that were left in the
chexquest1 wad by the developers.
When player escapes the difficulty menu, it goes to the episode menu,
which is displaying the Doom1 episode names to Chex players.
Added code to give Chex episode names, instead of Doom episode names,
or block the episode menu.

*** w53_bossdeath
patchfile = w53_bossdeath
- committed revision 681   by wesley johnson
Fix from DoomWiki and prboom.
BossDeath logic from UltimateDoom does not work with some earlier PWAD.
Upon detect of shareware or registered, revert to earlier BossDeath
test, that allows all Boss types to trigger effect.

*** w53_buildstairs
patchfile = w53_buildstairs
- committed revision 682   by wesley johnson
BuildStairs bug from DoomWiki, already fixed (mostly).
Init some more fields, init them even when not boomsupport,
moved stair attribute switch stmt out of the loop (const for the loop).

*** w53_line_of_sight
patchfile = w53_lineofsight
- committed revision 683   by wesley johnson
Sleeping Sargeant bug from DoomWiki.
Line-of-sight code had typo, testing x==node->y, instead of y==node->y.

*** w54_dehacked
patchfile = w54_dehacked
- committed revision 684   by wesley johnson
Dehacked file in chexquest-newmaps segfaults due to writing string over const.
String replacement in sprites changed to use Z_Strdup, and old string
is abandoned. This one was missed in previous dehacked patch.

*** w54_lightlist
patchfile = w54_lightlist
- committed revision 685   by wesley johnson
Fix segfault in chexquest-newmaps due to lightlist bad value.
Init some special lightlist fields, and comment where segfault occurs.
Do not know how the level causes this, but it is repeatable.
With the init, the segfault is prevented, and there is no visible effect.

*** w54_crosshairs
patchfile = w54_crosshairs
- committed revision 686   by wesley johnson
Chexquest-newmaps has a scope with crosshairs, that for the software
render is considerably off to the left.
Center the fragglescript pictures overlayed upon screen so that the
scope crosshairs line up with the actual firing point.

*** w54_new_chexquest
patchfile = w54_newchexquest
- committed revision 687   by wesley johnson
Chexquest-newmaps and others have more than the original 5 maps.
When a there is a -file (gamemodified=1), then allow all episodes and maps.

*** w55_savemobj
patchfile = w55_savemobj
- committed revision 689   by wesley johnson
Savegame repeats mobj numbers when more than 1023 mobj.
Seen in hth2.wad (Hi-Tech Hell 2 - Alien Tech), which saves 1899 thinkers.
Realloc of mobj list fixed.

*** w55_maxcolormap
patchfile = w55_maxcolormap
- committed revision 690   by wesley johnson
Wad hth2.wad uses 38 colormaps, increase to 64 colormaps.
Comment some colormap vars, and make it more clear.
Not enough memory saved to use dynamic methods.

*** w56_savemenu_scroll
patchfile = w56_savemenu_scroll
- committed revision 691   by wesley johnson
Fix savegame menu so that when pressing uparrow or downarrow the scrolling
is performed whenever it can, instead of rollover to top or bottom
of menu.

*** w56_legacy_docs
patchfile = w56_legacy_doc
- committed revision 693   by wesley johnson
Updated the Legacy.html to reflect new controls and switches.
This is not complete.
Updated a little bit of Faq.html, but much of it still needs review.
There are still many references to newdoom in the doc pages.

*** w57_trymove
patchfile = w57_trymove
- committed revision 694   by wesley johnson
Comments added for TryMove, LineAttack.
Rename TryMove global vars to tm_* and the return global vars to tmr_*.
Rename LineAttack global vars la_* and the return global vars to lar_*.
Cleanup some function stubs, and some indenting, and some IF stmts
to make easier to read.

*** w57_sight
patchfile = w57_sight
- committed revision 695   by wesley johnson
Comments added for Sight functions.
Rename CheckSight global vars to cs_*, and the return global vars to
see_* (which are also used independently by P_AimLineAttack).
Rename SightTraverse hsight global vars to strav_*.

*** w57_largemap
patchfile = w57_largemap
- committed revision 696   by wesley johnson
Fix some math overflow for large maps like Europe.wad, where MAP01 is
enormous.
Change some short wad field types to uint16_t where needed, as those fields
could be overflowed and they do not need a sign.
Detect some buggy wad conditions and correct it as much as possible, 
or Error msg exit, at least prevent segfaults.
Detect bad linedef number, missing sidedefs, in P_LoadSegs.
Detect missing sidedefs, in P_LoadSubsectors.
Detect bad sector number, in P_LoadSideDefs2.
Detect bad seg number, in P_GroupLines.

*** w57_blockmap_overflow_coping
patchfile = w57_blockmap
- committed revision 697   by wesley johnson
Fix blockmap loading to handle large blockmaps.
Detect blockmap overflow and correct the list indexes.
Will load Europe.wad which overflows the blockmap x3 times.
Europe.wad will load and run after this patch, but has automap problems,
and some other bugs.
Rename the blockmap global vars to be less confusing, as blockmaphead
and blockmapindex (as neither is the lump).
Make the blockmap unsigned, because every value read from it is unsigned
except for one test, which can be ==0xffff instead.
Adjust some of the blockmap functions.

*** w57_automap_overflow
patchfile = w57_automap
- committed revision 698   by wesley johnson
Fix automap to handle large maps like Europe.wad.
Do math as to avoid overflowing integer math.
Detect when overflow will happen and limit zoom to prevent it.
Change conversion calculation to floating point math.
Removed some unused code using #ifdef 0.
Rewrote some parts to use center of attention instead of corner of
window, and cope with map edges better.

*** w58_r_defs
patchfile = w58_r_defs
- committed revision 715   by wesley johnson
Comments on many r_defs structure fields.
Comment out unused ff_delta field.
Comments where ff_delta was initialized.

*** w58_attached_memory_leak
patchfile = w58_attached_memory_leak
- committed revision 716   by wesley johnson
Free memory allocated to sector->attached before freeing sectors in
ZMalloc purge.
Init sectors list pointer, now that it no longer causes save game
corruption.

*** w58_silhouette
patchfile = w58_silhouette
- committed revision 717   by wesley johnson
Rename some silhouette fields and function variables so can understand
how they are being used.
tsilheight -> sil_top_height
bsilheight -> sil_bottom_height
sprtopclip -> spr_topclip
sprbottomclip -> spr_bottomclip

*** w58_top_patch
patchfile = w58_top_patch
- committed revision 718   by wesley johnson
Clarify some draw_masked and render segs variables, so can understand
how they are being used.  Preparation for attacking 3Dfloor sprite bugs.
Standardize some render function defines.
dm_topscreen -> dm_top_patch
dm_botscreen -> dm_bottom_patch
topscreen -> top_post_sc
bottomscreen -> bottom_post_sc
local light index -> dlit

*** w58_viewangle
patchfile = w58_viewangle
- committed revision 719   by wesley johnson
Rename of viewangle arrays to make them readable.
xtoviewangle -> x_to_viewangle
viewangletox -> viewangle_to_x

*** w58_visplane_hash
patchfile = w58_visplane_hash
- committed revision 720   by wesley johnson
Clarified the visplane hashing, renamed, and rewrote some free list
functions, to make it more explicit and understandable.
Plane freelist had head and tail reversed from usual list interpretations.
Gave visplane base the naming  vispl_*.
Gave visplane global parameters the naming  vsp_*.
Because of longer names the code got larger.
Running it through strip, removing the symbols, shows the true code size.

*** w58_visplane_naming
patchfile = w58_visplane_naming
- committed revision 721   by wesley johnson
Preparation for attacking 3Dfloor sprite bug.
Naming changes, spacing, etc.
Renamed some structure fields to be explict, such as front_frac and
back_frac (instead of f_frac and b_frac), and high_top instead of just high.
Standardize some strange function declarations.
Many comments added.
No logic changes.

*** w58_visplane_revision
patchfile = w58_visplane_revision
- committed revision 722   by wesley johnson
Preparation for attacking 3Dfloor sprite bug.
Small changes here and there to clarify code.
Simplified R_ExpandPlane, it was copied from CheckPlane and mostly
irrelevant.
Floor rover renamed to fff, and bff, which changes many lines, but makes
it clearer which is which.

*** w58_missed_stuff
patchfile = w58_missed_stuff
- committed revision 726   by wesley johnson
Some local renames and comments that belonged with w58 that were missed.

*** w59_whatsnew
patchfile = w58_whatsnew
- committed revision 738   by wesley johnson
Update whatsnew.html with new features, bug fixes, and known bugs from
my notes.
Update legacy.html with gamma table.
Update console.html with gamma commands.

*** w60_gcc4.4.4_complaints
patchfile = w60_gcc4.4.4_complaints
- committed revision 746   by wesley johnson
Fix some valid gcc 4.4.4 compiler complaints.

*** w60_automap_status
patchfile = w60_automapstatus
- committed revision 747   by wesley johnson
Automap is messed up for some screen sizes and splitscreen.
Fix bug made in w57_automap_overflow, by restoring original draw sizes.
Automap does not adapt to splitscreen, nor screen size, and has its own
status bar adaptation.

*** w60_displayplayer
patchfile = w60_displayplayer
- committed revision 748   by wesley johnson
Add variables consoleplayer_ptr, displayplayer_ptr, displayplayer2_ptr.
To fix splitscreen displayplayer tests to not segfault.
This does NOT fix the splitscreen specific segfault causes.
These variables save on many tests of players[consoleplayer] and can
be tested against other player ptrs, and fixes clumbsy tests of
ptr against index.
Reduces code size by about 3K.

*** w60_splitplayer
patchfile = w60_splitplayer
- committed revision 749   by wesley johnson
Fix splitscreen player2 failure that has existed for a long time.
Splitscreen player was not being created because even local play uses commands
sent through the network code, and they were being sign extended into nonsense.

*** w60_splitsound
patchfile = w60_splitsound
- committed revision 750   by wesley johnson
Fix sound code segfaults in splitplayer mode.

*** w60_splitdemo
patchfile = w60_splitdemo
- committed revision 751   by wesley johnson
Prevent demos from destroying an existing split player setup.

*** svn744_makefile
patchfile = svn744_makefile
- committed revision 753   by wesley johnson
Linux 2.4 and others still have GLU lib in /usr/X11R6/lib.

*** w61_texture_combine
patchfile = w61_texture_combine
- committed revision 755   by wesley johnson
The wad caesar.wad causes a texture failure.  Making allocation slightly
larger prevents this failure.

*** w61_effects_menu
patchfile = w61_effects_menu
- committed revision 756   by wesley johnson
Make Effects menu permanent.  Next changes will add to it and too
difficult to cope with it being optional.

*** w62_patch_combine
patchfile = w62_patchcombine
- committed revision 757   by wesley johnson
Patch combine fixes.
Detect empty patch properly instead of letting large value represent it.
Handle posts longer than 255 by creating a separate post, instead of error
escape.
Improve some messages, and comments.

*** w62_PNG
patchfile = w62_PNG
- committed revision 758   by wesley johnson
Detect PNG patches, to prevent them from crashing the draw routines.
Create a dummy patch to replace them.
Test wad is longdays.wad, which has a PNG patch.

*** w62_sprite_limit
patchfile = w62_sprite_limit
- committed revision 759   by wesley johnson
Remove sprite limits.  A user setting allows from 128 to 16000 sprites.
Sprite tables are dynamically adjusted according to previous frame
sprite count, and user setting (soft limit) in Effects menu.
Table size is hard limited to twice the user setting.
Nearest sprites to player have preference.
When there are more sprites than the table size (>256) the farther sprites
have semi-random access to last half of table (sporatic visibility,
they flicker), so the player knows there are more sprites in the distance.
Sprites are sorted by scale as they are inserted into table, so sprite
sort routine is ifdef'ed out.
Test wad is longdays.wad, which has thousands of sprites.
Test at user setting of 128 sprites, upto when your computer bogs down.

*** w62_crush_floating_monster
patchfile = w62_crush
- committed revision 761  by wesley johnson
Fix monster height vrs room logic that due to some strange fix, had
floating monsters getting away from crushing ceilings undamaged.
Changed logic around so crush test is done first, and then can be
modified for special cases.  The special cases I found are limited,
but this is much easier to maintain without breaking it again.
I have tested this on several wads with crushers and it appears to work,
and I have verified that cacodemons and heads get crushed now.
It could use more testing for the strange special cases that I do not
know about.

*** w61_boom_demo
patchfile = w61_boom_demo
- committed revision 762   by wesley johnson
Fix demo player to understand Boom demo headers.
This stops them from crashing the playback machine.
This patch got lost, which is why it is out of order.

*** w63_texture_size
patchfile = w63_texture_size
- committed revision 763   by wesley johnson
Set texture size variable txcblocksize.
Stops compiler from complaining, which was right, although it took me
a long long time to find it.

*** w63_PU_LOCK_SB
patchfile = w63_PU_LOCK_SB
- committed revision 764   by wesley johnson
The statusbar background was still getting released from memory.
Added a locked allocation, PU_LOCK_SB, which users of PU_STATIC cannot
release using ChangeTag.  ChangeTag requires use of PU_UNLOCK_CACHE to
change the PU_LOCK_SB to PU_CACHE.
Changed some temp uses of PU_STATIC to PU_IN_USE or PU_LUMP, which will
not release the memory if another user had the same patch with PU_STATIC.

*** w63_switch_endian
patchfile = w63_switch_endian
- committed revision 765   by wesley johnson
Loading of switches has endian conversion that should be conditional
on BIG_ENDIAN, and needed to be done only when loading cache, not on
cache hits.

*** w63_doommode
patchfile = w63_doommode
- committed revision 766   by wesley johnson
Alter the doommode enum names to reflect the actual games.
doom_shareware, doom_registered, ultdoom_retail, doom2_commercial
Found bad enum tests: "if (shareware)" and fixed them
as "if (gamedesc_index == GDESC_heretic_shareware)".

*** w63_GDESC_improve
patchfile = w63_GDESC_improve
- committed revision 767   by wesley johnson
Revised GDESC_ code to have three alternative filenames for each entry.
This allows the engine to check several alternative filenames, to
allow a unique name and a common name, and to cover both filenames for
Ultimate Doom without needing two separate Ultimate Doom entries.
The id code is now specified in a field to make it independent of the
entry position in the table.
Removed code for -shdev, -regdev, -comdev, and replaced it with one
simpler switch, -devgame <gamename>, to remove the only need to know the
index of GDESC table entries.  Probably, those switches have not
been used since Doom development in the 90's.

*** w63_wikibugs
patchfile = w63_wikibugs
- committed revision 768   by wesley johnson
Comment fixes to bugs described in wikibugs.

*** w64_savegame_limit
patchfile = w64_savegame_limit
- committed revision 769   by wesley johnson
Savegame size limits removed.  Longdays.wad has savegame size from 468K to 806K.
Savegame was made to work within a 128K buffer, by reading and
writing when the free space is less than 1024 bytes.  Error detection,
buffer allocation, and deallocation, and file access is encapsulated within
the savegame functions.
The network also transmits savegame to a new user.  When there is not
a file then the savegame function reallocs a larger savebuffer, as needed.

*** w65_savemenu_bugs
patchfile = w65_savemenu_bugs
- committed revision 770   by wesley johnson
Fix a number of nusance bugs in the savegame menu system.
Puts a ".." string in the UP-TO-LEGACY directory menu entry.
Fix allows new directory to be created from DIR line and from any
blank directory entry.
Fix directory menu scrolling to stop at end.
Fix savegame and directory menu failure after delete entry.
When current directory is deleted, fixed to null savegamedir name.
Fix "EMPTY SLOT" message being presented as a savegame name, by
preserving the slot status for all scrolling.

*** w65_old_patch_remove
patchfile = w65_old_patch_rem
- committed revision 771   by wesley johnson
Remove old unused patch remanant.
Preliminary to fixing draw sprite vrs 3dfloor bug.

*** w65_old_vissort_remove
patchfile = w65_old_vissort
- committed revision 772   by wesley johnson
Remove old unused vissprite sort routine.
Preliminary to fixing draw sprite vrs 3dfloor bug.

*** w65_plane_drawnode
patchfile = w65_plane_drawnode
- committed revision 773   by wesley johnson
Sort floor planes into the drawnode list as they are traversed instead of
the previous repeated search of the same data.
Preliminary to fixing draw sprite vrs 3dfloor bug.

*** w65_savegame_line_ptr
patchfile = w65_save_ptr
- committed revision 774   by wesley johnson
Fix segfault in DoomII MAP27 on use of door->line.
The line may be NULL.  Fixed savegame to save and restore NULL ptrs
for line and mapthings.
                                                            
*** w65_savegame_get_put
patchfile = w65_savegame_get_put
- committed revision 775   by wesley johnson
Two savegame functions use local vars get and put, and these must be
copied to and from save_p before and after SG_Readbuf and SG_Writebuf.
Changed value 1024 in SG_Readbuf and SG_Writebuf to a defined trigger value.
Increased free space trigger to 2048 bytes.
Added optional code to test and print minimum free space in the
savegame buffer.

*** w65_sprite_limit_fix
patchfile = w65_sprite_limit_fix
- committed revision 776   by wesley johnson
Fix a minor error in testing for request = current.

*** w65_farthest
patchfile = w65_farthest
- committed revision 777   by wesley johnson
Move some variables that were made conditional into the conditional code
so the compiler stops complaining about variables not used.

*** w66_save_SGI
patchfile = w66_saveSGI
- committed revision 779   by wesley johnson
Savegames for SGI will no longer pad the savegame to align reads and writes.
Padding will not work with the new savegame buffer, as it does not keep
a fixed alignment.  The WRITEU16, and similar inline functions should
perform unaligned byte transfers to the buffer, if needed.

*** w66_alpha2_docs
patchfile = w66_alpha2_docs
- committed revision 780   by wesley johnson
Update the docs for latest news, bug fixes, and update some legacy
usage instructions.

*** w66_buggy_wad
patchfile = w66_buggy_wad
- committed revision 781   by wesley johnson
More checks against buggy wads.

*** w67_colormap_msg
patchfile = w66_colormap
- committed revision 782   by wesley johnson
Fix bad colormap missing msg.

*** w67_linedef
patchfile = w66_linedef
- committed revision 783   by wesley johnson
Decode boom generalized linedef better, so to detect bad linedef numbers.
More efficient switch linedef executable.

*** w67_plutonia
patchfile = w66_plutonia
- committed revision 784   by wesley johnson
Bad detection for plutonia, CAM01 needed to be CAMO1.

*** w67_stop_demo
patchfile = w66_stop_demo
- committed revision 785   by wesley johnson
Stop demos when menus are open.  They keep stealing the keypresses and
make it impossible to use the menus.

*** w67_player_spawn
patchfile = w66_player_spawn
- committed revision 786   by wesley johnson
Convert player spawn code to pass playernum as parameter instead of
mangling the wad things.  This allows the wad things to be searched
again.

*** w67_savegame_netvars
patchfile = w66_savegame_netvars
- committed revision 787   by wesley johnson
The savegame format changes everytime some more cv_ netvars are added.
This change makes the savegame load immune to this.  It will read
netvars until it hits the SYNC mark, instead of reading according the
the NETVARS found in this version.  This allows older savegames to
still load.

*** w67_voodoo_player
patchfile = w67_voodoo_player
- committed revision 788   by wesley johnson
Due to wads that use the voodoo player in strange ways, the voodoo
player has appeared as the player in some function calls.  This will
segfault when trying to get the player index [player - players].
Fix by creating the voodoo player more like vanilla doom does it, and
then intercept the problems as they occur.
Provides an instadeath control for voodoo telefrag mitigation.
In deathmatch, the voodoo telefrag is blocked.
Provides a voodoo_mode to control voodoo effects, with settings
Vanilla, Multispawn, Target, and Auto.
In Vanilla, voodoo dolls can create zombies and the walking dead.
Other modes prevent those from occuring by redirecting damage to the
player.
In Multispawn mode the voodoo doll player gets the damage.
In Target mode the player that shot the voodoo doll, or last triggered
a linedef, or last pushed a switch, will get the damage.
Target mode is meant for coop and deathmatch.
In Auto mode it behaves as Target, unless it detects voodoo dolls for
players other than player1, upon which it will change to Multispawn.
Plutonia MAP06 is a known voodoo Multispawn level.

*** w67_doc
patchfile = w67_doc
- committed revision 789   by wesley johnson
Update docs for w67 patches.

*** w67_stop_demo2
patchfile = w67_stop_demo2
- committed revision 790   by wesley johnson
Fix Stop Demo patch that got somewhat mangled.  Also added restore of
screen and demo after the menu is exited.

*** w67_deathmatch_voodoo
patchfile = w67_deathmatch_voodoo
- committed revision 794   by wesley johnson
Fix extraneous voodoo dolls spawned in deathmatch, broken by voodoo
patch.

*** w67_coop_damage
patchfile = w67_coop_damage
- committed revision 795   by wesley johnson
Fix damage tests to allow monster damage during coop play, broken by
voodoo patch.

*** w68_braintargets
patchfile = w68_braintargets
- committed revision 796   by wesley johnson
Remove hard limits for braintargets, similar to prboom.
Prevents overrun of braintargets array.
Resolves bug 1001667, from 2004.

*** w68_vile_bugs
patchfile = w68_vile_bugs
- committed revision 797   by wesley johnson
Vile ghost fix commented.
Vile revived stuck together bug fixed, similar to zdoom and prboom,
fixing bug 1037683.
Vile fire location bug fixed, similar to prboom.

*** w68_menu_exitgame
patchfile = w68_menu_exitgame
- committed revision 799   by wesley johnson
Fix game menus, so that the check for "already playing" will give
the user an immediate message asking "Abort this game Y/N".  Upon a
YES it will quit the game and let the user continue.
Combine 3 static menu msg buffers into one large one.  There can
be only one menu message at a time.

*** w68_menu_mouse
patchfile = w68_menu_mouse
- committed revision 800   by wesley johnson
Fix mouse bugs in menus.
Fix so mouse cannot change values until button pushed, because previously
one mouse slide could accidently change a dozen values.
Extraneous mouse tracking removed.
Menu mouse sensitivity put in a define and lowered.

*** w69_fs_rename
patchfile = w69_rename
- committed revision 801   by wesley johnson
Rename global fragglescript variables to fs_.
Apply standard indenting.
Rename enum defs to TT_ BRACKET_ FSVT_ and FSST_.
Other minor cleaning.

*** w69_fs_parse
patchfile = w69_parse
- committed revision 802   by wesley johnson
Fix fragglescript parsing to use safer, faster
string handling code, to protect against overrun of strings.

*** w69_fs_args
patchfile = w69_fs_args
- committed revision 803   by wesley johnson
Simplify fragglescript function args concatenation.
More indenting and cleanup.

*** w69_fs_misc
patchfile = w69_fs_misc
- committed revision 804   by wesley johnson
Fix some extern defs in fs code to use header file.
Rename some enum as WT_.
Change some sprint into snprint.
Some other minor cosmetic changes.

*** w69_fs_var_rename
patchfile = w69_fs_var_rename
- committed revision 805   by wesley johnson
Rename fragglescript var and value types.
Rename array savelist and types.
Rename Init of arrays.

*** w69_fs_docs
patchfile = w69_docs
- committed revision 806   by wesley johnson
Fix docs for latest patches.

*** w70_timelimit_bug
patchfile = w70_timelimit
- committed revision 807   by wesley johnson
Fix timelimit to use tics, fixing bug 989967.

*** w70_savegame_spaces
patchfile = w70_savegame_spaces
- committed revision 808   by wesley johnson
Fix code so savegame description allows spaces again.

*** w70_pld_Makefile
patchfile = w70_pld_Makefile
- committed revision 809   by wesley johnson
Fix Makefile to link with "-lm" because of MATH1 functions pow and powf.
Submitted by pld-Linux patch lib.

*** w70_pld_linux_x_video
patchfile = w70_pld_linux_x_video
- committed revision 810   by wesley johnson
Accept some patches submitted from pld-linux patch lib.
In linux_x port, handle larger number of vidmodes without crash.
In linux_x port, do not force Colormap upon X, when not in x_pseudo
(TrueColor) we handle colormapping.

*** w70_netcmd_WRITESTRINGN
patchfile = w70_netcmd_WRITESTRINGN
- committed revision 814   by wesley johnson
Linux 2.6 compile warning messages squashed, and smaller code.

*** w71_kin_progress
- committed revision 815   by wesley johnson
Move kin log file "progress.txt" from linux_x/ to _logs/.

*** w70_TNT
patchfile = w70_TNT
- committed revision 816   by wesley johnson
Fix TNT recognition.

*** w71_linux_x
patchfile = w71_linux_x
- committed revision 817   by wesley johnson
General repairs to linux_x directory.
Update system calls to same changes as made recently to SDL.
Fix prototype changes.
Deactivate unused code and obsolete code.
Fix keyboard translation and event posting.
Add X error handler code.
Fix X joystick code.
Verified to run Linux X11 in software mode.

*** w72_spritelump_type
patchfile = w72_spritelump_type
- committed revision 818   by wesley johnson
Combine sprite lump tables into one record and array.

*** w72_spritelump_limits
patchfile = w72_spritelump_limits
- committed revision 819   by wesley johnson
Fix spritelump array to be dynamic expanded, thus removing spritelump
limits.  This fixes the last issue of bug 3157859.

*** w72_dehacked
patchfile = w72_dehacked
- committed revision 820   by wesley johnson
Fix dehacked special string copy to use Z_Strdup like the other fixes,
so do not write const string.
Some minor code changes.
Add some comments and {}.

*** w72_cheat_char
patchfile = w72_cheat_char
- committed revision 821   by wesley johnson
Fix CheckCheat to use the ASCII char in the event (data2), and not the
16bit char in data1, to avoid special keys being mistakenly recognized.
The cheat code saw the 0 key =0x48 and LSHIFT key =0x0148 to be the
same by accident.
This fixes bug 3194389.

*** w72_spritelump_type_fix
patchfile = w72_spritelump_type2
- committed revision 824   by wesley johnson
Fix bug in spritelump_type patch where the signs of two hardware
render lines got changed.  (Late night, copying too much)

*** w73_missile_prep
patchfile = w72_missile_prep
- committed revision 825   by wesley johnson
Cleanup of code around missile movement.
Prep for mancubus missile bug fix.

*** w73_mancubus_walls
patchfile = w72_mancubus_walls
- committed revision 826   by wesley johnson
Fix bug of mancubus fireballs going through walls.
Fix bug of missiles exploding within walls instead of upon them.

*** w74_misc
patchfile = w74_misc
- committed revision 829   by wesley johnson
Made extensive use of pmo = player->mo.
Added comments.
Straigtened code indentation, added some {}.

*** w74_boom_demo
patchfile = w74_boom_demo
- committed revision 830   by wesley johnson
Created DemoAdapt functions to change engine settings for demos.
Fix demo code to better handle boom, prboom, demos.
Use more of the demo setup variables.
Correct the turn code to use relative turns for boom demos.
Commented more of the demo code.

*** w74_boom_demo
patchfile = w74_boom_demo
- committed revision 831   by wesley johnson
Seemed to miss something on first try.

*** w74_demo144
patchfile = w74_demo144
- committed revision 832   by wesley johnson
DoomLegacy demo format will have a header of version 144, and the
characters "DL".  DoomLegacy demos shall only use the one demo version number.
Three later fields shall record the DoomLegacy VERSION, demoversion,
and sub-demoversion numbers.
Not yet enabled, alpha still writes demoversion 143.

*** w74_boom_demo
patchfile = w74_boom_demo
- committed revision 833   by wesley johnson
Remove duplicate code inserted by svn 831.

*** w74_sector_friction
patchfile = w74_sector_friction
- committed revision 834   by wesley johnson
Changed to MBF style sector friction (from examination of Killough code in prboom),
making DoomLegacy more consistent with DoomLegacy 2.0, prboom and
other modern ports, with some fixes and differences.
Water friction and Heretic friction are also converted to sector friction.
Sectors get the friction and movefactor values at load time,
and are updated whenever a flag or friction control changes.
Finds stickiest friction on icy sector edge too.
Independent friction for each 3dfloor slab.
Old boom friction thinker code is compile-time conditional (FRICTIONTHINKER),
and is only used for demos. Demos select appropriate friction code.
Rearranged some Move and Thrust functions during the conversion.
Did not preserve perfect demo compatibility with Boom and prboom.
Moved a Heretic chicken friction calc, which may have fixed a latent bug.

*** w74_player_bob
patchfile = w74_player_bob
- committed revision 835   by wesley johnson
Converted to independent player bob momentum of Killough, as in DoomLegacy 2.0,
MBF and prboom, with fixes and adaptations.
Compile-time conditional on BOB_MOM.
Fixes many problems of previous bobbing, such as bobbing while riding
conveyor, and interaction with friction.

*** w74_3dfloor_opening
patchfile = w74_3dfloor_opening
- committed revision 836   by wesley johnson
Rewrite of 3dfloor opening code, simplified logic, moved redundant
tests making it faster, and fixed an error.
Old code could select floor and dropoff floor as 3dfloor slabs on same
side of line.

*** w74_monster_friction
patchfile = w74_monster_friction
- committed revision 837   by wesley johnson
Monsters use same sector friction as players.
Selection mechanism for monster friction (none, MBF, momentum).
The MBF monster friction only gives the monster momentum on ice, 
and this creates surge when moving off ice, and stall when moving onto ice.
Momentum monster friction selection accumulates momentum on every move,
and fixes the surge and stall problems.
Additional code to prevent hangups on dropoff ledges, get monster
unstuck from edges, and to allow monsters to fall off conveyor belts.
Pass detection of dropoff to calling routines.
Renamed P_Move to P_MoveActor.
Tuning required months of testing and adjusting algorithms.

*** w74_adv_options_menu
patchfile = w74_adv_options_menu
- committed revision 838   by wesley johnson
Create Adv Options menu, for monster friction, gravity, voodoo mode,
voodoo insta-death, and door delay.

*** w75_flip_offset
patchfile = w75_flip_offset
- committed revision 840   by wesley johnson
- committed revision 842   had log, but not code patch
As suggested by Fraggle, use (width-offset) instead of offset when displaying a
sprite frame flipped.

*** w75_docs
patchfile = w75_docs
- committed revision 843   by wesley johnson
Update docs for alpha3 release.

*** w76_monster_stuck
patchfile = w76_monster_stuck
- committed revision 847   by wesley johnson
Fix monster momentum friction to help stuck monsters.
Must have full speed impulse for stopped monsters because some wads,
like TNT, have overlapped monster positions, and it depends upon that
vanilla behavior to get them unstuck from each other.

*** w76_z_test_notes
patchfile = w76_z_test_notes
- committed revision 848   by wesley johnson
Part of the code for z_testing of monsters is disabled and it is not a
mistake.  The code existed previous to heretic code inclusion, and
heretic has similar behavior.  This documents the variables and code
that belong to the old code.

*** w76_multimenu
patchfile = w76_multimenu
- committed revision 850   by wesley johnson
Reorganize the multiplayer menus.
Main menu is now compatible with original (and does not have any legacy.wad
graphics), to allow menu modifications like in Plutonia2.
Created a SingleMulti menu to select between (Single player, Two
player, Multi-player).
The two player setup has been fixed to allow setup before starting
server.

*** w76_levelname
patchfile = w76_levelname
- committed revision 851   by wesley johnson
Level names for TNT and Plutonia were not displayed because they
depended upon gamemission, which was never setup.  Replaced logic
with gamedesc_id, which gives same information.
Removed gamemission.
Cleaned up some related macros and levelname functions.

*** w76_TNT_MAP30_stair
patchfile = w76_TNT_MAP30_stair
- committed revision 852   by wesley johnson
TNT MAP30 depends upon a stair builder bug that was fixed by Boom.
Fix using DemoAdapt so that for TNT MAP30, it disables the Boom
stairbuilder fix (giving the original buggy code).  Sometimes the bug
increments a stair twice.  TNT MAP30 has 24 steps, but they removed some
linedefs to have only 18 steps (some of which increment by 16) because
of the bug.

*** w76_TNT_MAP31_key
patchfile = w76_TNT_MAP31_key
- committed revision 853   by wesley johnson
TNT MAP31 yellow key is missing because wad has it marked as
multiplayer only.  This makes it impossible to finish the level.
This fix removes the multiplayer flag from this key, for this game and map.

*** w76_plutonia_text
patchfile = w76_plutonia_text
- committed revision 854   by wesley johnson
The plutonia text was missing, and TNT text was not displayed.
Added P1TEXT .. P6TEXT.
Tried to enter the plutonia text by hand, but had errors, and had to
copy it from prdoom and plutonia2 (to get plutonia2 DEH to work).
Fixed the finaltext logic to select Doom2, plutonia, or TNT text.

*** w76_text_reorg
patchfile = w76_text_reorg
- committed revision 855   by wesley johnson
Text enum names moved from d_englsh.h to dstrings.h, as they are
universal to french, english, and all languages.
Removed text[] that are not changable from DEH.  This forced
several strings with SAVEGAMENAME combined at compile-time with other
strings, to be made to combine at run-time.
SAVEGAMENAME usage also changed to handle savegame name from text[],
because it will changable from BEX.
This is in preparation for BEX text modification code.

*** w77_DEH_Init
patchfile = w77_DEH_Init
- committed revision 856   by wesley johnson
Save all DEH replaced strings into deh_ vars for comparison.
This allows multiple replacements of the same string, or other name,
without mutual interference.  Because FreeDoom will contain such a DEH
lump, it would have prevented any other PWAD from using DEH to replace
the same string.  The save is performed in DEH_Init.

*** w77_DEH_strcasecmp
patchfile = w77_DEH_strcasecmp
- committed revision 857   by wesley johnson
DoomLegacy and other ports changed to using strcasecmp, so that lumps
would not fail due to name case.  This changes most DEH string
comparisions to use strcasecmp.

*** w77_DEH_replace_string
patchfile = w77_DEH_replace_string
- committed revision 858   by wesley johnson
A common replace_string function is created.
It performs checks against hostile strings, ensuring that replacement
strings contain only the % that the original string contained.
It blocks certain characters that are considered dangerous, and have
been used to attack programs.
It allocates the new string using malloc, instead of Z_Alloc.
Define DEH_RECOVER_STRINGS, enables the testing of strings
for being const or malloc, and recovery of malloc memory.

*** w77_BEX_flags
patchfile = w77_BEX_flags
- committed revision 859   by wesley johnson
Add BEX flag by name.  There is a conflict between MF_TRANSLUCENT
which is defined in doomdeh.txt, and MF_FLOORHUGGER which is not.

*** w77_translucent
patchfile = w77_translucent
- committed revision 860   by wesley johnson
Fix the conflict between MF_TRANSLUCENT and MF_FLOORHUGGER.
Change MF_FLOORHUGGER to MF2_FLOORHUGGER.
Adds logic to distinguish between them in old DEH patches.
Fixes translucent code to be affected by BEX changes to MF_TRANSLUCENT.
Change translucent to a table.
Added PACKED_ATTR define so that table can be packed.

*** w77_action
patchfile = w77_action
- committed revision 861   by wesley johnson
Separated action function declares from info.c into new file action.h, so
they can be used in dehacked.c too.

*** w77_BEX_file
patchfile = w77_BEX_file
- committed revision 862   by wesley johnson
Main body of BEX text, pointer, processing.
Recognizes [STRINGS], [POINTER], [PARS], and BEX include.

*** w77_par_time
patchfile = w77_par_time
- committed revision 863   by wesley johnson
Fix par logic to test for BEX modifications, and to display PAR time
only when such PAR times are valid.
Change SUCKS for non-id-games to have a limit of 24 hours, so
the player can see their time.

*** w77_devgame
patchfile = w77_devgame
- committed revision 864   by wesley johnson
Check -devgame parameter for valid <name>, before using it, preventing
segfault.

*** w77_french
patchfile = w77_french
- committed revision 865   by wesley johnson
Convert d_french.h to a run-time replacement of text[] strings, after
DEH has made a copy.  Now FRENCH can be used with DEH string replacement.
There are functions to replace non-game strings, and game strings
separately, and functions for heretic and chexquest strings.
There are calls at the appropriate places in d_main.c.
The d_french.h file has many new strings that need translation.

*** w77_BEX_language
patchfile = w77_BEX_language
- committed revision 866   by wesley johnson
Added BEX_LANGUAGE option that loads a BEX file to replace all strings
in text[].  This more limited in the strings it can reach, but the bex
file can be changed for any language without compiling the source.
It accepts a parameter  -lang <name>, where <name> can be any language
name (i.e. french, german, etc.).  It will form a filename, french.bex,
and attempt to process it.  If <name> is blank, or if
BEX_LANGUAGE==AUTO, is selected, it will use the default, "lang.bex".
Changed BEX to also accept strings with double quotes.
The french.bex file has many new strings that need translation.

*** w77_action_french_files
- committed revision 867   by wesley johnson
Add action.h and lang_bex/french.bex to the svn system.

*** w78_help_docs
patchfile = w78_help_docs
- committed revision 868   by wesley johnson
Update legacy.html with correct installation instructions, fix errors.
Improve -help command line switch.
Add a -v switch for verbose, and use it to print out more information.

*** w78_max_wadpath
patchfile = w78_max_wadpath
- committed revision 869   by wesley johnson
Use MAX_WADPATH for almost all file path string manipulation.
Add cat_filename function to encapsulate proper file name concatenation.
Protect filename strings against extra long strings in command line, wad,
and config files.
Harden many string operations against buffer overflow.

*** w78_net_playdemo
patchfile = w78_net_playdemo
- committed revision 870   by wesley johnson
Update some net functions to use ptrs instead of repeating array
indexing.
Harden a net buffer string operation against buffer overflow.
Fix DeferredPlayDemo function, to put command in Execute as one
string, so it does not execute partial strings and fail.

*** w78_win32_compile
patchfile = w78_win32_compile
- committed revision 871   by wesley johnson
Additions to Makefile to support compilation on Win98 using MinGW.
Create /dep file to hold *.dep files outside of source code.
Change to WIN32 GlobalMemory lib call that is present on Win98.
Fix dehacked.c problems with compiler not likely unsigned char in lib calls.
Allow underline in dehacked/BEX names.
Some other gcc 4 compiler complaints fixed.

*** w78_execute_config
patchfile = w78_execute_config
- committed revision 872   by wesley johnson
Execute of config file on window systems fails because the COM buffer
system mangles windows path backslashes.  Extensive fixes to COM
buffer handling to prevent this, by distinguishing script commands and
those commands that have filename parameters.

*** w78_com_args
patchfile = w78_com_args
- committed revision 873   by wesley johnson
Update COM buffer execution interface.
The COM_args function is unused.
Added COM_Args function that returns count and first 4 com parameters.
This makes for fewer calls, converts calls into literal array access.

*** w78_command_files
patchfile = w78_command_files
- committed revision 874   by wesley johnson
Make doomwaddir, legacyhome, config file strings hardened against
windows no having environment variables.
Will now search two possible doomwaddir names before trying current
directory.
No longer allows current directory to be "" string, as that results in
save and config files being put into root directory.  Will copy the
current directory string instead and use only absolute paths.
Doomwaddir code and config file code moved and organized together.

*** w78_nosound
patchfile = w78_nosound
- committed revision 875   by wesley johnson
The nosound variable name conflicts with a Watcom support function.
The support function really ought to be named better, but cannot fix
that.  Rename nosound, to nosoundfx, as sure fix.
Watcom compilation still has other problems.

*** w78_blockmap_mem_corrupt
patchfile = w78_blockmap_mem_corrupt
- committed revision 876   by wesley johnson
With a missing or bad blockmap in the wad, the code will corrupt
Zone memory block headers.
Add checks for the missing blockmap, and overruns of the blockmap
allocation.
Add more complete ZONEID checking (some as PARANOID) and better reports to the
Zone memory functions.

*** w78_video_misc
patchfile = w78_video_misc
- committed revision 877   by wesley johnson
Comment video setup functions, so they are more understandable.
Straighten video menu switch, unnecessarily complicated.

*** w78_whatsnew
patchfile = w78_whatsnew
- committed revision 878   by wesley johnson
Update legacy.html and whatsnew.html docs to svn877.

*** w78_Make_win32
- committed revision 879   by wesley johnson
Doc file on how to make DoomLegacy on Win32 system.

*** w79_duplicate_symbols
patchfile = w79_duplicate_symbols
- committed revision 881   by wesley johnson
Working on Mac has revealed that our linker is not showing us duplicate
symbols and is combining them.
Added linker flag to give warning when duplicate symbol.
Fixed some vars that should be static.
Fixed some header variable declares that were not extern.

*** w79_deh_flags
patchfile = w79_deh_flags
- committed revision 882   by wesley johnson
The previous BEX code really messed up the DEH flags code, such that in phobiata
the player could not slide along the walls.
This fixes the DEH and BEX flags logic so that DEH changes only the
flags it intends to and clears flag2 bits (like MF2_SLIDE) only when it
shows that it is changing flag2 bits.

*** w79_deh_text
patchfile = w79_deh_text
- committed revision 883   by wesley johnson
Some text strings got changed (DOS -> your os) and now DEH cannot
recognize them.  This adds a hashed lookup that can recognize strings
that we no longer have, and point DEH at the right string.
It also is used by chex newmaps.c to recognize ult doom strings after
the chex modifications have changed all the strings.
Chex also changed some strings with two %s, to have one %s, and Newmaps
wants to change it back to two %s.  The %s counting method would not
allow this, so a new explicit table had to be created.

*** w79_demo_ctrl
patchfile = w79_demo_ctrl
- committed revision 884   by wesley johnson
Fix the demos so they stop interfering with savegame loading.
The screen would wipe, and then wipe a second time and the controls
would be useless.
Created a new contol var, demo_ctrl, that stops demos once a savegame
has been loaded, and does the advance demo job too.  It replaces advancedemo.

*** w79_demo_friction
patchfile = w79_demo_friction
- committed revision 885   by wesley johnson
Attempt to fix demos to record and honor monster friction settings.
Older demos need to use MBF monster friction or Doom no friction.

*** w79_save_limit_99
patchfile = w79_save_limit_99
- committed revision 886   by wesley johnson
Prevent savegames over 99.  Would crash on load.
Was missing explicit check.

*** w79_jumpgravity
patchfile = w79_jumpgravity
- committed revision 887   by wesley johnson
JUMPGRAVITY is variable by fragglescript, no longer a macro.
Change it to jumpgravity.

*** w79_team_name
patchfile = w79_team_name
- committed revision 888   by wesley johnson
Fix segfault when command "teamplay 1".
Team_name[] was array of ptrs to const strings, and the const strings
cannot be written.  Created basic team structure, with name.
Only basic functions for team name for now, but can become a dynamic list.

*** w79_deathmatch_spawn
patchfile = w79_deathmatch_spawn
- committed revision 889   by wesley johnson
Fix bug 1095897.
Players spawn in deathmatch on other players, and get locked.
Tests for this were in code, but failed because player corpse does not have
MF_SOLID set, thus things check was skipped.
Must temporarily set MF_SOLID to do CheckPosition test.
Changed player corpse to honor cv_solidcorpse setting.
Set MF_SOLID on solid player corpse.

*** w79_FIXED_MAX
patchfile = w79_fixed_max
- committed revision 890   by wesley johnson
Use of MAXINT on 32 bit fixed_t variables is not safe on 64 bit machines.
Define a FIXED_MAX and FIXED_MIN that are used as the max and min
of fixed_t variables.
These can be maintained according to the size of fixed_t.
Change all used of MAXINT with fixed_t vars to use FIXED_MAX and FIXED_MIN.

*** w79_spec_enum
patchfile = w79_spec_enum
- committed revision 891   by wesley johnson
Most enum names in spec.h look like variable names.
Give them prefixes.

*** w79_lowest_ceiling
patchfile = w79_lowest_ceiling
- committed revision 892   by wesley johnson
Search for lowest ceiling was flawed by an additional paranoid test that
would also defeat a Boom search limit meant to prevent overflow.
Removed the additional paranoid test.
Tuned other sector floor and ceiling height searches to execute faster,
as they were using n! passes of the thing list.

*** w79_floor_up
patchfile = w79_floor_up
- committed revision 893   by wesley johnson
Fix bug 0585154.
In Doom2 Map05, two doors to secret rooms will not work.
If another door (1st of 4 doors on left) is opened first, then tag 9
will move the floors of these two rooms like doors.
Checks against hitting something had been made conditional on 3D floors,
for some reason.  Restoring these tests stopped the floors movement
like the original, and the flawed Map05 is then still playable.
Must be careful to not have problem with Doom2 Map06, with the spider
demon in the crusher.  Some possible tests would freeze the crusher if
something was stuck in the ceiling or floor.
This is enabled by COMPAT_FLOOR_STOP, for now.

*** w80_vid_defs
patchfile = w80_vid_defs
- committed revision 894   by wesley johnson
Revise vid structure to handle problems with MAC and direct video.
The driver sets up the display and screen size according to its
characteristics.
The buffer width can be different than the screen width, to handle the
Mac which pads it buffer lines to a power of 2.
The driver can control the video buffer width independently of the
screen buffer width, neither of which need to match the screen width.
Contains fields that are multiplied by the buffer width.
Fixes many common draw routines to increment by buffer width instead of
screen width so they are correct for any driver buffer choice.
Fixes uses of bpp as byte to be bytepp, as bpp is bits-per-pixel.
Introduces the controls for DRAW8PAL, DRAW15, DRAW16, DRAW24, DRAW32.

*** w80_vid_port_fixes
patchfile = w80_vid_port_fixes
- committed revision 895   by wesley johnson
Minimal fix of djgppdos, linux_X, macos, os2, sdl, win32, port drivers for
the new vid structure.  This is a temporary fix, as they need to be rewritten.

*** w80_vid_control_fixes
patchfile = w80_vid_control_fixes
- committed revision 896   by wesley johnson
Fixes for new vid structure, to use drawmode, and buffer line sizes in
many draw routines.
Introduces code that uses drawmode to select bpp drawing, instead of
testing bpp.
Changes borderpatch to borderflat, as it is not a patch that is drawn.
Changes setmodeneeded to use -1 as inactive, instead messing with
changing 0.. to 1.. everywhere.
Saves true bpp to config, instead of some hacked value.
Fixes am_map, d_main, f_wipe, m_menu, r_data, r_draw, screen,

*** w80_video_fixes
patchfile = w80_video_fixes
- committed revision 897   by wesley johnson
Code has not used dirty rectange limited drawing since DOS.
Disable Mark_Rect function and calls using DIRTY_RECT macro.
Introduce ENABLE_DRAW15, ENABLE_DRAW16, ENABLE_DRAW24, ENABLE_DRAW32
macro controls in doomdef.h for conditional draw code.  User can disable
compiling drawing code for modes they cannot use.
Introduce pixel structures for 24bpp, and 32bpp.
Introduce color translation table, color8, that works for all draw
modes, replacing color8to16.  Init it when screen bpp is determined.
Fix draw16 to use uint16_t instead of short.
Introduce basic draw functions, V_GetDrawAddr, V_DrawPixel, V_DrawPixels,
that work in all bpp draw modes, for use in splash screens, wipes, and
the like.
Fixed V_CopyRect, VID_BlitLinearScreen, V_DrawMappedPatch,
V_DrawScaledPatch, HWR_DrawSmallPatch, V_DrawTranslucentPatch,
V_DrawPatch, V_BlitScalePic, V_DrawFill, V_DrawFlatFill,
V_DrawFadeScreen, V_FadeConsBack, to draw correctly using buffer width
and drawmodes.
Update V_DrawTiltView and V_DrawPerspView in similar fashion,
but they have other serious problems.
Diabled V_DrawBlock and V_GetBlock because they were not safe for use
on screens with extended draw modes,
and substituted other existing draw routines for the uses.

*** w80_map_con
patchfile = w80_map_con
- committed revision 898   by wesley johnson
Fix draw of auto map for all draw modes, using V_DrawPixel.
Fix draw of CON_DrawBackPic for all draw modes, using V_GetDrawAddr
and V_DrawPixel.
Fix draw of D_PageDrawer for all draw modes, using V_DrawPixels.

*** w80_finale_init
patchfile = w80_finale_init
- committed revision 899   by wesley johnson
Fix draw of finale screens, for all draw modes, using V_DrawPixel.
Fix screenshot to use correct buffer widths, but it is still limited to
8bpp mode because of the save format.
Fix fuzz init, and ylookup init, for all draw modes.
Fix R_FillBackScreen, R_DrawViewBorder, for all draw modes, using V_DrawPixels.
Fix wi_stuff, for all draw modes.

*** w80_wipe
patchfile = w80_wipe
- committed revision 900   by wesley johnson
Change wipe functions to not pass parameters they do not use, and also
fix them for all draw modes.
Remove ColMajorXForm transform, as it was not really faster, and
was limited to 8bpp, now using a simple pixel copy.
Created a proportional fade for the extended draw modes, which is not
as smooth as the 8bpp translucent tables, but gives similar function.
Reorganized strange wipe control table for simpler access.

*** w80_request_bpp
patchfile = w80_request_bpp
- committed revision 901   by wesley johnson
Introduce new command line switches and common control structure, so that
each port driver does not do this in a unique way.  The port drivers now
react to the common control variables.  Most old control variables
declared in the port drivers, such as rendermode, vidwait, fullscreen,
have been moved to video.c.
A new V_Init_VideoControl, now registers common controls.
A new V_CanDraw, returns true when a bpp can be drawn.
Set req_drawmode according to command line requested drawmode.
Switch "-highcolor", now sets REQ_highcolor (request a 15 or 16 bpp mode).
Switch "-truecolor", sets REQ_truecolor (request a 24 or 32 bpp mode).
Switch "-native", sets REQ_native, which requests use of the native
drawing mode.
Switch "-bpp 15", sets req_bpp and REQ_specific, which requests a
specific bpp mode (can be 8, 15, 16, 24, or 32).
Fixes DrawPixel routines to use direct ptr access to pixels, which
should give the fastest code.

*** w80_draw16_minimal
patchfile = w80_draw16_minimal
- committed revision 902   by wesley johnson
Fixed draw16 routines to give minimal functionality.
Fixed translucent draw using proportional addition of pixels.

*** w80_sdl_port
patchfile = w80_sdl_port
- committed revision 903   by wesley johnson
Extensive rewrite of mode code in sdl port driver.
It now handles all bpp mode requests.
I_StartFrame no longer locks the video buffer, because that needs to be
kept to a minimal time, during I_FinishUpdate.  This is dictated by
SDL specs.
VID_PrepareModeList merged into I_StartupGraphics.
Use of SDL_GetVideoInfo made useful (instead of bypassed).
Created VID_SetMode_vid to do actual mode setting, to reduce
duplicated effort.
Extensive video reporting using verbose switches "-v" and "-v2".

*** w80_testbpp
patchfile = w80_testbpp
- committed revision 904   by wesley johnson
Adds a command line switch "-testbpp", that forces the bpp requested to
succeed.  The hardware actually uses the native bpp and converts the
drawn bpp in I_FinishUpdate.  This is meant for test and development of
the extended bpp draw modes, when matching hardware is not available.
This code is conditional on the TESTBPP macro, and only exists in
sdl/i_video.c at this time.

*** w80_draw16_ext
patchfile = w80_draw16_ext
- committed revision 905   by wesley johnson
Moved common draw routine from r_draw8.c to r_draw.c.
Fixed r_draw8.c to use ybytes instead of width.
Added translucent_index variable and field because translucentmap ptr
only worked for palette based drawing.
Fix r_draw16.c so that 15 and 16 bpp draw functions work.
Create new draw functions for those that were missing.
Create transparent and fog effects using shift and add of 15 and 16 bpp pixels.
Has many alternative code sections for further experimentation.

*** w80_fade16
patchfile = w80_fade16
- committed revision 906   by wesley johnson
Fix screen fade effects for 15/16 bpp drawing.

*** w80_testbpp_8
patchfile = w80_testbpp_8
- committed revision 907   by wesley johnson
Explicit reject of -bpp 8 -testbpp.

*** w80_r_draw
patchfile = w80_r_draw
- committed revision 908   by wesley johnson
Makefile must compile r_draw.c anytime any r_draw8.c, r_draw16.c,
r_draw24.c or r_draw32.c is modified.
Add empty r_draw24.c and r_draw32.c.
Fuzztable offsets needed to be multiple of pixel size.

*** w80_SDL_video_error
patchfile = w80_SDL_video_error
- committed revision 909   by wesley johnson
Fixes SDL port driver so that StartupGraphics does not return unless
has valid video mode and display.  Print appropriate error message to
stderr.

*** w80_draw_endian
patchfile = w80_draw24_endian
- committed revision 910   by wesley johnson
Fix DrawPixel for big endian machines.

*** w80_draw_24bpp_create
patchfile = w80_draw24_create
- committed revision 911   by wesley johnson
Create functions for DRAW24 mode.
Fill in functions in r_draw24.c and other support.
Improved fog.
Not fully optimized.

*** w80_draw_32bpp_create
patchfile = w80_draw32_create
- committed revision 912   by wesley johnson
Create functions for DRAW32 mode.
Fill in functions in r_draw32.c and other support.
Not fully optimized.

*** w80_green_console
patchfile = w80_green_console
- committed revision 913   by wesley johnson
Fix green console to be more readable and not distort colors in 15..32 bpp.
Add GREEN_TINT_255 control, set to 0x16.
Dim background to 25% for higher contrast (gray green).

*** w80_fade_32
patchfile = w80_fade_32
- committed revision 914   by wesley johnson
Fix fade effects for 24/32 bpp drawing

*** common/colortst.wad
- committed revision 915  by wesley johnson
colortst.wad update for fog effects

*** w80_background_border_32
patchfile = w80_backborder32
- committed revision 916   by wesley johnson
Fix background border not filling screen in DRAW32 and other video
modes.  Needed to multiply side size by bytepp.

*** w80_video_init
patchfile = w80_video_init
- committed revision 917   by wesley johnson
Change V_Init to V_Init_Draw, and make it responsible for setup of
draw variables for DrawPixel and other v_video draw routines.
Have it make needed palette (palette was missing during intro screens).

*** w80_linux_xshm
patchfile = w80_linux_xshm
- committed revision 918   by wesley johnson
Update linux xshm to latest interface and improve code.
Can handle drawing in -native bpp mode, -highcolor, -truecolor modes, and
using -bpp.
It will setup direct draw to the image buffer using native bpp (-native).
This does not change the hardware bpp, nor the previous method of leaving the
hardware bpp at the system setting, and converting our 8bpp draw buffers to it.
Changing hardware bpp is possible, I just cannot find the docs at this time.

*** w80_linux_ggi
patchfile = w80_linux_ggi
- committed revision 919   by wesley johnson
Update linux ggi to latest interface and improve code.
Can handle drawing in -highcolor, -truecolor modes, and using -bpp.
Will change hardware bpp.
Does not detect native bpp.
This has not been test compiled as I do not have ggi libraries.

*** w81_cleaning
patchfile = w81_cleaning
- committed revision 920   by wesley johnson
Fix comments, add {}, remove dead code and obsolete commented out lines.
Align code.
Cleanup some messy code arrangements to cleaner equivalent.
Rename enum items cl_ to CLM_.
Rename SendRam to SendData.
Rename enum freemethode_t with SF_ to enum TAH_e with TAH_,
because of confusion with other enums, and gave the enum more descriptive names.
Make KICK defines into an enum kick_msg_e.
Rename enum filestatus_t to filestatus_e.
Rename fwriteshort to fwrite16, fwritelong to fwrite32.

*** w81_Doom2Map8
patchfile = w81_Doom2Map8
- committed revision 921   by wesley johnson
Missing break stmt in switch stmt.
Doom2 Map8 is dropping into secret level code,
even though it is not a secret level.

*** w81_pain_skullspawn
patchfile = w81_pain_skullspawn
- committed revision 922   by wesley johnson
Fix bugs and irritations in pain elemental, skull spawning.
Skull limit code made conditional on demoversion, using EN_skull_limit.
Pain elemental skull spawning made conditional using EN_old_pain_spawn.
Checks added for skulls and pain elementals attacking dead monsters,
may not be needed, but will test.
Formally init target and tracer ptrs in mobj.

Fixed skull spawning using a version of Boom code that checks on line
crossings.  Partial checking code already present was rewritten into
P_CheckCrossLine.
Skulls no longer spawn into void walls.

Pain elementals fixed so if there is not room to spawn skull, it silently
removes the skull instead of sending it down to floor to explode.
Conditional code is present for:
(REMOVE) remove skull (like Edge) (currently selected),
(KILL) explode in place (like prboom) (disabled),
(DAMAGE) which causes it to explode on floor (previous Legacy) (disabled).

*** w81_savegame_buffer
patchfile = w81_savegame_buffer
- committed revision 923   by wesley johnson
Fix for bug_3442118, where Hell Ground wad (hg.wad) map04 will overrun
the savegame buffer.
Increased the reserved free space from 2K to 4K, and the header buffer size.

*** w81_fogsheet
patchfile = w81_fogsheet
- committed revision 924   by wesley johnson
Fogsheet improvements.
Drawing routines for fog sheet with shifting effects, using mid texture.
Mid texture determines the color of the fog, and the intensity of the
shifting pattern.
Fog is not finished.

*** w81_Boom_translucent
patchfile = w81_Boom_translucent
- committed revision 925   by wesley johnson
Fixed Boom translucent linedef 260.
Tagged lines now get the translucent effect too.
Recognizes and uses named translucent lumps introduced by linedef 260.
Analyzes Boom translucent lumps to get alpha for DRAW15, DRAW16,
DRAW24, DRAW32, and opengl draw modes, which now work.
Will draw using closest existing translucent implementation, or use
analyzed alpha.
Added TRANSLU_75 in RGB draw routines, to implement a 75/25% translucent draw.
OpenGL does draw the translucent textures in BOOMEDIT.WAD,
but does not draw other transparent textures behind the closest one.
OpenGL also fails to draw transparent over the switches in hg.wad,
due to unknown causes.

*** 
- committed revision 926   by wesley johnson
Add files r_draw24.c, r_draw32.c, which were missing.

*** w81_Boom_colormap
patchfile = w81_Boom_colormap
- committed revision 927   by wesley johnson
Boom deepwater colormap fixed.
Effect menu has selections for Boom Deepwater colormap effect:
Sector colormap (Boom colormap behaves same as Legacy colormaps),
Boom visible colormap (where colormap is visible like in legacy),
Boom colormap (where the colormap is not visible like in Boom),
and Boom detect (which adjusts according to detected Boom and Legacy linedefs).
The Boom colormap selections make the Boom deep water sectors appear
normal until walked into, then the deepwater colormap will have global effect.

*** w81_Boom_pusher
patchfile = w81_Boom_pusher
- committed revision 928   by wesley johnson
Gave the Point pusher a square law effect (enabled by mbf_support),
as in prboom (an MBF feature actually, Boom is not square law).

*** w81_door_thinker_check
patchfile = w81_door_thinker_check
- committed revision 929   by wesley johnson
Derived from prboom fixes doc (cph 2001/04/05).
Doom bug: cannot raise a door when ceiling action is in same sector.
Add check to door logic that ceiling action being modified is a door action.
This also prevents corruption of the ceiling action.

*** w81_wad_to_angle
patchfile = w81_wad_to_angle
- committed revision 930   by wesley johnson
Note prboom fix doc (cph 2001/04/05), of Vanilla Doom bug found by Ville Vuorinen.
Signed mapthing_t angle would create table lookup using negative index.
Fix uses new func, wad_to_angle(), to isolate the signed wad field, from
unsigned angle_t usage.
It does not emulate the Doom buggy behavior.

*** w82_colortst_wad
wads/colortst.wad
- committed revision 931   by wesley johnson
Fog sheets

*** w82_bex_frame
patchfile = w82_bex_frame
- committed revision 932   by wesley johnson
Fix strcmp error in BEX parsing of FRAME and PARS.
Fixes hg.wad, eye shooting missiles.

*** w82_hw_translucent_order
patchfile = w82_hw_translucent_order
- committed revision 933   by wesley johnson
Fix hardware render to draw translucent in distance order.
This fixes BOOMEDIT.WAD.

*** w82_hw_Boom_colormap
patchfile = w82_hw_Boom_colormap
- committed revision 934   by wesley johnson
Boom deepwater colormap fixed in hardware renderer.
Extend view_colormap to affect hardware render too.

*** w82_get_gl_info
patchfile = w82_get_gl_info
- committed revision 935   by wesley johnson
Bug 3419447.
Fix buffer overrun of DBG_Printf strings by video card extensions.
Create common function, Query_GL_info(), to get GL info strings,
check renderer, and set gl_extensions string and oglflags.
Create DBG_Print_lines() function to print extension strings on multiple
lines, and prevent buffer overrun.
Change SDL, Win32, X11 opengl port drivers, to use these functions.
In DBG_Printf(), when verbose, print to stderr too;

*** w82_CONS_Printf_va
patchfile = w82_cons_printf_va
- committed revision 936   by wesley johnson
Fix buffer overruns caused by vsnprintf to buffer without string termination.
Create function CONS_printf_va() to handle va_list printing to console.
This replaces multiple copies of print buffers and vsnprintf.

*** w82_hw_obj_colormap
patchfile = w82_hw_obj_colormap
- committed revision 937   by wesley johnson
Fix hardware render so that colormaps affect objects too.
Fixed HWR_RenderPlane to have colormap parameter, so can pass in floor
and ceiling colormaps, same as in software renderer.

*** w82_hw_StoreWall_float
patchfile = w82_hw_StoreWall_float
- committed revision 938   by wesley johnson
Change HWR_StoreWallRange to have float operands.  Part of the code
treated them as 0.0 to 1.0, and part was integer like the software
renderer.
General spelling fixes, replace some stub decl with proper include.

*** w83_filestatus_e
patchfile = w83_filestatus_e
- committed revision 939   by wesley johnson
Fix filestatus_t stragglers to be filestatus_e.

*** w83_get_gl_info_char
patchfile = w83_gl_info_char
- committed revision 940   by wesley johnson
Fix get_gl_info for (char*) type warnings on newer compilers.

*** w83_fs_linetrigger
patchfile = w83_fs_linetrigger
- committed revision 941   by wesley johnson
Condense some of the door, switch, and other line trigger code.
Fix some floor and switch code to detect incomplete fragglescript
created linedefs (no sidedefs, no frontsector),
and skip secondary actions that would have segfault.
Fix fragglescript to init more fields in temp linedef to some safe
value.
Fixes win32 crash on fragglescript teleport, per Bug 3185357.

*** w80_win32_vid_fixes
patchfile = w80_win32_vid_fixes
- committed revision 942   by wesley johnson
This is not in order, was in the w80 patch series, but did not get committed.
Minimal fix of win32 port drivers for the new vid structure.
This is a temporary fix, as they need to be rewritten.

*** w83_draw32_remove_printf
patchfile = w83_draw32_remove_printf
- committed revision 943   by wesley johnson
Remove a debugging printf that is in svn, but not in my working files.

*** w83_num_skincolor
patchfile = w83_num_skincolor
- committed revision 944   by wesley johnson
Change MAXSKINCOLORS to NUMSKINCOLORS, which is how it is used.
Moved in doomdef as it is dependent upon code, not a setting.
Caused confusion in understanding code.

*** w83_fs_func_safety_checks
patchfile = w83_fs_func
- committed revision 945   by wesley johnson
General cleanup on all fragglescript functions.
Move error code to after return, for speed.
Added many checks for valid mobj and fields that could segfault in fragglescript.
Fixed much of fragglescript code fragility.
There is a compile-time var, OLDBEHAVIOR, that disables some fixes
that would change some details of fragglescript behavior.  It is
assumed that no scripts depend upon these details, but the switch is
included for debugging.  Phobia and hth2 were tested and seem unaffected.
Changed fixedvalue to access int arg directly, which saved 6K in code.
Added comments.

*** w83_fs_op
patchfile = w83_fs_op
- committed revision 946   by wesley johnson
General cleanup on all fragglescript operations.
Move error code to after return, for speed.
Added comments.

*** w83_fs_func_old
patchfile = w83_fs_func_old
- committed revision 947   by wesley johnson
Remove OLDBEHAVIOR code in fragglescript functions.

*** w83_makefile
patchfile = w83_makefile
- committed revision 948   by wesley johnson
Move OBJ of an interface to that interface makefile section.
Made WIN32 interface compilable (which uses different names than the
others).
Removed strange i_cdmus_o var.
Created MAINOBJ var.
Moved linux_x common OBJ (in xshm and ggi) to a common OBJ assign,
leaving only the video.

*** w83_cdmus_optional
patchfile = w83_cdmus
- committed revision 949   by wesley johnson
Make CD-music a makefile compile option.
Setting CDMUS (default is CDMUS=1) in the makefile enables compiling CD
music code.  Without CDMUS, all CD code is removed, including cd-volume
controls.  This allows compiling without some special libraries, that
some interfaces require.
To override default, use NOCDMUS on the make command line, or edit
makefile.
> make NOCDMUS=1

*** w83_fs_array_camera_spec
patchfile = w83_fs_array_spec
- committed revision 950   by wesley johnson
General cleanup on fragglescript array functions,
camera functions, and spec functions (if, elseif, while, for).
Move error code to after return, for speed.
Added comments.

*** w83_fs_script_parse
patchfile = w83_fs_script_parse
- committed revision 951   by wesley johnson
General cleanup on fragglescript script and parse functions.
Move error code to after return, for speed.
Added comments.

*** w83_fs_func_doc
patchfile = w83_fs_func_doc
- committed revision 952   by wesley johnson
Update the fragglescript function docs to the actual code
implementation.
Fix some comments in the code.

*** w83_wipe24
patchfile = w83_wipe24
- committed revision 953   by wesley johnson
Fix wipe for 24bpp draw.  One index was not using bytepp.

*** w84_palette24
patchfile = w84_palette24
- committed revision 954   by wesley johnson
Make color8_translate palette used by draw15, draw16, draw24, draw32,
respond to gamma settings, and palette changes, such as palette flash,
object pickup, damage red.

*** w84_ouchface
patchfile = w84_ouchface
- committed revision 955   by wesley johnson
Previous ouchface fix was not complete.
Needed to set face priority to 8, to keep the ouchface visible for
more than one tic.
Self-damage code also needed ouchface fix.
Ouchface has mouth open wide, "ahhhh".

*** w84_compressed_patch
patchfile = w84_compressed_patch
- committed revision 956   by wesley johnson
Fixes the patch combiner to handle compressed patches (which share some
of the patch columns).  It under-estimated the new size so it did
not allocate enough space for the combined patch, which causes it to
abort into using the picture format instead.
This fixes the elevator railings (SW1COMM) in Requiem.wad MAP08,
which use compressed patches.

*** w84_bob_spawn
patchfile = w84_bob_spawn
- committed revision 957   by wesley johnson
An attempt to clear the player bob at spawn.
Remove some old commented out code.

*** w84_IPX_option
patchfile = w84_IPX_option
- committed revision 958   by wesley johnson
Make IPX network code optional by a define in doomdef.
Makes all IPX code conditional on USE_IPX.
Enabled by default for those that have IPX headers.
This fixes bug in OpenBSD that does not have IPX, but where a specific
test is not in place.

*** w84_whatsnew
patchfile = w84_whatsnew
- committed revision 959   by wesley johnson
Update whatsnew doc to current patch level.

*** w85_colormap_gen
patchfile = w85_1_colormap_gen
- committed revision 960   by wesley johnson
Tune the legacy linedef colormap generate.
The wad alpha of 'a' to 'z' is now converted to 0..255 internally,
to avoid losing alpha intensity to conversion roundoff.
Fixed the drab color of hardware-render at high alpha caused by wrong
alpha conversion calc.

*** w85_mouse
patchfile = w85_2_mouse
- committed revision 961   by wesley johnson
Rewrite of mouse handling, providing relative mouse motion like many other
ports use for SDL, and fixing the WarpMouse code in the absolute mouse motion
that we have been using.
Grabinput has been restored and made to work.
Provides option selection for grabinput.
Provides SDL port with selection for mouse relative or absolute.
Fixes OpenBSD mouse problem of bug/patch 3547682.
OpenBSD reports mouse motion x and y as separate events.  In DoomLegacy
later mouse motion events in a frame overwrote previous motion.  Mouse events
are now added (like Legacy2 and other ports examined).

*** w85_opengl_mode
patchfile = w85_3_opengl_mode
- committed revision 962   by wesley johnson
SDL OpenGL is not switching video modes at all.
In my previous sdl rework, I forgot opengl video mode switch.
This fixes opengl video mode switch similarily to the others, and it now
switches video modes.

*** w85_statusbar_overlay
patchfile = w85_4_statusbar_overlay
- committed revision 963   by wesley johnson
The statusbar and overlay were not positioned correctly in OpenGL.
The statusbar is now consistent for all video modes.
This fixes the overlay to use fdupy instead of dupy.

*** w85_secnode_freed
patchfile = w85_5_secnode_freed
- committed revision 964   by wesley johnson
A previous patch in w79, sped up P_CheckSector, but made it vulnerable
to a second thing being removed by the player on a moving lift,
resulting segfault.  Removed the vulnerable nxt_ns ptr.
Instead, when test determines that secnode was freed then resort to
previous behavior of restarting from beginning of touching_thinglist.

*** w85_fixedcolormap
patchfile = w85_6_fixedcolormap
- committed revision 965   by wesley johnson
Fix bug introduced by BOOM_COLORMAP, which segfaults when restoring
game saved during use of fixed_colormap.

*** w85_heretic_SWITCHES
patchfile = w85_7_heretic_switches
- committed revision 966   by wesley johnson
Allow Heretic and Blasphemer PWAD to fully use the SWITCHES lump without
restricting it to only episode 4.
Other ports do not have any restriction on Heretic use of the SWITCHES entries.
Requested by a Heretic wad project.
Check for missing switch textures and default to use texture 1.

*** w86_viewer_colormap
patchfile = w86_1_viewer_colormap
- committed revision 968   by wesley johnson
Make some BOOM_GLOBAL_COLORMAP code non-optional, for use with fog and
other colormaps.
Shortened some of the Boom Colormap Option text strings so they fit
low-res screens.  This affects saved configs.
Move BSPVIEWER code to r_main and make it non-optional.
Add test for colormap fog using viewer_extracolormap.  This is not
very good fog but at least it works now as documented.

*** w86_FF_cleanup
patchfile = w86_2_FF_cleanup
- committed revision 969   by wesley johnson
Reorganize the FF_flags to be understandable, and easier to test, and
to not hide important relationships.
FF_RENDERSIDES -> FF_OUTER_SIDES
FF_INVERTSIDES && FF_RENDERSIDES -> FF_INNER_SIDES
FF_ALLSIDES && FF_RENDERSIDES -> FF_OUTER_SIDES | FF_INNER_SIDES
FF_RENDERPLANES -> FF_OUTER_PLANES
FF_INVERTPLANES && FF_RENDERPLANES -> FF_INNER_PLANES
FF_BOTHPLANES && FF_RENDERPLANES -> FF_INNER_PLANES | FF_OUTER_PLANES
FF_RENDERALL -> FF_OUTER_SIDES | FF_OUTER_PLANES
FF_CUTLEVEL -> FF_CUTSOLIDS | FF_CUTEXTRA
FF_DOUBLESHADOW -> FF_SLAB_SHADOW
Rework the BSP Fake floor code to be understandable.
Change BSP ffloor to ffplane, because it tracks planes, and there are
too many ffloor references in the code that have other meanings.
ffloors -> ffplane
numffloors -> numffplane

*** w86_Glide_types
patchfile = w86_3_Glide_types
- committed revision 970   by wesley johnson
Cleanup hardware typenames and structs.  Change to use uint32_t and uint16_t.
GlideMipmap_t -> Mipmap_t
GlideTexture_t -> MipTexture_t
GlidePatch_t -> MipPatch_t

*** w86_HWR_types
patchfile = w86_4_HWR_types
- committed revision 971   by wesley johnson
Use type names xxx_t, and "typedef struct" in hardware struct defines.
FColorARGB -> ARGB_t
FRGBAFloat -> RGBA_float_t;
F2DCoord -> v2d_t;
FTransform -> FTransform_t
v3d_t, wallVert3D, FOutVector -> vxtx3d_t  (combined type, no more copy)
EPolyFlags -> PolyFlags_e
ETextureFlags -> TextureFlags_e
ESurfFlags -> SurfFlags_e
FSurfaceInfo -> FSurfaceInfo_t
hwdspecialstate_t -> hwd_specialstate_e
hwdfiltermode -> hwd_filtermode_e
TGAHeader, *PTGAHeader -> TGAHeader_t

*** w86_5_misc
patchfile = w86_5_misc
- committed revision 972   by wesley johnson
Cleanup some code to not have so many return stmts, code should exit
through only a few return stmts.
Cleanup unused functions and redirected functions.
R_GetFlatNumForName -> R_FlatNumForName  (like R_TextureNumForName)
P_FlatNumForName -> P_AddLevel_FlatNumForName (unused)

*** w86_hw_cache
patchfile = w86_6_hw_cache
- committed revision 973   by wesley johnson
Cleanup of code in hw_cache, concerning bytepp, endian issues,
and much better draw code for the various bytepp switches.

*** w86_drawflags
patchfile = w86_7_drawflags
- committed revision 974   by wesley johnson
Add drawflags and appropriate TF_ flags to hw_cache parameters so that do not
have global draw cache modifiers.

*** w86_hw_fx1
patchfile = w86_8_hw_fx1
- committed revision 975   by wesley johnson
Fix hardware draw of fx1 translucent.
Fixes display of linedef 288 in opengl.

*** w86_hw_view_colormap
patchfile = w86_9_hw_view_colormap
- committed revision 976   by wesley johnson
Fix the hardware draw of Boom and view_colormap.
Now see global colormap change with Boom deep water and colormap fog
in opengl mode.

*** w87_mobj_subsector
patchfile = w87_1_mobj_subsector
- committed revision 977   by wesley johnson
Fix segfault in dsv4.  When wrong buttons are pressed player is hurt.
If they are pressed after getting the yellow key, then segfault.
There is a mobj without a subsector, and script code must check first.

*** w87_legacywad
patchfile = w87_2_legacywad
- committed revision 978   by wesley johnson
The legacywad filename used cat_filename with a zmalloc buffer,
but cat_filename requires a buffer of MAX_WADPATH because it
terminates it with 0.  This caused segfault at program shutdown.
Fixed to use strdup after the cat_filename call.

*** w87_light255
patchfile = w87_3_light255
- committed revision 979   by wesley johnson
Light calculations are done in range 0..255.  The LIGHTSEGSHIFT is
only performed at the table lookup.  The extralight is now 0..255.
Calculate the wall orientation light outside of loops.
Simplified much of the light table code.

*** w87_camera
patchfile = w87_4_camera
- committed revision 980   by wesley johnson
Chase camera is now fixed to be usable with splitscreen players, with
the first player getting the chase camera.
This could be expanded to allow two chase cameras now, but the chase camera
gets hung up going through doorways, so I do not recommend it.

*** w87_viewer_display
patchfile = w87_5_viewer_display
- committed revision 981   by wesley johnson
Simplified code of player weapon display by using viewer variables.
Disabled debug printf statement concerning netvars.

*** w87_fs_misc
patchfile = w87_5b_fs_misc
- committed revision 982   by wesley johnson
A portion of w83_fs patches that seems to have got left out.

*** w87_extralight_misc
patchfile = w87_5c_extralight__misc
- committed revision 983   by wesley johnson
A portion of w87_light255 patch that seems to have got left out.

*** w87_translucent
patchfile = w87_6_translucent
- committed revision 984   by wesley johnson
Augmented translucent draw to handle alpha of 0..255 for all draw modes.
DRAW8PAL can now draw translucents by reversing translucent table usage.
RGB draw modes can now draw spans using arbitrary alpha.
Simplified flat draw using some new global variables.
Water can now be drawn with a translucent alpha > 128.

*** w87_plane_merge
patchfile = w87_7_plane_merge
- committed revision 985   by wesley johnson
Hardware render sort changed to merge when adding plane.
Indented code in p_mobj.c.

*** w88_LinkFFloor
patchfile = w88_1_LinkFFloor
- committed revision 986   by wesley johnson
Changed P_AddFFloor to P_LinkFFloor, for clarity.
Changed flags parameter type to uint32_t.
Cleaned up some comments and indenting.

*** w88_fogwater_decode
patchfile = w88_2_fogwater_decode
- committed revision 987   by wesley johnson
Create data structures for translucent effects.
Create effect options for "water effect", and "fog effect".
Change linedef decoding for new water and fog effects, affecting
301 (translucent water), 302 (fog), 304 (opaque water).
Each of these can use the following alpha and fog selection.
For opaque water, it only affects the fog inside.
The #xxx in upper texture that set the alpha now also selects the fog
effect, and the alpha can be 0..255.
Syntax  #xxxF, xxx is the alpha (0..255) and F is the effect.
'A': FW_clear, no fog  (old WATER default)
'B': FW_cast,  paint all surfaces with textures
'C': FW_colormap, use colormap fog (which only colors all sectors)
'D': FW_inside, render inside side, plane views (old FOG)
'E': FW_foglite, outside side, plane views, low alpha overall fog sheet
'F': FW_fogdust, outside, when in fog apply overall fog sheet (FOG default)
'G': FW_fogsheet, outside, overall fog sheet, sector join fog sheet
'H': FW_fogfluid, outside, inside fluid, fogsheet
This only handles the linedefs, the code that draws these is in later patches.

*** w88_extralight
patchfile = w88_3_extralight
- committed revision 988   by wesley johnson
Simplify the addition of extralight and orient light, removing many tests,
by precalculating the extralight for different situations.
Create extralight_cm (3/4 of extralight) for colormap fog,
and extralight_fog (1/2 of extralight) for FF_FOG.
Light precedence is now  FF_FOG, colormap fog, translucent, normal.

*** w88_fogdraw
patchfile = w88_4_fogdraw
- committed revision 989   by wesley johnson
Rewrite all fog draw functions to new specifications.
Average 3 source texture pixels to generate fog color, except DRAW8PAL
which can only average 2 pixels.
Use of fog alpha.

*** w88_fogface
patchfile = w88_5_fogface
- committed revision 990   by wesley johnson
Create the fog face sheets needed for some fog modes.
Draw the fog face sheets when in such foggy sectors.

*** w88_fogjoin
patchfile = w88_6_fogjoin
- committed revision 991   by wesley johnson
Create fog sheets at fog joins for the fogsheet fog model.
This lessens the visibility with distance similar to true fog ray
tracing, but using what is available in this map model.  It tolerates
well mixing fog and non-foggy sectors, which other methods would not.

*** w88_hwfogdraw
patchfile = w88_7_hwfogdraw
- committed revision 992   by wesley johnson
Adds fog drawing and fog texture creation to hardware renderer.
Draw the fog face sheets when in foggy sectors.

*** w88_hwfogjoin
patchfile = w88_8_hwfogjoin
- committed revision 993   by wesley johnson
Create fog draws of join sheets for FF_JOIN in hardware render.

*** w88_hw_waterside
patchfile = w88_9_hw_waterside
- committed revision 994   by wesley johnson
Fix split wall draws so that hardware renderer draws water sides with
3dfloor backsectors, and they are drawn translucent.

*** w88_docs
patchfile = w88_10_docs
- committed revision 995   by wesley johnson
Update editing and whatsnew for alpha 4 release.

*** fogtst.wad
file = common/wads/fogtst.zip
- committed revision 996   by wesley johnson
A wad to test fog effects.

*** w88_alpha4
patchfile = w88_11_alpha4
- committed revision 997   by wesley johnson
Update whatsnew doc for alpha4 release.

*** w88_alpha4_version
patchfile = w88_12_alpha4ver
- committed revision 998   by wesley johnson
Update alpha4 VERSIONSTRING.

*** w88_blockfill
patchfile = w88_13_blockfill
- committed revision 999   by wesley johnson
A previous patch ( w86_hw_cache, svn973 ) caused a bug, triggered when an imp
shoots a fireball.
Used the block ptr as a loop var and returned the same to the caller.
Fixed by giving the loop its own copy of the ptr.

*** w89_offset_patch
patchfile = w89_1_offset_patch
- committed revision 1000   by wesley johnson
FreeDoom is using large patches, with an offset to select a portion.
A single patch texture, with an offset, was generating the wrong
texture.  This detects these and uses the multiple patch combine
generation instead.  Large patches also are directed to multiple patch
combine to avoid multiple large copies of the same patch.

*** w89_savegame_buffer_size
patchfile = w89_2_save_size
- committed revision 1001   by wesley johnson
Second fix for bug_3442118, where Hell Ground wad (hg.wad) map04
could still overrun the savegame buffer.
Increase savegame min free buffer to 64K.
Requires 12643 to write thinkers of hgh2.wad.  If was close to write
trigger that would overrun the 4K free space.

*** w89_boom_translucent_load
patchfile = w89_3_boom_tranlsu
- committed revision 1002   by wesley johnson
RGB draw modes sometimes also use translucent table.
Load the lump for all draw modes.

*** w89_hardware_draw_over_deepwater
patchfile = w89_4_hw_draw_deepwater
- committed revision 1003   by wesley johnson
In ic2005.wad there are three situations where textures are drawn pegged
to mobile deepwater sectors.
1) A translucent over a deepwater door.
2) A transparent texture (electric arc) under a deepwater ceiling.
Pushing a switch turns it on and off.
3) A thin texture used for grid flooring, with deepwater ceiling to move it.
Two sided middle textures must be pegged to the original ceiling,
not to the deepwater sector.
Fixes bug 3169993.

*** w89_heretic_finale
patchfile = w89_5_heretic_finale
- committed revision 1004   by wesley johnson
Fix bug 0799500.
After Heretic E2M8 ending pic, the palette was not restored.
The finale heretic code now a separate func, another state for heretic
finale has been provided (to avoid showing the cast),
and the palette is restored after the underwater pic has been shown.

*** w89_kill_sfx
patchfile = w89_6_kill_sfx
- committed revision 1005   by wesley johnson
Fix bug 3078850, chainsaw sound plays full length.
Many fixes in sound effects playing.
Fixed StopSound to work, needed for chainsaw.
Added flags to sounds to control tests and sound killing,
(SFX_single, SFX_id_fin, SFX_saw, SFX_player, SFX_org_kill, and others).
Multiple sfx per origin are allowed as default.
Changed the tests for specific sounds in the port drivers to flag tests.
Updated port sound effect drivers, start sfx, stop sfx, kill flagged
sounds, update sfx param, sound is playing, and get sfx lump.
There is now a common GetSfx, which each port calls to get a sfx lump.
Ports (SDL, linux, os2, macos) now use priority and sound age when
too many channel requests.
Excessive volume detected now uses SoftError, and limits volume instead.
Removed duplicated sfx lump precache from port drivers, so now other
precache options work as intended.
Increased SDL to 16 channels.
The menu pistol sound will get killed early because setup stops sounds
before releasing all the sound memory.  Previously, StopSound
did not work, so memory was released while the pistol was still playing.

*** w89_empty_chan
patchfile = w89_7_empty_chan
- committed revision 1006   by wesley johnson
Fix SDL find empty channel search.  Search was init wrong.

*** w89_softerr
patchfile = w89_8_softerror
- committed revision 1007   by wesley johnson
SoftError is mandatory, and no longer a compile option.
SoftError message changed to print "Warn:" instead.

*** w89_free_sound
patchfile = w89_9_free_sound
- committed revision 1008   by wesley johnson
Fix problems in free memory of sound effect that caused Z_Free errors.
Notable when executing fragglescript ambiant sound (phobia.wad).

*** w89_boom_colormap
patchfile = w89_10_boom_colormap
- committed revision 1009   by wesley johnson
Fix bug in Boom deepwater colormap support.
Would use bogus colormap at [-1] instead of using no colormap.
Bug would only show in opengl because opengl uses the rgba field instead
of the colormap table field, which was NULL.

*** w89_term_transform
patchfile = w89_11_term_transform
- committed revision 1010   by wesley johnson
Make hardware render TERM_TRANSFORM the permanent choice, removing
the conditional compilation.  Removed the dead code that this creates.
Rename some functions.
Fix some spelling.

*** w89_corona
patchfile = w89_12_corona
- committed revision 1011   by wesley johnson
Cleaned the hardware render corona code.
Revised the original corona draw, because it works better with sorted draw.
Created compilation options, and a menu choice.
Corona choices are
  OFF
  SPRITE (drawn with the sprite)
  DYN (drawn from dynamic lights)
  AUTO (decided by draw modes)
The SPRITE draw works the best with transparent walls, as it draws the
corona at the time the sprite is drawn.  This works well with sorted draw.
The DYN corona draw (dynamic lights) does not draw corona behind
translucent walls.
The dynamic lights must remain active because it provides the wall
lighting from things.

*** w89_draw_sorted
patchfile = w89_13_draw_sorted
- committed revision 1012   by wesley johnson
Hardware drawn sprites would be occluded by transparent walls behind them.
A fixed draw order did not work.
Created hardware draw function that draws sprites and walls together
in depth order.
Draw Menu choices
  EARLY  (draw before sprites, oldest code)
  LATE   (draw after sprites, previous code)
  SORTED (draw sorted with sprites)
The EARLY draw works for transparent, but not translucent.
The LATE draw has distant transparent walls drawn over nearby sprites.
The SORTED draw has sprites drawn correctly for transparent and
translucent walls.
Later this menu item may be removed, with only draw sorted remaining.

*** w90_Makefile
patchfile = w90_1_makefile
- committed revision 1013   by wesley johnson
Fix debug libs with CDMUS conditional.
Remove old dependencies.

*** w90_malloc
patchfile = w90_2_malloc
- committed revision 1014   by wesley johnson
Remove old references to malloc.h, except for WATCOM.
Fixes bug 0000602, compiling under FreeBSD.

*** w90_tmap_asm
patchfile = w90_3_tmap_asm
- committed revision 1015   by wesley johnson
Change asm source for name changes.
  dc_transmap -> dc_translucentmap
  colormaps -> reg_colormaps
Applied patch from Alexey Dokuchaev.
Fixes bug 0000604.
Added dr_alpha test and capability for alpha>128 to asm code.
Fixed asm to increment by vid.ybytes.
Makefile modified for asm support.
Due to complexity, asm will likely lag in getting fixes made to drawers.
It uses strange tricks for speed up, which are difficult to maintain.

*** w90_freemem
patchfile = w90_4_freemem
- committed revision 1016   by wesley johnson
Fix "Free 0" console printout.
Fix FreeMem interface to indicate when guessing, and suppress printout
of guessed mem numbers.
FreeBSD, remove use of kvm which requires kmem priv, and use sysctl instead.
Applied FreeBSD patch from Alexey Dokuchaev.
Fixes bug 0000610.
Fixes partially bug 0601.

*** w90_legacyhome
patchfile = w90_5_legacyhome
- committed revision 1017   by wesley johnson
Change preferred directory name for savegames to ".doomlegacy"
( "doomlegacy" for win/dos ).
Will also check for ".legacy" (legacy).
When not found, will create ".doomlegacy".
Fixes bug 0000609.

*** W91_rancking
patchfile = w91_1_rancking
- committed revision 1019   by wesley johnson
Fix rancking spelling to ranking.

*** W91_trans_draw8
patchfile = w91_2_transdraw8
- committed revision 1020   by wesley johnson
Fix bug in translucent draw of sprite for 8bit screens.
Set dr_alpha to 0 for all translucent sprite draws.
This affects phobia.wad fires, where would get random dr_alpha.

*** W91_flats_limit
patchfile = w91_3_flats_limit
- committed revision 1021   by wesley johnson
Remove limits on flats.  AddFlats now automatically increases the
levelflats array when necessary.  Remove one use of alloca().

*** W91_alloca
patchfile = w91_4_alloca
- committed revision 1022   by wesley johnson
Remove uses of alloca, replacing them with calloc, and explicitly
freeing the allocations.

*** W91_drawsetup
patchfile = w91_5_drawsetup
- committed revision 1023   by wesley johnson
Convert video draw to use a setup function instead of passing a screen
parameter with each call.  Added additional functionality, and made
it more uniform across the various draw functions.  A single V_DrawSetup
now controls the attributes for a series of draw calls.
Added V_DRAWCENTER, to center the splash screen, finale, and menu
screens in the monitor window.

*** W91_bindfraggle
patchfile = w91_6_bindfraggle
- committed revision 1024   by wesley johnson
Previously I had changed the command t_runscript to fs_runscript, but
now find that chex newmaps binds the t_runscript command to the z key.
Restore previous t_runscript and t_running commands for this purpose.
Chex newmaps scope works again.

*** W91_flats_limit_2
patchfile = w91_7_flatslimit2
- committed revision 1025   by wesley johnson
Fix bug in W91_flats_limit.  Must zero new levelflats allocation,
because unanimated are left to default values.  Was failing after
about 5 to 7 loads of plutonia savegames.

*** W91_fragglescript_respawn
patchfile = w91_8_fraggle_respawn
- committed revision 1026   by wesley johnson
Fix bug_3588902.
Create and Free Extra_Mapthing, used for FraggleScript created mobj
that can respawn or can Nightmare respawn.
Savegame now saves Extra_Mapthing as an optional section (see Sync).
This is needed for respawn queue.
Will still load old save games.
Changed savegame ptr tools to also handle savegame mapthing ptrs.
Fixed WRITE_MAPTHING_PTR and READ_MAPTHING_PTR to handle extra mapthing.
Previously they were presented with mapthing ptrs that were not part
of the mapthings array, and created bad indexes in the savegame.
Nightmare respawn modified to fix several bugs.
It had a mixture of previous fixes.  Added better fix for nightmare
respawn at (0,0) as used in prboom and eternity.
Fixed where in several respawn, the mapthing mobj was not being updated
for new mobj.

*** W92_Makefile
patchfile = w92_1_Makefile
- committed revision 1027   by wesley johnson
Fix bug 0000605, bug 0000608.
Fix Makefile directory create problems.
There is now a make_options file that can hold all the local make
settings, which lessens the need to edit the Makefile.
When this file does not exist, the directories will be made.
Remove directory prerequisites, as they could never work (date changes
with every use).
Fix dependency make problems.  Dependencies are no longer loaded for
many housekeeping make commands, so make does not try to re-build them.
Remove -separate flag from sed.
Fix for compilation on W98 using MinGW.
Other makefile improvements.

Other musserv and sndserv makefiles have been combined with the linux makefile,
because of the duplication of maintenance.
Remove file: linux_x/musserv/Makefile.freebsd
Remove file: linux_x/musserv/Makefile.scoos5
Remove file: linux_x/musserv/Makefile.scouw2
Remove file: linux_x/musserv/Makefile.scouw7
Remove file: linux_x/musserv/Makefile.linux
Remove file: linux_x/sndserv/Makefile.scoos5
Remove file: linux_x/sndserv/Makefile.scouw2
Remove file: linux_x/sndserv/Makefile.scouw7
Add file: linux_x/musserv/Makefile

*** W92_Mac
patchfile = w92_2_Mac
- committed revision 1028   by wesley johnson
Commit of extensive changes for Mac, and Mac using SDL.
Change MACOS to MACOS_DI (Mac Direct Interface) which is NOT SDL.
Mac using SDL defines MAC_SDL.
This is not a working solution for Mac, just the best current code.
Includes some useful optional debugging code.
Updates Makefile for selecting MAC, and some MAC options.

Add file "sdl/SDLmain.m"

*** W92_WinVid
patchfile = w92_3_winvid
- committed revision 1030   by wesley johnson
Commit of more changes to video draw in Win32 code to make it
compatible with vid structure.  Untested.

*** W92_OS2_X11
patchfile = w92_4_Os2_X11
- committed revision 1031   by wesley johnson
Commit of more changes to video draw in OS2 code and Linux X11 code
to make use of new generic video draw functions.  Untested.

*** W92_keys
patchfile = w92_5_keys
- committed revision 1032   by wesley johnson
Implement changes to keycodes in DOS, OS2, LINUX_X, and WIN32 ports.
Previous changes to Some KEY names were only in SDL.
This only makes it possible to compile and some ports may only have
one usable joystick.  Mostly Untested.

*** W92_stricmp
patchfile = w92_6_stricmp
- committed revision 1033   by wesley johnson
Change uses of stricmp and strnicmp to strcasecmp and strncasecmp.
Added comments in many places.
Other cleanup.

*** W92_hw_bsp_inits
patchfile = w92_7_hw_bsp_inits
- committed revision 1034   by wesley johnson
Init some polyvertex variables in hw_bsp.

*** W92_includes
patchfile = w92_8_includes
- committed revision 1035   by wesley johnson

Addfile  doomincl.h
Removefile  macos/p_spec.h

Reorganize doomdef.h and doomtype.h into:
doomdef.h  = defines only, usable in H files
doomtype.h = typedefs, system detection, usable in H files
doomincl.h = doomdef.h + doomtype.h + common functions and variables
    First include in most C files so that precompiled headers get the
    most benefit.
    Defines WINVER, so doomincl.h must precede some lib includes that would 
    define WINVER first (Redefine error).
    Moved logstream and debugging files to doomincl.h.
Fixed the includes in almost every H and C files.  Added many includes
to cover usage in the H or C file.  Removed some includes due to changes.
Changed include defines to xx_H, to be in our namespace
(and not in the __xx__ namespace, which makes it look like a system name).
General cleanup of things that would not normally be mixed with a code
change.
Cleanup of log headings, removing lines with no maintenance content.
Removed duplicate headers in some files.
Fix some macro naming and collisions.
Added headers to some files that were missing them.
Fixed indentation in some files.
Removed ZZ_Alloc macro, because it had little use and hid usage of Z_Malloc.
This touches almost every file.
Turned off some debugging defines, and changed names to avoid collision.
No code changes were made.

*** W92_winjoy
patchfile = w92_9_winjoy
- committed revision 1036   by wesley johnson
Fix win32 joystick to use newer joystick interfaces.
Will allow two joysticks.
Untested.

*** W92_WaitVBL
patchfile = w92_10_waitvbl
- committed revision 1037   by wesley johnson
I_WaitVBL is no longer used by sdl, nor the code, it never worked,
and most ports had dummy functions.
Now there is I_Sleep, that is used (in one place, optionally, as an
experiment).
Removed I_WaitVBL from all the ports, and added an I_Sleep function,
using usleep() from unistd.

- committed revision 1038   by wesley johnson
w92 10b
Remove extra I_Sleep in sdl.

*** W93_hw_same_vertex
patchfile = w93_1_hw_same_vertex
- committed revision 1040   by wesley johnson
When using -opengl, FreeDoom Map09 had HOM in one particular passage.
Changed save vertex test to inequality cured the HOM.

*** W93_movecamera
patchfile = w93_2_movecamera
- committed revision 1041   by wesley johnson
Fragglescript movecamera has only 6 param, but phobiata.wad has a call
with 7 param, and the game would freeze at that point.
Previous updates to fragglescript in W83 fixed the param checking.
Changed movecamera to more gracefully ignore the extra parameter, while
printing a warning message.

*** W93_interface
patchfile = w93_3_interface
- committed revision 1042   by wesley johnson
Extensive divergence of the port code has occured, with some interfaces
being retired and others created.  Most of the ports had not been
updated.  This updates those critical interfaces and calls.
Makefile updated too, with passage of WIN_NATIVE define.
Filesearch code updated in most ports.

*** W93_ticrate_graph
patchfile = w93_4_ticrate_graph
- committed revision 1043   by wesley johnson
Move ticrate graph generation to v_video, and remove it from port code.
There is only one copy to maintain now and every port has the same
response to vid_ticrate.
Gave the display a more consistent time axis.

*** W93_win_native
patchfile = w93_5_win_native
- committed revision 1044   by wesley johnson
Extensive changes to get WIN_NATIVE port working again.
Now works in window and fullscreen, windows draw and Directx draw.
Tested in 8bpp and native bpp.
Has -win parameter to force windows drawing.

*** W93_hw_translu
patchfile = w93_6_hwtranslu
- committed revision 1045   by wesley johnson
Fix hardware Boom 260 translucent draw of tagged linedefs.

*** W93_screendeg
patchfile = w93_7_screendeg
- committed revision 1046   by wesley johnson
Add a -screendeg command line option, which is a generalization of
-left and -right.
A few comments and some #ifdef around some unused code.

*** W93_execute_script
patchfile = w93_8_execute_script
- committed revision 1047   by wesley johnson
Fixes bug_589 (bug_3375763).
The execution of a bind button would fail because the string was parsed
without understanding the escaped quotes within quotes.
Fixed script detection to understand exec lines.
The syntax of button names with spaces in a quoted string is hard to
read, and error prone.  Have given the user the ability to name them with
underlines in place of the spaces.  Such names do not need to be quoted.
If the key name search fails then any underlines in the name are replaced
with spaces, and the key name search retried.  This also allows control
names to have underlines (which they currently do not).
This allows the messy
  alias ps0 "playersprites 0; bind \"mouse 3\" ps1"
to be specified as
  alias ps0 "playersprites 0; bind mouse_3 ps1"
which is much easier to read.

*** W93_docs
patchfile = w93_9_docs
- committed revision 1048   by wesley johnson
Updated the docs legacy.html and whatsnew.html.

*** W93_viewheight
patchfile = w93_10_viewheight
- committed revision 1049   by wesley johnson
Fix code that updates player viewheight to provide a slow rise and fall
for changes to the cv_viewheight.  Existing vanilla code could not cope
with changes in cv_viewheight because it required an external setup
to provide the delta.
Fixes bug_1296539.

*** W94_nosecret
patchfile = w94_1_nosecret
- committed revision 1050   by wesley johnson
When there are no secrets, no possible kills, or no items on a level,
then draw a dash (minus) instead of 0%.

*** W94_mousemenu
patchfile = w94_2_mousemenu
- committed revision 1051   by wesley johnson
Fix FR 3427586.
The mouse may move the menu ptr while using the keyboard.
The fix disables menu movement from the mouse for a short interval
(about 4 seconds) after each key press.  After the interval the mouse
can be used to move in the menus again.  Does not affect mouse clicks.

*** W94_soundeffect
patchfile = w94_3_soundeffect
- committed revision 1052   by wesley johnson
Fix sound bugs in hth2.wad.
Read sound lump using plain name too, because hth2.wad does not have ds on
their amb sfx names.  The result was to fail and default to pistol.
Playing hth2.wad has the background ambiance sounds now.
Fixed crash due to using a lump for more than one sfx.  When one was freed
it would corrupt the data of the other.  Had to copy the sound data,
which for some ports is now copied three times.
Fix AddSound to only remove a sound when sfx is full, and to use a
usefulness test.  The newsounds array is removed because it could not
be kept consistant with sfx existance.

*** W94_spritedraw_3dflr
patchfile = w94_4_spritedraw_3dflr
- committed revision 1053   by wesley johnson
Fix problem with sprite ordering to 3d floors, where sprite on 3d
floor would be drawn under the floor.  This changes plane test to use
middle of sprite instead of toe and head, so that minor overlaps with
adjacent planes do not affect whole sprite.
It does not cure problem with railings, which are higher than dead
objects.

*** W94_demo144
patchfile = w94_5_demo144
- committed revision 1054   by wesley johnson
Make 144 DL the demo format, with demoversion 144.
Add some fields, and a sync byte.  Fix the playback so that it now
plays our own demos correctly.

*** W94_b_random
patchfile = w94_6_b_random
- committed revision 1055   by wesley johnson
Create separate random number generators for ambience, bots, and misc.
so that P_Random is not affected by every odd change.
A_Random for ambience, which was using M_Random.  This change should not
affect any demo playback that was working.
B_Random for bots and any other automation.  This was using P_Random
which strongly affects demos.  There should be no existing demos with bots.
New uses should use A_Random and B_Random.

*** W94_infight
patchfile = w94_7_infight
- committed revision 1056   by wesley johnson
Fix conflict between infight and cv_monbehavior vars.
Include them in demo playing.

*** W94_Boom_demo
patchfile = w94_8_boom_demo
- committed revision 1057   by wesley johnson
Add some more fixes for playing boom demos.  This fixes some segfault,
and incompatibilities but it still does not sync.
Added Boom stuckdoor code, but only enabled for Boom demo.

*** W95_Boom_MIDI
patchfile = w95_1_boom_midi
- committed revision 1059   by wesley johnson
Fix playing Boom MIDI lumps on older SDL library.
Also cleaned up and commented the qmus2midi functions and qmus2midi.h.
OS2 was using a file to file version of qmus2midi, which does not seem to
be compiled.  Reconnected buffer to buffer version in OS2.
OS2 needs to be debugged.

*** W95_menu_sounds
patchfile = w95_2_menusounds
- committed revision 1060   by wesley johnson
Add menu sounds to legacy.wad, and up legacywad version to 1.44.1.
Add menu sounds effects option and cvar.
Adapts menu sounds to game type, such as doom2 and heretic.
Updated legacy.wad from menu.wad.
New Legacy menu sounds are quieter than pistol shot used by Doom2.

*** W95_messages
patchfile = w95_3_messages
- committed revision 1061   by wesley johnson
Reorganized the printing of messages to the console, stderr, log, and screen.
Created EMSG_flags to select destinations for messages.
There are EMSG selections for stderr text, error, console, log, verbose,
debug, and devparm.
These can be customized by port, and active destinations, without
changing all the print statements.
CONS_Printf and I_SoftError route messages according to the EMSG_flags state
Created GenPrintf() to route verbose and devparm messages to selected
destinations, replacing most uses of fprintf(stderr...).
Verbose and debug messages can now also go to the log and console.

*** W95_find_legacywad
patchfile = w95_4_find_legacywad
- committed revision 1062   by wesley johnson
Search LEGACYWADDIR, default dir, and doomwaddir for legacy.wad.
Make MAC search of locations more like Linux.
Make access checks easier to maintain.
Simplify the DEFAULTDIR defines, easier to maintain, and all in one place.
Simplify function to create title line.

*** W95_mixer_file
patchfile = w95_5_mixer_file
- committed revision 1063   by wesley johnson
Using music files with the old mixer has a problem with not being able
to read the file when executing doomlegacy when not in the executable
directory.  This only affects SDL_mixer version < 1.2.7, where the
current is 1.2.11.
Direct reads of the file will succeed, but SDL_LoadMUS() will fail, with
file or directory not found.
Add messages to report the cause of the problem.

*** W95_font1
patchfile = w95_6_font1
- committed revision 1064   by wesley johnson
Added font1, a fixed width bit mapped font with a default palette,
that can be drawn before loading wads, and without font graphics or
palette from any wads. It is only for software render.

*** W95_early_graphics
patchfile = w95_7_early_graphics
- committed revision 1065   by wesley johnson
Move the startup of Graphics to as early as possible.
This is to provide an error message screen and menu capability earlier
than before.
Also move Z_Init and COM_Init to be early to allow CV_RegisterVar,
and COM_AddCommand calls.
Fix I_StartupGraphics in all ports to allow calling more than once.
Provide a mode_fullscreen global to the port drivers to isolate them
from any cv_fullscreen setting, that is only used later in the startup
sequence.
Replaced many fprintf(stderr) calls in the port video files, with calls
to GenPrintf.

*** W95_menu
patchfile = w95_8_menu
- committed revision 1066   by wesley johnson
Fix use of alphaKey field in menus for three conflicting things.
Converted the IT_ defines to an enum.
Added:
  IT_OPTION  = 0x3000,    // field
  IT_YOFFSET = 0x1000,    // alphaKey is offset
  IT_KEYID   = 0x2000,    // alphaKey is id
Changed the control menus to actually use the IT_CONTROL that is defined,
so the tests against IT_CONTROL now make sense.
Added using font1 for printing menu strings when use_font1 is set.

*** W95_linux_x11
patchfile = w95_9_linux_x11
- committed revision 1067   by wesley johnson
Fix OpenGL failure for X11 video port.
Had to remove some changes made in w71_linux_x because that code is
part of a dll library (r_opengl.so), and the effect was to create two copies
of some variables.
Also, the dll library would not load because it tried to access some
variables in the main code (which it could not link to).
General revision of much of r_opengl dll and i_video_xshm.
Fixed compile of r_opengl dll due to variables, and made its log file
work (it cannot access any main program functions or variables).

*** W95_startscreen
patchfile = w95_10_startscreen
- committed revision 1068   by wesley johnson
Reorganize the video startup.
I_StartGraphics makes a basic window that can display error messages.
I_RequestFullGraphics makes the transition to fullscreen, hardware modes,
opengl, and video depth selected by command line switches.
Introduce INITIAL_WINDOW size (800x600), which can be selected in doomdef.h.
This usually is large enough to actually read error messages.

*** W95_vidmode
patchfile = w95_11_vidmode
- committed revision 1069   by wesley johnson
Convert port video function interfaces to use modenum_t, which records the
context of the mode number as well as the index.
Mode indexes have a range, usually 1..n.
Update all the ports to use this interface, although some are
incomplete and would not compile due to other missing functions.
This has changed the video code in many ports which have not been tested
for a long time.

*** W95_launcher
patchfile = w95_12_launcher
- committed revision 1070   by wesley johnson
Introduce a built-in launcher so DoomLegacy can be started from an icon,
or start menu entry.
If there is an error during wad detection, or if the command line is
empty, the launcher will activate.
It puts up a screen that allows setting most of the command line switches.
The launcher will cycle until the settings do not result in a fatal error.
Once the launcher has accepted the settings, any further errors will
invoke I_Error.
There are a few switches, like -mb, that have already been processed
before the launcher executes.

*** W95_gltranswall
patchfile = w95_13_gltranswall
- committed revision 1071   by wesley johnson
A negative distance test has been culling visible left walls (chain link).
The test is increased to -2000.0 to eliminate this with known walls.
Walls should not be longer than 1000.

*** W96_gcc4
patchfile = w96_1_gcc4
- committed revision 1072   by wesley johnson
Compile fixes for gcc4.x complaints.

*** W95_savegamemenu
patchfile = w96_2_savegamemenu
- committed revision 1073   by wesley johnson
Changes to menu constants in w95_8 exposed a misuse of the menu status field.
The misuse has been fixed with the actual constants the field should have.

*** W96_con_printf
patchfile = w96_3_con_printf
- committed revision 1074   by wesley johnson
Fix CONS_printf to print on screen during after graphics started and
before entering main loop.
Add EMSG_now, to handle messages that need screen update immediately.
Change some Linux messages to also go to CONS.
Move some hardware messages to use Gen_Printf instead of doing their own
screen update.

*** W96_hw_poly
patchfile = w96_4_hardware_poly
- committed revision 1075   by wesley johnson
Fix opengl render error that causes some texture draws to be missed.
Not all linesegs are getting into the sector polygons.  Added comments
to polygon code and cleaned up some routines.
Gave poly-vertex their own ptr in the segs, so are never confused with
fixed point vertex.
Added loop to check all segs for having poly-vertex, and add those
that do not so they also render.

Add file: hardware/hw_poly.h

*** W96_win32_native
patchfile = w96_5_win32_native
- committed revision 1076   by wesley johnson
Updates to win32 native port code so that it compiles.
Fixes code so that it compiles, but execution on my machine is
crashing, which may be due to MinGW and library issues.

*** W96_stuckdoor
patchfile = w96_6_stuckdoor
- committed revision 1079   by wesley johnson
Enable Monster stuck in door fixes from MBF and Boom.
Adv. Menu gets the stuckdoor control.
Saved to demo header and config.

*** W96_hw_misc
patchfile = w96_7_hw_misc
- committed revision 1080   by wesley johnson
Change tests against -1 to < 0 or >= 0, to be more robust.
Fix Loading percentage box by setting Draw options properly.

*** W96_gdesc
patchfile = w96_8_gdesc
- committed revision 1081   by wesley johnson
Update wad recognition
FreeDoom:
  file = "freedoom2.wad", "freedoom.wad", "doom2.wad"
Ultimate Freedoom:
  file = "freedoom1.wad", "freedu.wad", "doomu.wad"
Blasphemer:
  file = "BLASPHEM.WAD", "blasphem.wad", "heretic.wad"
Ultimate mode:
  mode = ultdoom_retail

*** W96_docs
patchfile = w96_9_docs
- committed revision 1082   by wesley johnson
Update docs for revision 1.45.

*** W96_cleardisplay
patchfile = w96_10_cleardisplay
- committed revision 1083   by wesley johnson
Add V_ClearDisplay function to give decent display clear for OpenGL.
Fixes ghosting during CONS print scrolling.

*** W96_SoftError_text
patchfile = w96_11_softerror_text
- committed revision 1084   by wesley johnson
Have CONS_Print do all of SoftError printing, so only stderr and stdout
only get one copy of the error message.

*** W96_OpenGL_func
patchfile = w96_12_opengl_func
- committed revision 1085   by wesley johnson
Renamed some r_opengl funcs to VIDGL_xxx, so to identify them.
Renamed DL_SET_PALETTECOLOR to DL_SET_TINT_COLOR, to identify it as
the tint applied to opengl to imitate the palette flash.
Improved the efficiency of some r_opengl functions.
Separated DEBUG_SDL from DEBUG_MAC.

*** W96_win_sdl
patchfile = w96_13_win_sdl
- committed revision 1086   by wesley johnson
Fixes several problems with SDL on win32 machine.
Fade of menu background is problem on Matrox.
Fixes to little white texture, which Linux does not seem to need.
Use glGenTextures, because the first texture id returned by it changes
on the second call.
OpenGL drawing everything in Red and Yellow was only fixed by
disabling Matrox polygon accell.
May still be an open issue, so some DEBUG_WIN code is still present.

*** W96_linux_event
patchfile = w96_14_linux_event
- committed revision 1087   by wesley johnson
Update Linux event loop to be same as in SDL, to eliminate compiler
complaints.

*** W96_alpha5
patchfile = w96_15_alpha5
- committed revision 1088   by wesley johnson
Revert VERSION and docs to 1.44 alpha5.
Fix check on legacy wadversion to accept 1.44 and 1.45.
The legacy.wad remains at 1.45.

*** W96_verbose
patchfile = w96_13c_verbose
- committed revision 1089   by wesley johnson
Part of w96_win_sdl that did not get committed properly.
Removes use of verbose in opengl, because Linux_X will make a dll, and
the verbose will not be resolved at run-time.

*** W97_savegame_menu
patchfile = w97_1_savegame_menu
- committed revision 1092   by wesley johnson
Fix several problems with savegame menu behavior.
Savegame menus will no longer wrap to top of menu.
They will return to the current scroll position when the menu is used
again.
Cleared status on unused savegame slots to prevent loading from them.
Added some SAVEGAME defined names to replace constants, and used them
throughout the savegame menu code.  This removed some latent bugs in places
where the code was not properly accounting for SAVEGAME compile options.
Clarified some of the names, organization, and use different names for
menu slots and savegame slots.

*** W97_fineangle
patchfile = w97_2_fineangle
- committed revision 1093   by wesley johnson
The use of the sine, cosine, and tangent tables is complicated by
requiring several constants and a shift.  This has been encapsulated
in some macros that apply the FINESHIFT.
There also are some inline functions, but using them proved to be
inefficient, based on the increase in the file size.
The usages of FINESHIFT have been converted to use the new macros where
possible. Many usages use the fine angle table indexes more than once
(sine and cosine) and it proved to be difficult to hide the workings.
The most efficient code was favored which restricted the usage of the
new macros in many places.

*** W97_distance_angle
patchfile = w97_3_distangle
- committed revision 1094   by wesley johnson
Fix some of the rendering errors with distant walls.  This was due to
errors in the angles to the wall end points.  The vanilla PointToAngle function
is so inaccurate that it hardly has any valid bits (5 out of 32 bits).
At that distance the error causes the left and right angle values to
have the wrong magnitude order (non-monotonic).  This causes some far walls to
be drawn over nearer walls, but not correctly, many times with HOM.
A more accurate function, SlopeDive_64, has been introduced, which
brings the accuracy up to 13 bits out of 32 bits (when compared to atan2).
This fixes most of the render errors on Europe.wad and longdays.wad.
There are still some walls not rendered due to distance, but they do not
occlude the nearer walls.

*** W97_hw_fineangle
patchfile = w97_4_hw_fineangle
- committed revision 1095   by wesley johnson
Extend the FINEANGLE patches to the hardware code.

*** W97_hw_distance_angle
patchfile = w97_5_hw_distangle
- committed revision 1096   by wesley johnson
Extend the distangle patches to the hardware code.
This does not have much effect because the OpenGL renderer has another
distance limit.  It does not draw the far distant walls at all.

*** W97_morphmobj
patchfile = w97_6_morphmobj
- committed revision 1097   by wesley johnson
Change Heretic chicken to use a MorphMobj function that preserves the
current player mobj.  Fixes the Chicken and SkullPop functions to not
change the player mobj.  They would do so during Line attacks and
Damage.  This makes it safe for functions to keep a ptr to the player mobj.
Fix the Chicken attack to set the PuffType.  This stops the chicken
attack from creating a bogus player mobj on top of the attacked monster.

*** W97_playermobj
patchfile = w97_7_playermobj
- committed revision 1098   by wesley johnson
Have many functions keep a variable to the player mobj (pmo).
This improves readability and reduces size a bit.
Cleanup some of the heretic code.  This is mostly indenting.
This does not change functionality.

*** W97_cleanup_indent
patchfile = w97_8_cleanup
- committed revision 1099   by wesley johnson
Cleanup arrangement of many functions.
This is mostly line organization and indenting.
Some extern are moved to headers.  Some variables are renamed.
Some more uses of ANGLEFINESHIFT are changed to use ANGLE_TO_FINE().
This does not change functionality.

*** W97_bot
patchfile = w97_9_bot
- committed revision 1100   by wesley johnson
Cleanup the bot code.  This is mostly indenting.
Some function sections were altered to use tables.
Some variables were added to share common calculations and remove
duplicate code.
This does not change functionality.

*** W97_quicksave
patchfile = w97_10_quicksave
- committed revision 1101   by wesley johnson
The quicksave has been saving its descriptor one beyond the end of the
save descriptor array, overwriting several quicksave and save variables.
Every once and a while this causes a segfault, due to a corrupted slotindex.
This patch fixes the QUICKSAVE_INDEX, so it actually uses the last entry in
the array now.

*** W97_large_dist
patchfile = w97_11_large_dist
- committed revision 1102   by wesley johnson
The previous patch, W97_distance_angle, did not completely fix
occurances of bad angles.  This patch has large distances ( x or y > 1/4 MAX)
use the atan2 function to calculate the angle, a fix from PrBoom.
It is slower but accurate.

*** W97_version145
patchfile = w97_12_version145
- committed revision 1103   by wesley johnson
Update docs and version numbers for 1.45.

*** W97_patch_segfault
patchfile = w97_13_patch_sf
- committed revision 1104   by wesley johnson
Legacy demo segfaults because a colormap is getting used as a patch in
a texture.  They both have the same name, BLUMAP.
This patch stops the segfault by detecting when a patch offset will
overrun the patch size.

*** W97_lumpnum
patchfile = w97_14_lumpnum
- committed revision 1105   by wesley johnson
Cleanup some lump numbering to use an existing macros.
Some comments.

*** W97_lump_namespace
patchfile = w97_15_lump_namespace
- committed revision 1106   by wesley johnson
Implement tracking of the wad namespace in the lump info.
A patch lump will be searched for within the PATCH namespace first,
and if not found then any lump of that name will be used.
This fixes the Legacy demo wad so the BLUMAP colormap and BLUMAP patch
occupy different namespaces.  The texture using the BLUMAP patch now
finds the correct lump and does not need to be rejected.

*** W97_wi_stats
patchfile = w97_16_wi_stats
- committed revision 1107   by wesley johnson
Some player stats use a division by the total.  In wads where the
total was 0, there would be a division by zero.  There was inadequate
protection.  The protecting tests were expanded to protect all
divisions by the total.
Update docs to latest patches.

*** W100_savegame144
patchfile = w100_1_savegame144
- committed revision 1115   by wesley johnson
The savegame format is the same in 1.45 as it is in 1.44, so allow it
to read 1.44 version savegames too.  Version 1.44 savegames may be
readable for many versions because of the coded modular nature of additions
to the format.

*** W100_DEH_Boss_death
patchfile = w100_2_DEH_Boss_death
- committed revision 1116   by wesley johnson
DEH modified monsters should be able to trigger the Boss_death function
by using the Keen_death. This will trigger tag=666 sectors.
This restores the ability that was present in Vanilla Doom.

*** W100_infight
patchfile = w100_3_infight
- committed revision 1117   by wesley johnson
Changes the way the menu infight control interacts with demo infight
settings and DEH infight selections.  The previous coop and infight
settings are defaults that can be overridden by DEH infight settings.
This is similar to other ports, and seems to be the expected behavior.
Added separate "Force Coop" and "Force Infight" menu control settings
that will override any DEH infight settings.  This allows the user to
still modify the infight behavior when they want.

*** W100_nomonsters
patchfile = w100_4_nomonsters
- committed revision 1118   by wesley johnson
Restore the -nomonsters switch that got lost in the w95_startscreen patch.
Had intended to move it and lost it entirely instead.
There is no equivalent menu control.

*** W100_spawnfly
patchfile = w100_5_spawnfly
- committed revision 1119   by wesley johnson
If a savegame has a flying cube, there may be a segfault.  The savegame
does not handle saving a braintarget as a mobj.  This fixes the SpawnFly
to get the previous braintarget when mobj->target is NULL.
This protects the flying cube code, and perhaps the savegame can be fixed
later too.

*** W100_docs
patchfile = w100_6_docs
- committed revision 1120   by wesley johnson
Update docs for 1.45.1 bug fixes.

*** W100_stuck_3dfloor
patchfile = w100_7_stuck_3dfloor
- commit revision 1121
Fix things collision check to ignore things on other 3dfloors.
The allows monsters placed on upper and lower floors to not get stuck
to each other.
Also make the things collision check not block for NOCLIP and not SOLID,
same as in prboom and compatible with boom demo.

*** W100_memtag
patchfile = w100_8_memtag
- commit revision 1122
Change z_zone memory block tag to be named memtag, so that it does not
get confused with the linedef tag.

*** W100_flush
patchfile = w100_9_flush
- commit revision 1123
Flush messages so the appear sooner.

*** W100_opengl_menu
patchfile = w100_10_opengl_menu
- commit revision 1124
Straighten out some positioning in the opengl menu options, and gamma.

*** W100_opengl_tnt_doors
patchfile = w100_11_opengl_tntdoors
- commit revision 1125
Fix the OpenGL rendering of the transparent doors in TNT Map21.
They need to be rendered full height when the middle texture is transparent
and the door is closed.

*** W100_makefile
patchfile = w100_12_makefile
- commit revision 1126
Modify makefile for development work in the new directory structure.
It needed to support more options for compiling from alternative
working directories.

*** W100_docs2
patchfile = w100_13_docs2
- commit revision 1129
Update docs for latest patches.

*** W100_sight_ffloor
patchfile = w100_14_sight_ffloor
- commit revision 1127
Add function to check 3dfloors for sight lines.  This will prevent
monsters from trying to shoot the player through 3dfloors.

*** W100_greybox
patchfile = w100_15_greybox
- commit revision 1128
They grey background text box is positioned and sized wrong when using font1,
as in the launcher menu, and the quit message from it.
There are several assumptions made by menu functions and conflicting
requirements, so have to correct the positioning in the few places where
the font1 and the grey box have unique code.

*** W100_swap
patchfile = w100_16_swap
- commit revision 1130
For big endian machines, was missing in two places the reference to
include m_swap.h.
Fixes bug 617 as suggested by Alexey Dokuchaev.

*** W100_loadfail
patchfile = w100_17_loadfail
- commit revision 1131
I got tired of starting Doom Legacy and finding some mistyped PWAD
file had not been loaded.  The default now is for Doom Legacy to ERROR
when a file does not load.
This can be overridden by the -noloadfail switch.

*** W100_version1451
patchfile = w100_18_version1451
- commit revision 1132
Update version numbers for 1.45.1.

*** W100_docs3
patchfile = w100_19_docs3
- commit revision 1133
Update docs for latest patches and version 1.45.1.

*** W101_chex_draw
patchfile = w101_1_chex
- commit revision 1134
Chexquest Newmaps specific fixes.
Fix segfault when drawing black bars and crosshairs in software rendering.
These graphics were meant for OpenGL where they would be stretched.
Fixed the software rendering of V_DrawScaledPatch to stretch these specific
Pics to screen width.
Fixed names and comments of draw to reflect true nature of the centering.
Changed selection names to V_CENTERMENU and V_CENTERHORZ.
Fixed HU Pic allocation, support functions, and added accurate comments.

*** W101_clang_compile
patchfile = w101_2_clang
- commit revision 1135
Fix Makefile for compiling using the clang compiler.
  CC_CLANG=1
Add options for specifying CC.
  CC_EXPLICT=clang,  explicitly specifies the CC command.
  CC_ENVIRONMENT  uses  CC ?= gcc  to give environment CC preference.
Fix the Makefile dependency building to not visit files that are foreign
to the selected port.
The select SMIF port selects the proper dependency additions.
  DEP_HARD
  DEP_X11
  DEP_DD
  DEP_OPENGL
  DEP_MINIGL
This eliminates the problem clang has when encountering includes of windows.h
while compiling from a Linux/BSD environment.
Fixes bug #607.

Added detection of the wrong port for port specific hardware files,
with #error lines to inform the developer of the required port.

The Makefile specifies a default SRC and BUILD directories.
This Makefile can be used from outside the src directory, or by setting
the MAKE_IN_SRC variable, it can be used from within the src directory.
Running Make from within the source directories is prefered during
program development because it is easy to compile one of the many source
directories, using canned scripts.  The current directory is compiled.
Running the Makefile from outside the src puts the src directory name in the
dependency files, which is inconvienent when compiling sequential updates
kept in separate src directories.

*** W101_command_buffer
patchfile = w101_3_command
- commit revision 1136
Fixes bug #619, where Chexquest Newmaps command keys that run scripts for
the book are not getting executed.
There was a latent bug in the VS_Print function that is used to append text
to the command buffer.  With each append it accumulated an extra character
of length in the buffer.  This affected the positioning of the next append.
After two appends, it would be leaving some of the previous garbage in the
buffer between the commands, which could be 0.  This made it erratic when
there were more than two commands in one tic.
This fix removes the term 0 from the command string before appending.

*** W101_legacy_error
patchfile = w101_4_legacy_err
- commit revision 1137
If there is a -game error then legacy.wad did not get loaded, which
triggered additional error messages.  Fixed to load legacy.wad even
when there is an error.

*** W101_mouse_release
patchfile = w101_5_mouse_release
- commit revision 1138
When the game is paused, or a menu is opened, the mouse containment is
released so that other windows can be visited.

*** W101_version1452
patchfile = w101_6_version1452
- commit revision 1139
Update version numbers for 1.45.2.
Update docs for latest patches and version 1.45.2.

*** W102_network_rename
patchfile = w102_1_network_rename
- commit revision 1140
Rename vars and functions to be more readable and reflect what they do.
Fix spelling and syntax of comments, messages, and error messages.
Add comments.

*** W102_clisrv_cleanup
patchfile = w102_2_clisrv_cleanup
- commit revision 1141
Cleanup of client/server code.  Add comments, simplify redundant
expressions, use some macros, more renaming.
Change to use a textbuf struct, textlen, and appropriate ptrs.
Use ptrs instead of repeated indexing.

*** W102_clisrv_rewrite
patchfile = w102_3_clisrv_rewrite
- commit revision 1142
Rewrite of parts of client/server code.
Net node numbers are byte.
Breakup 300 line packet handler function into smaller functions.
Add comments.

*** W102_clisrv_type
patchfile = w102_4_clisrv_type
- commit revision 1143
Change types, use byte, stdint instead of short, ULONG, USHORT.
Change some types to unsigned.  Change unused from -1 to 255 unsigned.
This makes for easier tests, no sign problems, and larger range.

*** W102_clisrv_func
patchfile = w102_5_clisrv_func
- commit revision 1144
More cleanup of vars. Change type servernode to byte.
Make some errors use I_SoftError.
Simplify NetXCmd, Send_Tics.

*** W102_net_cleanup
patchfile = w102_6_net_cleanup
- commit revision 1145
Cleanup of network packet functions.
Find unused vars in network packet header.
Change short to stdint types in packet header.  This should help with
64bit and 32bit machines playing together.

*** W102_net_ack
patchfile = w102_7_net_ack
- commit revision 1146
Rename of network types, fields, macros, vars to be more readable, meaningful.
Cleanup of packet ack functions.
Comments.
Fix a bug in cancel ack function.

*** W102_netfile
patchfile = w102_8_netfile
- commit revision 1147
Cleanup of file download functions.
Convert some I_Error to I_SoftError.
Make messages more understandable.
Use of ptrs makes for much smaller code.
Remove unused code.

*** W102_sayto
patchfile = w102_9_sayto
- commit revision 1148
Talk network had broken code.  Cannot make work with old network code.
Used 0 broadcast, and for player[0], and -(0) for team of player[0].
Change talk packet to coding where:
0..127 = talk to player
0x80 | (0..127) = broadcast to player's team
255 = broadcast
Cleanup code for talk.

*** W102_net_error
patchfile = w102_10_net_error
- commit revision 1149
Create net_error to return useful error codes from the Net functions.
Return boolean from I_NetGet and I_NetSend, so that network situations
can be handled without crashing the program.
Reorganize some of the low level network functions.
Comment the OS variations, network tests, and calls.

*** W102_console_open
patchfile = w102_11_console_open
- commit revision 1150
Add a console_open state var.  Test it so that demos do not startup
and steal the display when the console is open.

*** W102_netnodes
patchfile = w102_12_netnodes
- commit revision 1151
The player netnodes and utility netnodes are differentiated.
Provision is made for additional utility netnodes.
Network Ack is limited to player netnodes.  Tests are included to insure
that only player netnodes are used to index the Ack structures.
Comment the TCP network variations, and network node ranges.

*** W102_netcansend
patchfile = w102_13_netcansend
- commit revision 1152
Allow Linux to use the I_NetCanSend test.  Linux select calls can alter the
timeval field value and write_set values.  They cannot be static,
must be init on each call.
Fix some error messages.  Add some comments.
Change some ipx socket address fields to stdint types.

*** W102_mserv
patchfile = w102_14_mserv
- commit revision 1153
Cleanup MasterServer code.
Convert some MasterServer message fields to stdint types.
Fix bug in select call, Linux select modifies the parameters.

*** W102_ms_ping
patchfile = w102_15_ms_ping
- commit revision 1154
The MasterServer code was using a player node to ping the MasterServer
with time packets.
New code, enabled with UDP_PING_SPECIAL, uses a utility net node, MS_PINGNODE,
for this pinging.  This allows 32 players.
A new function, UDP_Bind_Node, has been created to enable this.

*** W102_search_server
patchfile = w102_16_search_server
- commit revision 1155
Fix the code to search for a server on the network.
Added config vars  server1, server2, server3, so the user can save
their server settings.  They can hold a server IP address such as
"192.168.1.1", or a network broadcast address such as "192.168.1.255.
The previous used broadcast address "255.255.255.255" was incorrect.
That only returns "network unreachable" messages, because the network
"255.255.255.0" is not known.
Fix the network IPX address print and bind functions.
Fix the network shutdown to not loop in error messages when the
network fails.

*** W102_filetx
patchfile = w102_17_filetx
- commit revision 1156
Cleanup the code for server file transfer.
Cleanup code for client connect to server.
Use some meaningful return codes, so errors are propagated to the caller.
Use Filetx_file_cnt as enable, to reduce cache pollution from loading
the function just to find out there are no files.
Added config variable for download file disable, as a command line
switch was the only control.

*** W102_net_menu
patchfile = w102_18_net_menu
- commit revision 1157
Create connect options menu.
Create multiplayer options menu.
Multiplayer menu can start server, or start dedicated server.
Create wait_players variable, which can be selected by the Start Server menu,
and the command line -server switch.
Create wait_tics variable, which can be selected by the Start Server menu.
Move connect, server, dedicated determinations to D_Startup_NetGame.
Cleanup functions affected.
Cleanup code around these changes.

*** W102_makefile
patchfile = w102_19_makefile
- commit revision 1158
Fix problems with directories when compiling in Win32.
Fix some debugging of inline functions reported.

*** W102_wait_player
patchfile = w102_20_wait_player
- commit revision 1159
Add menu to start network games while waiting for players with timeout.
The server command line options for start and connect can now be
done using the start server menu.
Add wait for player net nodes, add timeout for waiting.
Add display box for displaying the wait.
Add a net communication command to pass the current waiting state
to other waiting players.

*** W102_legacywad_error
patchfile = w102_21_legacywad_error
- commit revision 1160
In patch  W101_legacy_error, a fix was made to stop a -game error from causing
a missing legacy wad.  That has caused a new error, when legacy wad itself
is not found.
Fix AddFile to not segfault when filename is NULL.
Fix previous patch to check for legacywad before trying to add it.

*** W102_macos_tcp
patchfile = w102_22_macos_tcp
- commit revision 1161, 1162
Merged macos/i_tcp.c file into main i_tcp.c file.  There were very few
differences and I do not know if they were significant, or just old.
They have been recorded in i_tcp.c now, and the macos/i_tcp.c file deleted.

*** W102_mobj_return
patchfile = w102_23_mobj_return
- commit revision 1163
Fix some mobj functions to have a final return stmt.

*** W102_cv_inc
patchfile = w102_24_cv_inc
- commit revision 1164
Give the CV_Possible_t system an INC option.  This is used to increment the
wait time in 5 second increments.

*** W103_wadtool
zipfile = w103_1_wadtool.zip
- commit revision 1165
Wadtool has been missing from the legacy 1.45 build.
Copied and revised wadtool from legacy2.
Added directory switch to wadtool, to make it much easier to use in Makefile.
Added reading lump by file name or lump name, so that an extracted wad
can be rebuilt without having to change file names of the lumps.
New files: tools/wadtool.cc

*** W103_fixdep
zipfile = w103_2_fixdep.zip
- commit revision 1166
Windows and DOS do not have sed, which is used to add the obj/
directory to the dep file entries.
The tool, fixdep, will do the same operation, making the dep files work
on Windows and DOS.
New files: tools/fixdep.c

*** W103_makefile
zipfile = w103_3_makefile.zip
- commit revision 1167
Heavily rewrote all Makefiles to reduce user errors and miss-information.
Added Makefile to resources.
Added error detections, error messages.
Changed syntax of make_options.
Now uses OS= for operating systems.
Now uses CC_SELECT= for compiler select.
Main Makefile now invokes sub-makefiles.
Src makefile still has capability of being run directly, but other
sub-Makefiles must be run from Main Makefile, as they use exported vars.
Initial creation of make_options is now smarter and provides more informative.
Created initial make_options for the various port targets.
New files: make_options_nix, make_options_win, make_options_os2,
make_options_dos, make_options_mac, tools/Makefile, resources/Makefile.

*** W103_doomdir
patchfile = w103_4_doomdir
- commit revision 1168
Increased the number of directories searched to 24.
These directories are set in doomdef.h, according to the OS,
and are searched for legacy.wad, and the IWAD.
On failure, will print out the directories searched, as an aid to the
player to setup the game.
Implement I_Get_Prog_Dir, for all ports, so can reliably get legacy.wad.
On some ports this can use special system calls.  The fallback code
looks at argv[0] and extracts the directory.

Under Win32, will also check the environment variable "UserProfile"
as a home directory.

*** W103_install_docs
zipfile = w103_5_install_docs.zip
- commit revision 1169
Create a separate install document with the comprehensive information
on installing.  This is more visible for someone looking for install
information than having the information buried in legacy.html.
New files: doc/INSTALL.html

*** W103_quit
patchfile = w103_6_quit
- commit revision 1170
There is now a port independent video status, which also serves during
shutdown to prevent quit looping on errors.  When legacy.wad was not
found, a quit loop was triggered due to more errors on shutdown.
Shutdown is now handled by D_Quit_Save, which has complete sequencing
of the shutdown, even with multiple errors retriggering the Quit.
This simplifies the port code, and only one copy needs to be maintained.
The header for endtext printing is now port independent, removing a
header file from every port. The endtext code has been given a proper
copyright and credit.

- commit revision 1171
Files removed: macos/endtxt.h sdl/endtxt.h linux_x/endtxt.h

*** W103_heretic_status
patchfile = w103_7_heretic_status
- commit revision 1172
Cleanup of the Heretic status code.  Rename many functions to make it
more clear that they are the Heretic versions of the status bar functions.
Renames some Heretic status bar vars as stbar_xxx, to more readily
identify them as Heretic status bar variables.
The draw of the Heretic status bar has a darkening of the chain on the
ends (shadow).  This code was 8 bit palette draw only, which left
draw artifacts for other draw modes.  This draw has been updated to
correctly draw shading for the other draw modes too.

*** W103_filesearch
patchfile = w103_8_filesearch
- commit revision 1173
Add directory depth search to doomwaddir search.
IWAD search will now search 3 or 5 deep in the doomwaddir directories.
Rewrite filesearch function in sdl, to add tests for malloc fail, tests
for open fail, and to reorder some operations.

*** W103_tools makefile
- commit revision 1174
Remove file: tools/makefile  (was replaced by tools/Makefile)

*** W104_src_makefile
patchfile = w104_1_src_makefile.zip
- commit revision 1175
Add file: src/Makefile
This is a re-submit of the Makefile from W103_makefile, which seems
to be missing in the svn.

*** W104_inline
patchfile = w104_2_inline
- commit revision 1176
The inline keyword is causing some problems with some compilers.
Remove it and let compiler do any inlines it can.

*** W104_misc
patchfile = w104_3_misc
- commit revision 1177
Remove some extraneous extern from p_local.h.
Add a blank line to clisrv.c.
Add a comment to linux_x/i_video_shm.c.

*** W104_untab1
patchfile = w104_4_untab1
- commit revision 1178
Remove leading tabs from lines.
dehacked.c
p_chex.c
r_defs.h
r_things.c
t_func.c
t_parse.c
t_prepro.c
t_spec.c

*** W104_untab2
patchfile = w104_5_untab2
- commit revision 1179
Remove leading tabs from lines.
p_floor.c
p_genlin.c
p_setup.c
p_spec.c

*** W104_splash_sec_change
patchfile = w104_6_splash_sec_change
- commit revision 1180
On a sector change, the flat can be changed.
DoomLegacy identifies the flat picture to enable splash sounds.
Boom did not have water splash sounds, and the splash sound
remains when the flat changes.  When the sector flat picture
changes, the sector floortype must be copied from the model sector too.
Fixed bug 0319.

*** W104_untab3
patchfile = w104_7_untab3
- commit revision 1181
Remove leading tabs from lines.
hardware/hw_light.c
hardware/hw_main.c
hardware/hw_main.h

*** W104_devgame
patchfile = w104_8_devgame
- commit revision 1182
Checking of devgame switch was hiding value of devparm switch.
Fixed so they use independent vars, but devgame will set devparm.

*** W104_deh_myfile
patchfile = w104_9_myfile
- commit revision 1183
Change naming MYFILE to myfile_t to follow project rules, less confusion.

*** W104_deh_list
patchfile = w104_10_deh_list
- commit revision 1184
Disable a dugging printf.
Show a readable listing of DEH text replacement, for (devparm && verbose).
( -devparm -v )
Make the deh_error function show DEH errors for any of
devgame, devparm, or v (verbose) switches.

*** W104_deh_text
patchfile = w104_11_deh_text
- commit revision 1185
Text replacement failed when string was 6 chars long because the
search name str1 corrupted the stack, hitting the deh line buffer.
Made search name longer to include term 0.

*** W104_splgt
patchfile = w104_12_splgt
- commit revision 1186
Make sprite dynamic light enum, sprite_light_e, with values SPLGT_xxx.
Define the sprite light xxx_SPR types as a combination of the flags.
Use the enum flags for type bit testing.
Remove dynamic light macros, putting the dynamic light structure access
in the program code.  Use a structure ptr to access fields, instead of
repeated indexing.

*** W104_corona_func
patchfile = w104_13_corona_func
- commit revision 1187
Rewrite parts of fragglescript corona function to fix Chex newmaps bugs.
Rewrite func as String_to_RGBA func to handle any length hex value string.

Chex newmaps does not turn on the corona type flags for the
fireflies.  To make the fireflies work, the corona is turned on if it is
0 when a write to the corona color is made.
The code for Doomu has the tall-torch corona turned on, but
the Chex1 patch turns it off.
This fixes the Chex newmaps fireflies, as far as I know.

*** W104_deh_comment
patchfile = w104_14_deh_comment
- commit revision 1188
Catch some BEX comments so they do not cause error messages.
Fixes messages in toxdm1.wad.

*** W104_teamname
patchfile = w104_15_teamname
- commit revision 1189
Initialize team names to NULL upon creation.
Fix segfault in set_team_name, when setting teamplay from console.

*** W104_untab4
patchfile = w104_16_untab4
- commit revision 1190
Remove leading tabs from lines.
g_game.c
g_input.c
hu_stuff.c

*** W104_hexen_err
patchfile = w104_17_hexen_err
- commit revision 1191
Give hexen unsupported error message on -game switch.

*** W104_map_command
patchfile = w104_18_map_command
- commit revision 1192
Fix map command level setup to set the gameepisode and gamemap correctly.
This also caused the wrong music to be played and the wrong level setups
to be used.
This would also lead to corrupted savegames, saving the wrong map number.
During savegame loading, it would use the wrong map to size the level
structures, which would lead to the save game restoring
some structure changes outside of the structure boundaries (overwriting
something else).  Added some checks to the savegame restore to detect
sector or linedef numbers that exceed the established structures.
This will detect some existing savegames as corrupted.  They could be
fixed by correcting the map number in the savegame.

*** W104_misc
patchfile = w104_19_misc
- commit revision 1193
Make fogcolor default assign to work for any endian.
Some misc indent alignments and spacing.
Remove some extern from the code, and into header files.

*** W104_mapwad
patchfile = w104_20_mapwad
- commit revision 1194
Give the console map command a file search like the command line.
The command line has more privileges, the map command is more
restricted.
The map command, as a network command, is restricted to ".DEH",
".BEX", and ".WAD" files, and within public doomwaddir directories.
The previous search of 10 directories deep is removed as a security risk.
Now it searches the doomwaddir list, to 4 subdirectories deep.

*** W104_ticrate
patchfile = w104_21_ticrate
- commit revision 1195
Put a ticrate display control in the video menu.
Give the ticrate display a numeric FPS display, in addition
to the graphical display.
Cleanup old code and remove other old options.

*** W104_untab5
patchfile = w104_22_untab5
- commit revision 1196
Remove leading tabs from lines.
am_map.c
m_menu.c
p_mobj.c
p_mobj.h
p_pspr.c
t_array.c
t_script.c
t_script.h
t_vari.c
v_video.h

*** W104_bob
patchfile = w104_23_bob
- commit revision 1197
Make BOB_MOM code a standard feature, remove compile tests.
Make VOODOO_DOLL code a standard feature, remove compile tests.
Make GAMMA_FUNCS code a standard feature, remove compile tests.

*** W104_funcnull
patchfile = w104_24_funcnull
- commit revision 1198
Give the thinker funcs a proper name for remove thinker, instead of -1.
Create a remove thinker action function.  Simplify some of the thinker code.
Still has NULL as no action, but do not delete thinker.

*** W104_gamma
patchfile = w104_25_gamma
- commit revision 1199
Rename gamma_bright_black choice to be gamma_full, so it fits in the menu.
Make it the default choice, which will minimize problems with
existing config files.

*** W104_dark
patchfile = w104_26_dark
- commit revision 1200
Create menu control with 3 darkness settings of the background and console.
The dark setting darkens the background so the menu are easier to
read against the background.  It also darkens the console background to
make console text easier to read.
Simplify the hardware background fade function, make it reliable.
Implement a common Fade function that is used for background fade,
console fade, and FS screen fade.  This fade function can fade with any
alpha value and apply a low value color tint (but not high color values).
Its 8bit palette draw is color limited to the only console green tint.
FS screen fade now applies to software draw too (but no color with 8bit).
Cleanup the FS fade function, and FS fade variables.

*** W104_drawinfo
patchfile = w104_27_drawinfo
- commit revision 1201
Change V_drawinfo, to just drawinfo.  It appears everywhere in v_video.c,
and very little anywhere else.

*** W104_patch_offset
patchfile = w104_28_patch_offset
- commit revision 1202
The topoffset and leftoffset were calculated wrong for patch draws when
SCALEPATCH, but not SCALESTART.  The offsets must have SCALEPATCH
scaling applied, not SCALESTART scaling.  This did not happen in
vanilla code, but occurs in new applications of scaling, such as font size.

*** W104_fontsize
patchfile = w104_29_fontsize
- commit revision 1203
Add menu entries to control the console font size and the message font size.
The small font size is the unscaled draw.
The med font sizes are use the FINESCALE drawing.
The large font size is a scaled draw.
Removed the V_NOSCALESTART and V_NOSCALEPATCH options, in favor of
V_SCALESTART, V_SCALEPATCH, V_FINESCALEPATCH, and V_NOSCALE options.
The flag V_NOSCALE is 0, not tested, and is only a visual placeholder.
Created a V_SetupFont, that controls font size for drawing.
It uses V_FINESCALEPATCH and V_SetupDraw to control font size.
V_DrawString has to honor SCALESTART in positioning the string, but
also needs to position characters drawn by V_DrawScaledPatch and V_DrawMappedPatch.
This code could not handle all situations.
Have created two functions that turn off SCALESTART and restore it, and
these are used by V_DrawString so it can use unscaled character positioning.
Cleaned up the console draw code, adjusting the indent to make the
console text more readable.
Gave console and hud text proportional font drawing.
Fixes Bug 0532.

*** W105_ver
patchfile = w105_1_ver
- commit revision 1204
Change to version 145.3, in preparation for 145.4 release.

*** W105_ztag
patchfile = w105_2_ztag
- commit revision 1205
The tag in ZAlloc will be known as ztag in user code, to differentiate it
from Doom tags.

*** W105_untab6
patchfile = w105_3_untab6
- commit revision 1206
Remove leading tabs from lines.
d_net.c
d_netcmd.c
d_netfil.c
d_netfil.h
hardware/hw_bsp.c
hardware/hw_draw.c
r_bsp.c
w_wad.c
wi_stuff.c

*** W105_findfile
patchfile = w105_4_findfile
- commit revision 1207
Some changes to file searches to handle absolute and relative files.
Doomwaddir searches only look for a simple filename in a directory.
Make net access to file system more secure, with explicit checks for
complex filenames, and only allowing doomwaddir searches with simple
file names.

*** W105_asm
patchfile = w105_5_asm_cc
- commit revision 1208
In asm, Clang does not accept "%cc", as it is not a register.
Gcc used to accept "%cc", and probably still does.
In the asm clobbered section, cc and memory should not use %.
Fixes bug #0620.

*** W105_bad_sidedef
patchfile = w105_6_bad_sidedef
- commit revision 1209
The wad 2002ado.wad has many sidedef with bad sector numbers, but they
are also unused.  They were left by the editor.
Fixed the error reporting to ignore those with sector number = 65535
unless verbose is ON.  Also to report if any line is using the sidedef.

*** W105_untab7
patchfile = w105_7_untab7
- commit revision 1210
Remove leading tabs from lines.
p_enemy.c
p_henemy.c
p_inter.c
p_local.h
p_map.c
p_switch.c
p_telept.c
p_user.c

*** W105_corpse
patchfile = w105_8_corpse
- commit revision 1211
Fix BossDeath failure.
It was due to A_Fall setting health for solid corpse damage.
Corpse must have health < 0.  There are too many tests against health
all over the code to change them all.
Solid Corpse health is now (0 .. -spawnhealth).  Upon reaching -spawnhealth
the corpse is Killed, becoming gibs.
In DamageMobj, the corpse handling is intercepted earlier and handled
separately.
Removed the extraneous tests against MF_CORPSE.
Fixed the health when restoring old savegames.

*** W105_give_health
patchfile = w105_9_givehealth
- commit revision 1212
Change P_GiveBody to P_GiveHealth.

*** W105_bsp
patchfile = w105_10_bsp
- commit revision 1213
Some cleanup of the software bsp, doorclosed flag.
Removed some stuff that was commented out.

*** W105_hardware
patchfile = w105_11_hardware
- commit revision 1214
Cleanup naming, syntax, and parameters in hardware files.
Preparation for fixing the hardware draw problems.
Removed some old code that was commented out.
Removed old poly allocation.
Removed extraneous parameters.
Separated out loading_status as separate function.
Made BSP poly statistics conditional on DEBUG_HWBSP.
Many comments added.
Choose the SPRITE_LIGHTLEVEL conditional selection, removing the alterative.
Removed some dup_view variables, because they did nothing special.
Chose the PLANE_MERGE_SORT conditional selection, removing the old sort code.

*** W105_hwbsp
patchfile = w105_12_hwbsp
- commit revision 1215
Rewrite of hardware draw polygon creation.  This uses a wpoly_t structure
with vertex pointers that makes it much easier to maintain common vertexes.
The final polygons are converted to the current polygon structure so
the drawing code is not affected.

Fixes some polygon errors in wads such as BOOMEDIT.WAD, and phobiata.wad,
using OpenGL.

The BSP walk procedure gives the subsector convex polygon, and a list
of segs.  Cutting the subsector polygon with the segs introduces errors,
and the result might not be convex.
Example: BOOMEDIT.WAD, map01, subsector 206, has segs from linedef 104
and linedef 110, that meet in the subsector making it non-convex.
The void space behind linedefs 104 and 110 cannot be eliminated easily.

Added a control to select polygon shape options. The default is Trim.
Subsector: Disables cutting with segs.
Fat : Ignores any seg that does not cross the subsector polygon entirely.
Trim: Chains together the segs, and applies those chains that cross the
  subsector polygon.  It might create a non-convex polygon, so a check removes
  the center vertex where sides meet at an interior angle
  greater than 180 degrees.
NonConvex : Leaves the non-convex polygons.  My nVidia supplied
  OpenGL library seems to tolerate the non-convex polygons.

*** W105_hwpoly
patchfile = w105_13_hwpoly
- commit revision 1216
Expanded use of wpoly to rest of polygon building code.
Change to drawing poly is now done in finalize_polygons().

*** W105_crack1
patchfile = w105_14_crack1
- commit revision 1217
Apply some hw draw crack remedies.
Check the cross product, so an added vertex does not make the crack worse.
Fix a bug when a seg-chain cut only cuts one side of the polygon.
Add some comments.

*** W105_bsp_sector
patchfile = w105_15_bsp_sector
- commit revision 1218
The bsp in the wad file has errors.  One error is that sometimes it has
the wrong sector number for a subsector.  This results in drawing the
wrong sector.
Try to dectect some of these.
Created a routine to find the correct sector by finding the closest
facing linedef to a point within the subsector.
This fixes one of the missing sector draws for a sign in BOOMEDIT.WAD.

*** W105_hwsky
patchfile = w105_16_hwsky
- commit revision 1219
Fix the hardware render sky drawing to block walls and flats drawn
inside buildings.  Sky sectors are supposed draw sky over the walls,
which blocks the view of any taller sectors behind the wall.
Draw these sky walls invisible to set the z-buffer to block draws behind
the wall.  The sky is already drawn as a background, and will show through.

*** W105_crack2
patchfile = w105_17_crack2
- commit revision 1220
The polytile remedy.
It enters the same vertex in adjacent poly when splitting a poly at an angle
that may cause crack errors.  This should prevent cracks before they start.
In the existing routines, it is hard to find these poly points after other
poly splitting has taken place.  It was going to get very complex to fix it.
This can eventually replace that search.
There is some conflict with some existing crack repair routines,
so it is made optional.  It does not seem to do harm, but its effect is
not yet obvious.
A control,  gr_polytile, can turn it off and on.

*** W105_bsp_clean
patchfile = w105_18_bsp_clean
- commit revision 1221
Cleanup some bsp and segs drawn code.
Indent fixes, line rearrangement.
Add comments.
Make some I_Error into I_SoftError, so user can save the game at least.
Rearrange logic of doorclosed.
Comment out some unused struct fields (waterclip, scaleseg).
Rename some vars to avoid C++ keywords.

*** W105_crack3
patchfile = w105_19_crack3
- commit revision 1222
Fix the indenting in the polytile code.
Add handling of a seg cutting that hits only one vertex.
Remove some older unused box code.

*** W105_spawn
patchfile = w105_20_spawn
- commit revision 1223
Rewrite of spawning code.  It could not handle more multiple players
than spawning spots, and network join spawning was suspect.

Converted G_CheckSpot, to G_Player_SpawnSpot, which now
does the collision check, the spawn fog, and the player spawn.
Added check of objects and players using a static mobj, so as to not
depend upon any player mobj.  This eliminates the need for the
spawn without a check from the original Doom code.

The Coop spawning now tries to spawn at 255 locations around the spawn
spot, to handle collisions, and to allow more players than spawn spots.
Deathmatch spawn will also try Coop spawning if it needs to.
Coop spawn will try Deathmatch spawn locations (last) if it needs to.

*** W105_gstate
patchfile = w105_21_gstate
- commit revision 1224
Remove files g_state.h  g_state.c.
They only declared a few variables, and do not exist in legacy 2.
The file doomstat.h already exists to declare such state variables.
Add GS_FORCEWIPE, to avoid storing -1 in an enum variable.
Clean up some other extern, and some enum type names.

*** W105_playermsg
patchfile = w105_22_playermsg
- commit revision 1225
Expand the show messages option to (Off, minimal, play, verbose, diag).
This control now affects all messages displayed during play.
If the player sets to minimal, they will not get messages for minor
object pickups like ammo, but will get messages for important things,
like the BFG.
Each player message now calls P_SetMessage, with a level value.
Calling P_SetMessage is now required, to process cv_showmessages, so
direct setting of player->message is no longer allowed.
Replace the Heretic ultimatemsg boolean, with priority tests derived from the
message level.
The memory expansion message can now be blocked.  The EMSG categories
are now explicit in the enum code, so that GenPrintf info, warnings, debug,
and other print categories are properly tested during playing.

*** W105_sorted_sprite
patchfile = w105_23_sortedsprite
- commit revision 1226
Remove old code (DRAW_UNSORTED) and choice code (DRAW_CHOICE) in
hardware renderer.  The new code (DRAW_SORTED) of w89_draw_sorted
is used, which sorts transparent walls and sprites.

*** W105_spritedist
patchfile = w105_24_spritedist
- commit revision 1227
Improve the handling of drawing an excessive numbers of sprites.
The closest sprites are always drawn.
The farther sprites depend upon the distance from the viewer and priority.
The priority takes into consideration the object height, and if it is a
corpse, missile, or monster.

*** W105_untab8
patchfile = w105_25_untab8
- commit revision 1228
Remove leading tabs from lines.
p_fab.c
p_heretic.c
p_hpspr.c
p_hsight.c
p_info.c
p_lights.c
p_maputl.c
p_saveg.c
p_spec.h
p_tick.c
sb_bar.c
st_stuff.c

*** W105_pickupflash
patchfile = w105_26_pickupflash
- commit revision 1229
Create a control for pickup flash.
  off : no flash
  status : parts of the status bar flash color
  half : the palette flash is half intensity
  vanilla : the Vanilla Doom palette flash
The status bar pickup flash applies to the status bar and overlay
status. The appropriate box is flashed with a color.
Heretic is also affected, but uses different flash colors.

Made a DrawVidFill function that accepts screen scaled parameters.
Improved the hardware draw version by using precaluclated vid fields.
These precalculate some of the multiplies by 2.0 and divisions by
vid.width and vid.height.
(fx_center, fy_center, fx_scale2, fy_scale2)

*** W105_dck
patchfile = w105_27_dck
- commit revision 1230
Removed (with #ifdef) some code for testing water planes using DCK work-around.
DCK is an obsolete wad editor for DOS and Win95, that only allowed
linedefs 0..255.  It could not create some Boom and DoomLegacy water
sectors, so they were using negative tag values.

*** W105_waterplane
patchfile = w105_28_waterplane
- commit revision 1231
When a water surface is close to eye level, the water plane is not
drawn completely.  This was showing HOM or sky.
Move clip plane closer to the player.
Detect when player has water surface near eye level and draw both above
and below the water until eye level is cleanly above or below the
water level.  When the eye level is exactly level with the water surface
the player can see both above and below the water.
There are still some sky flashing for OpenGL, but it is due to
something else.

*** W105_netwait
patchfile = w105_29_netwait
- commit revision 1232
Change the net wait to count players instead of nodes.
This allows machines with split screen players to be handled cleanly.
Playing with only split players will now start cleanly without
having to fiddle the wait parameters.
Clean up the wait message box.
Add a hint line to the wait box for the start and quit keys.

Remove leading tabs from lines.
  d_clisrv.c

*** W105_untab9
patchfile = w105_30_untab9
- commit revision 1233
Remove leading tabs from lines.
doomstat.h
f_finale.c
g_game.c
hw_cache.c
hw_trick.c
p_inter.c
r_draw.c
r_main.c
st_stuff.c
wi_stuff.c

*** W105_heretic_server
patchfile = w105_31_heretic_server
- commit revision 1234
Change variables like raven, to raven_heretic_hexen, so they are self
explanatory without having to know Doom history.
Fix the start server so it also works for Heretic and UltDoom.
The start server menu now changes to give selection of the episode style
of map naming when appropriate.
When a player becomes a chicken, clear the skins setting in the mobj
so the other players can see a chicken.  Otherwise the skins overrides
the chicken sprite.  Restore the skin upon un-chicken-ing.
If the player dies while a chicken, they leave a chicken corpse.

*** W105_statusbar
patchfile = w105_32_statusbar
- commit revision 1235
Rewrite of all the status bar, overlay status, and status palette
flash routines, so they work cleanly with splitscreen.
For all draw modes except 8bit palette draw, each split screen can now
palette flash individually.
Move the status palette flash to the RenderPlayer code so the correct palette
is always used when drawing a splitscreen.
The status draw routines now used plyr as a parameter that is passed in,
so that each splitscreen reflects the status of that player.  Use of the
global single player ( st_plyr ) has been minimized, mostly used in the
single player only status bar code sections.
Splitscreen only can use overlay status, as the status bar saves state
to speed up drawing, and it only saves for the one player.  This is now
much more extensively commented, denoting exactly which functions are affected.
Provide for some state saving according to the splitscreen view position
for hardware draw.  For example, this requires the sky draw variable to
be saved for each screen position.
The Heretic status bar code has been updated the same as the Doom
status bar code, and now shares some of the same tables and variables.
Move the hardware palette flash to the hardware code, and enable
it from a hardware code determined setting.
Rewrote the stlib for the status bar drawing to remove unnecessary
parameters.  Moved the minus sign and percent to be part of the number
font passed to the stlib.  Made refresh and erase into global control vars
so they can be setup once.

*** W105_flatsize
patchfile = w105_33_flatsize
- commit revision 1236
Move the switch tests in the flat rendering to the setup phase by
saving a flat size_index in the levelflat structure.
Retrieve pre-calculated values for each flat size from tables indexed
by the size_index.
Pass the picnum to the plane render functions instead of the lumpnum.
Save the picnum instead of the lumpnum for planes.

*** W105_flatsize_b
patchfile = w105_33b_flatsize
- commit revision 1237
Fixed a lumpnum field that was made too small.
Error showed up with phobiata.wad, or probably any wad with animated flats.

*** W105_printf
patchfile = w105_34_printf
- commit revision 1238
Modified the CONS_Printf functions to better handle categories.
This fixes the console help function, whose output was blocked when
game playing.

Output routing flags are now separate from category flags, as EOUT.
The output routing is no longer encoded into the EMSG flags.
The hud output is now more independent of the console output.

The GenPrint EMSG parameter now selects a category, and has only a
couple special flags (EMSG_now, EMSG_all).
This is now directly passed to the CONS_Printf_va function so that the
global default flags do not need to be temporarily modified.
Many message categories now directly modify output routing in CONS_Printf_va.
There is a category that outputs only to the console (EMSG_console), and one
that only outputs to the log and stderr (EMSG_errlog).

Changed the gameplay message selections to:
Off, minimal, play, verbose, debug, dev.
This controls which messages are seen on the hud and the console
during gameplay.

Created a direct debug printf function (debug_Printf) that makes
debug printing simpler.

Fixed the font1 output so that spaces appear in the printed line.

*** W105_autorepeat
patchfile = w105_35_autorepeat
- commit revision 1239
Add autorepeat to the console scrolling page-up and page-down keys.
This is done in software, so that the keyboard setup remains the same.

*** W105_info_flags
patchfile = w105_36_info_flags
- commit revision 1240
All the info fields are now mostly stdint, with a few fixed_t, instead
of all using the default int (which could be 64 bits).
This alone reduced the program size by 10K.
Moved activesound to after the seesound field.
Moved raisestate to after the xdeathstate field.
Fixed some other anomolies in the info declarations, such as using
sfx_None instead of 0.
Added a missing deathstate field in MT_SPIRIT.
Changed the flags in info to uint32_t.
Changed the flags in mobj_t to uint32_t also.
Changed some flag vars in the code to uint32_t also.

*** W105_spawn_fog
patchfile = w105_37_spawn_fog
- commit revision 1241
Move the spawn fog over the spawned monster and spawned object.

*** W105_fixdep
patchfile = w105_38_fixdep
- commit revision 1242
Fix a sizeof() compile issue in fixdep.

*** W105_sound
patchfile = w105_39_sound
- commit revision 1243
Restructure the sound info table, and sound priority system.
Created new types to regularize the sfx parameters.

Fix Heretic sounds.  The channels were saturated with copies
of the same sound, which was a faint low priority sound.

Heretic uses ascending priority, while Doom and the code used
descending priority.  The Heretic priority system is more capable,
and Heretic handles more types of sound, so switched everything to using
signed ascending priorities in the range -10..2560.

The priority is also altered for distance, so faint sounds can get replaced.
This required that priority be passed as a parameter, replacing any
reference to the priority in the sfx info tables.

Made the Doom sound priorities get used, instead of mostly ignored.
The Doom priorities from the info tables are converted to ascending at
the time they are read, which now is in only one place.
Dehacked changes to info for Doom and Heretic should function as before.

Changed code so all sounds go through S_StartSoundAtVolume,
which now is the only function that calls  HW3D_I_StartSound functions.
The complications for Heretic, priority, skin sounds, and linked sounds,
are now only handled in this one place.
Moved the sound functions for attack, scream, and ambience, out of
HW3D_ to s_sound.c, and they now only call S_StartSoundAtVolume, with
a new ct_type parameter.

The linked sounds in the sound info are strange, and mostly non-functional.
Heretic and Doom are no better.
Doom only has one linked sound, sfx_chgun, and it does not actually modify
the pitch or volume, even though fields and code were dedicated to doing that.
Heretic did not keep that aspect of the sound info tables.
Removed the link parameters from the sound info tables, and substituted
an index to another small table.  Fixed the altered param to make more sense.

Added a field to the sound info tables for the Heretic limit channels.
This limits how many channels can have the same sfx.
Checks this limit when trying to get a channel.

*** W105_fix_svn
patchfile = w105_40_fix_svn
- commit revision 1244
Somehow got two copies of a palette patch in the hardware/hw_cache.c file.

*** W105_gcc
patchfile = w105_41_gcc
- commit revision 1245
Fix problems caused by use of gcc 4.8.
The SDL defined, as set by "-DSDL", is not recognized by the
command line of gcc 4.8, for reasons unknown.
This define has been changed to SMIF_SDL, which does work.
The other SMIF determined defines were also changed from using VID_ to:
SMIF_WIN_NATIVE, SMIF_OS2_NATIVE, SMIF_X11, SMIF_X11_GGI, SMIF_PC_DOS.
This makes this more obvious that this is a user selected option (SMIF),
and not a detection of the OS.

Gcc 4.8 detects variables that are set but not used, and issues many
warning messages.  Many of these are left over from the original Doom
source code.  Have hunted each down and fixed each, by deleting the
dangling variable, commenting it out, or in one case making use of it.

*** W105_msys
patchfile = w105_42_msys_A, w105_42_msys_B
- commit revision 1246
Concerning compiling and running on a Win32 XP machine.
On a computer with MSYS installed, it has caused some strange problems.
It provides a HOME environment variable, for its own use.  The code
now detects when HOME is from MSYS and ignores it so it can get to
the XP home directory.

MSYS also provides a RM command, but the shell does not recognize the
DEL command when used from mingw32-make,
which is causing problems with Makefile cleanup.

MSYS shell will not execute DOS commands, so MSYS commands and MSYS
legal directory specifications have to be substituted everywhere.

*** W105_flash_opengl
patchfile = w105_43_flash_opengl
- commit revision 1247
Fix the pickup flash for OpenGL, and for small status bar.
Make a V_DrawScaledFill that matches the other scaled draws.

*** W105_dirent
patchfile = w105_44_dirent
- commit revision 1248
Systems that do not have ftw.h have to use dirent.h, and that code was
not finished.  Have finished it, along with stat code to identify
directories for systems that do not have dirent D_TYPE either.
Rearranged the code to only have one function that is customized for dirent.

*** W105_pal_gamma
patchfile = w105_45_pal_gamma
- commit revision 1249
Fix palette problems on Windows systems.
A gamma function was putting a 0 in gammatable[ 0x82 ], on Windows, but
not on Linux.  This would zero any color component that happened to be 0x82.
It was caused by (0.0 / 0.0) in the gamma-bright-black gamma function.
It is curious that the floating point NaN would not affect the gamma
table generated on Linux.
I remember someone informing me about a gamma problem some time ago,
but I could not find the fault using Linux.
It had to wait until extensive testing on a Windows system.

Fixed some other suspect code in the palette and colormaps.

*** W105_cv_string
patchfile = w105_46_cvstring
- commit revision 1250
When a cv var set value exceeds the bounds, the code attempts to rewrite
the value string.  The string could be a const string such as during init,
which segfaults on modern systems like Linux.
Fix the code to write a buffer instead.

*** W105_heretic_flash
patchfile = w105_47_heretic_flash
- commit revision 1251
Fix the pickup flash for unscaled status bar in heretic.

*** W105_flatfill
patchfile = w105_48_flatfill
- commit revision 1252
Fixes segfaults caused by flatfill draw writing out-of-buffer.
Added comments in all affected areas.
Added Function V_ScreenFlatFill, to flat fill the screen.

Rewrote FlatFill functions.
- Added detection of scaling in option, so can handle both vid coordinates
used when filling entire screen, and base coordinates used for menus.
Other automated methods had failures, the caller must set the option correctly.
- Removed dependence upon drawinfo for vid coordinate drawing.
It is usally setup for scaled drawing, but might not.
- Converted test on flat size to used flat size indexing, like the other
flat drawing functions.
- Stabilized the edge matching of tiling used for HWR_DrawViewBorder.
- Added a fill scale so that Doom background flats can be scaled down.
This makes it easier to read menu and message text, such as the Quit box.

Rewrote DrawPatch function.
- Added detection of scaling in option, so can handle both vid coordinates
used when drawing entire screen, and base coordinates used for menus.
Other automated methods had failures, the caller must set the option correctly.

Rewrote DrawViewBorder functions.
- Fix HWR draw to also draw heretic alignments and use heretic offsets.
- Fix HWR draw and software draw to align last edge patch. The edge patch
size does not divide evenly into the viewport size.
- HWR_DrawViewBorder draws in vid coordinates now instead of base coordinates.
This does not suffer from misalignment and math errors.

*** W105_bug0626
patchfile = w105_49_bug0626
- commit revision 1253
Fix bug 0626, submitted by Ryan.
Change memcpy to memmove in command.c because it overlaps dest.
Reported that it was causing segfaults.

*** W105_linux_make
patchfile = w105_50_linux_make
- commit revision 1254
Fixes some problems with clean and distclean in the linux port Makefiles.

*** W105_mussrv
patchfile = w105_51_mussrv
- commit revision 1255
Rewrite of most of the musserver for linux_x.  Now it has music again.
Changed the music server interface to s_sound.  The other ports with
musservers will have to be updated to the new interface.

Rewrote the musserver, especially the IPC message formats.
The musserver no longer searches the doom wad.  It is sent the exact wad
file and lump to read using IPC messages.
The sound device to use can be changed using a menu option.
The preferred sound device is sent to the musserver using an IPC command.
This allows the sound device setup to be performed while there is some
music playing.
Added FluidSynth to the device selection.
Rewrote the musserver command line switches entirely.
  see "  >> musserver -h " for details

Fixed many problems with the musserver code.
Starting the musserver using system causes it to have Init as a parent.
This makes watching for the parent to die, useless.
The correct process id is sent to the musserver using an IPC message.

Added code to throttle the Midi commands, so it does not get so far
ahead in the song.  There is no way to shut off the music that has
already been sent to the Midi device, or TiMidity.
Added code to kill drone notes (that did not get shut off).
In spite of redundant attempts to shut them off, sometimes the current
notes of a song will still drone on until the song loops.  Something causes
all the Midi commands to shut off those notes to get ignored.

*** W105_state_null
patchfile = w105_52_state_null
- commit revision 1256
During debugging some segfaults were coming from dereferencing an mobj
mobj->state->nextstate, after it had been removed.
Setting mobj->state to an invalid integer did not work.  The segfault was
difficult to track down, so causing a segfault was just a distraction.
It has been changed to  &states[S_NULL]  when removed, which will not segfault.
Also, a test for this value was added to the state transition code
that was segfaulting, to block the dereference.

*** W105_misc
patchfile = w105_53_misc
- commit revision 1257
Update copyright dates and comments.

*** W105_hwsky
patchfile = w105_54_hwsky
- commit revision 1258
Commit some parts of the hardware draw sky work.

*** W105_extmidi
patchfile = w105_55_extmidi
- commit revision 1259
Include the external midi in the control to select a midi player.

*** W105_hw_ticrate
patchfile = w105_56_hw_ticrate
- commit revision 1260
Fix the draw scaling for the hardware ticrate display.
It was drawing an unscaled graph on a scaled grid.

*** W105_heretic_switches
patchfile = w105_57_heretic_switches
- commit revision 1261
Fix the switches array and SWITCHES lump processing lump.
Heretic was trying to process Doom switch names, giving many error messages.
The w85_heretic_SWITCHES SVN966 patch, removed the (episode==4) test to
allow Heretic/Blasphemer gamemode to process the Boom SWITCHES lump.
The same test also distinguished Heretic switch names from Doom switch names
which were just stuck on the end of the same list.
Made a separate Heretic switch name list, removing them from the Boom switch
names list.  Cleanup of other strange coding vestiges in the switches.
Fixed the test of switch textures so the local messages and texture fixes
are used, instead of using a texture check that has automatic warning messages.

*** W105_win98
patchfile = w105_58_win98
- commit revision 1262
Make conditional one of the Makefile changes for WinXP.
On Win98 using DOS commands, the output redirection of the dep output must
use DOS file name conventions.
On WinXP which has MSYS 1.0.17, they must be unix file name conventions.

*** W105_tcp_err
patchfile = w105_59_tcp_err
- commit revision 1263
Reorganize network error codes.
Add handling of TCP connection reset and connection aborted errors
that were transient errors with WinXP.

*** W105_printf
patchfile = w105_60_printf
- commit revision 1264
Adjust the printf functions to get some missing messages on the console.
Create a EMSG_hud for messages that should appear on the hud during play.

Convert some CONS_Printf calls to use the more specialized printf functions,
like debug_Printf.
Fixed the CONS_Printf execution so that the messages alway show on the
console.

Add DEBUG_MESSAGE_ON to doomdef.h, which disables blocking of
debug_Printf messages in the released version, during normal play.
The debug_Printf are enabled if verbose is on, or if Options message is
at debug or higher level.

*** W105_playmsg
patchfile = w105_61_playmsg
- commit revision 1265
Fix some play messages that were not being seen,
Death messages, secret sector.
The death messages and fragglescript print are fixed for splitscreen.

*** W105_chat
patchfile = w105_62_chat
- commit revision 1266
Fix the netplay chat so that it appears on the HUD.
Display of the chat message works for splitscreen.
Choose the new chat network coding, and removed the old code.
Optimized the functions better.

This will be for Version 1.46 and is not compatible with older DoomLegacy.

*** W105_error
patchfile = w105_63_error
- commit revision 1267
Converted some run-time I_Error, to I_SoftError with a recovery fix.
This allows the player to save the game, or to see the effects of
a wad development error.
Converted I_Error in r_data.c colormap loading, r_things.c sprite
loading, and a skins memory alloc error.

When a sprite does not have all the rotations present, it will no longer
I_Error, but will substitute another sprite frame for the missing one,
with an error message.

*** W105_netdef
patchfile = w105_64_netdef
- commit revision 1268
Changed to use stdint types in the network tic packet, to standardize
the tic packet for both 32 bit and 64 bit machines.

*** W105_netstr
patchfile = w105_65_netstr
- commit revision 1269
Hardened the network XCmd code against malicious packets.
Changed the network XCmd code to use a structure parameter with enough
buffer information to limit string operations that do not find the 0 term.
Removed some of the Macros that the previous code was using in favor of
local customized and hardened string handling code.

Bumped the network version number to 22.
The differences in the packet are slight, but this is done mostly to eliminate
the older code from usage for security reasons.

*** W105_version1461
patchfile = w105_66_version1461
- commit revision 1270
Update version numbers for 1.46.1.
Still uses legacy.wad 145, no need to change that.

*** W105_docs
patchfile = w105_67_docs
- commit revision 1271
Update the docs for Release Version 1.46.

*** W105_home
patchfile = w105_68_home
- commit revision 1272
Add some verbose messages to diagnose problems with video startup and
finding home directory.
Add tests for HOME environment string NULL before using it.
This would crash DoomLegacy on Windows, where HOME is not usually set
(when do not have MSYS).
Thanks to testing by Eckehardt Luhm.

*** W105_rankings
patchfile = w105_69_rankings
- commit revision 1273
Thanks to testing by Eckehardt Luhm.
Fix color bars in deathmatch rankings in OpenGL.
Limit names to column widths in the rankings.
Fix DrawFill for opengl so that positions match other draws.
Some fixes to status bar usage of the draw fill.

*** W105_bot_respawn
patchfile = w105_70_bot_respawn
- commit revision 1274
Delay the bot respawn by 6 seconds, so they are not so overwhelming.

*** W105_docs2
patchfile = w105_71_docs2
- commit revision 1275
Update some more docs and README for Release Version 1.46.

*** W105_vidbytes
patchfile = w105_72_vidbytes
- commit revision 1277
On 64 bit machines, the multiply of a patch offset (signed short)
and the ybytes (unsigned int) is treated as unsigned.
When the offset is negative, a large number is added to the screen
address leading to segfault.
Because there are multiplies like this throughout the video code,
it is safer to keep several unsigned values, like ybytes, in signed vars,
so the multiply is handled correctly by the compiler.

*** W105_offset
patchfile = w105_73_offset
- commit revision 1278
Sprite load for hardware render had a patch offset stored in an uint16_t.
It looks like a negative offset would not work as in the original version
1.42 code.  It is a temp var introduced as part of the SWAP code update,
and has no explanation.  Fixed it to be signed.

*** W106_savegame
patchfile = w106_1_savegame
- commit revision 1279
The W105_netstr patch changed some function interfaces, to provide buffer
limits so as to prevent buffer overrun.  A few calls in the savegame code
were updated, but one did not update the current savegame ptr.
As a result the Net variables saved in the savegame got overwritten.
The savegame read code correctly recognized that the savegame was
missing too many Net variables, and issued a corrupted savegame message.
Added the missing line to update the savegame position.
Testing should have caught this, and it may have been noticed.
But other bugs being fixed at the same time may have confused things.
It did not affect reading an old savegame.

*** W106_netfile
patchfile = w106_2_netfile
- commit revision 1280
Fix some network file download problems.

A network game would display different textures when it downloaded the
wad file, than if it loaded the wad file from the command line.  The
routine for adding a wad file tried to find and update textures, which
did not work.  Any texture or patch change by the loaded file would
affect textures, so it is safer to just clear the cache and rebuild all
textures.

Gave the network download a display of file download activity, in
a box with speed and file size.  This replaced some of the existing hud
messages, and others were updated to be more helpful and informative.
Gave it a background draw so the background does not flicker due to
hardware double buffer swaps.

Used LE_SWAP32 instead of LE_SWAP32_FAST in the one time network code,
as speed is not an issue there.

Init the command line file load list properly.

*** W106_netrepair
patchfile = w106_3_netrepair
- commit revision 1281
Fix some network consistency check problems.
The network version has been incremented to 23, which makes this version
incompatible with any previous DoomLegacy.  Some command enumeration
has moved, due to the priority implied in the command ordering.

Sometimes there will be a consistent consistency check failure, for
unknown reasons.
The server now has the ability to fix the player, instead of just kick
them from the game.
Added an PT_REPAIR network command to allow the server to repair the player
position, the random number index, and the gametic.

A count of recent consistency failures is kept so that an escalating
series of actions can be taken.
1. Repair the player position.
2. Repair the node with a savegame, which will maintain the
player at their current position.
3. The Kick command will be issued.

*** W106_docs4
patchfile = w106_4_docs
- commit revision 1282
Update the docs for 1.46.2.

*** W106_net
patchfile = w106_5_version1462
- commit revision 1283
Update the version to 1.46.2.

*** W106_shadechain
patchfile = w106_6_shadechain
- commit revision 1284
Heretic shade chain draw procedure is drawing outside the display
buffer.  This corrupts other memory blocks.
Restore the line with the correct scaling.
This had been changed during diagnosis of drawing errors, but should
not have been committed to the code base.
This has been latent for around a year because, for some unknown reason,
the SDL version does not show symptoms, unlike the X11 version which
will segfault after 2 or 3 level maps.

*** W106_zzone
patchfile = w106_7_zzone
- commit revision 1285
Some fixes to the alternative zone memory system, used for debugging.

*** W106_x11_sound
patchfile = w106_8_x11_sound
- commit revision 1286
Rewrite of X11 sound server.  Much of the code was not used, being
blindly copied into the sound server because some other sound system had it.
Disabled the unused code for several kinds of alternative sound systems that
were not selected.
Remove redundant files:
  linux_x/sndserv/sounds.c
  linux_x/sndserv/sounds.h

*** W106_version1462_1287_docs
patchfile = w106_9_version1462_1287_docs
- commit revision 1287
Release 1.46.2 again, due to finding another bug before making the release.
Update Release docs and VER.

*** W106_messagebox
patchfile = w106_10_messagebox
- commit revision 1288
The text in the message box is not in the box.
Setup the message box position for non-menu message boxes.

The Message box is positioned badly for video modes other than 800x600.
This is due to menu centering Setup that differs from message box setup.
Make the caller do the Setup to make it consistent for menus.

Adjust connect menu position to give more room to the boxes.

Fix the menu centering for video modes that pad the video lines.

Fixes bug 629.

*** W106_linux_sound
patchfile = w106_11_linux_sound
- commit revision 1294
Another attempt to fix drone notes in the X11 music server.
This time it uses the ioctl to reset the sequencer, which reacts much
faster.  Remove most of previous fixes, which did not work well.
Mostly, the notes can be turned off, but if the mixer controls are
touched too soon the drone notes will turn back on.  This requires some
delays during the midi reset.

The selected device in the sound menu now does not search when a
specific device is selected.  The Midi, Synth, and Search selections
will search the devices.  The default device is a preset of the musserver.
The default selection is SEARCH1.
For future expansion and to easily allow user modifications,
have added SEARCH2, SEARCH3, Dev6, Dev7, Dev8, Dev9.

*** W106_video
patchfile = w106_12_video
- commit revision 1295
Video modes switches can cause segfault if a print stmt reaches the
console output.  This was occuring in the linux_x xshm video when
verbose was enabled.
Changes to the video status indication are made to prevent print
statements in the video mode switch from causing a console update.
A variable, vid.draw_ready, is added.  It is not enabled until the vid
and screen structures are updated by SCR_SetMode, and V_Setup_VideoDraw().
Some previous video print outputs are restored.

*** W106_cdrom
patchfile = w106_13_cdrom
- commit revision 1296
CDROM music has not worked in Linux.  It has problems in SDL, even in
windows.  The plan was to disable it, as SDL 2 is not going to support
CDROM music anyway.
However, it showed signs of working, and after some effort, it now works.
This is likely the last version that will have CDROM music support.
Checking the CDROM status, in Linux, is a blocking IO call that stops
all action in the game for 1/4 second, which is very noticable.
Getting the estimated play time and using that for loop timing
eliminates all but one status check.
There were many other changes to fix logical mistakes.

*** W106_shotgun_position
patchfile = w106_14_shotgun_pos
- commit revision 1297
The shotgun and other player weapons are a pixel too high, which leaves
a visible scanline below them.  This is likely due to freelook, that
heretic sprite is compatible with, but the Doom sprite is too small.
For Doom (but not Heretic) move the weapon down 1 pixel.
The position was checked against prboom and looks to be the same now.
Fixes bug 0455 (from 2004).

*** W106_shadow
patchfile = w106_15_shadow
- commit revision 1298
Control variables for translucency and fuzzy mode were confused together,
and confused with smoke draw.
Separated fuzzy shadow draw from translucency.  Put fuzzy shadow draw
control in effects menu.
Expanded translucency control in effects menu.
Fixed Smoke draw function assign.
Fixes bug 0631.

*** W106_connect
patchfile = w106_16_connect
- commit revision 1299
The -connect command line switch was not working due to multiple
tests of the switch, and multiple enablings, triggering an error message.
Setting of the critical variable, netgame, is reduced to one location
for connect, the indirect connect command issued during init of TCP.
This is the wrong place for testing the connect switch, but TCP is using
information in the connect parameter to set its own parameters.

*** W106_autoexec
patchfile = w106_17_autoexec
- commit revision 1300
Test for existance of the autoexec.cfg file before issuing an exec upon it.
This eliminates the extraneous error message about autoexec.cfg.

*** W106_version1463_1301_docs
patchfile = w106_18_version1463_1301_docs
- commit revision 1301
Update the docs for Release 1.46.3.
Update the version to 1.46.3.

*** W106_whatsnew
patchfile = w106_19_whatsnew
- commit revision 1303
Update a missing bug fix in the whatsnew docs.

*** W107_lightlev
patchfile = w107_1_lightlev
- commit revision 1304
Create a consistent light level type.
Use the light level type consistently in all the code.
Adjust and fix other type problems in the light level code.
This will help to avoid sign-extension errors.

*** W107_heretic_flat
patchfile = w107_2_heretic_flat
- commit revision 1305
Heretic E1M8 is displaying a default gray flat for the lava floor.
The LAVA flats in Heretic E1M8 are not a standard size (6150), so the flat
logic cannot classify their size.  These flats likely have an extra row (64x65).
Change the flat size classification to inequalities, to display odd flat sizes
as the next smaller recognized size.  This will almost always be 64x64.
The Heretic F_SKY1 flat has a size of 4, but it is never displayed.
Fixes bug 0638.

*** W107_monster_grav
patchfile = w107_3_monster_grav
- commit revision 1306
The gravity functions affect all players and monsters, but some old enemy
logic puts monsters right on the floor.
Added an enable to block the enemy monster code from overriding the
gravity.  Added menu controls (monstergravity) and a demo field for it.
Fixes bug 0632.

*** W107_savegame
patchfile = w107_4_savegame
- commit revision 1307
The savegame format was corrupted by w107_1_lightlev.
Fix the savegame to write in VERSION_144 format.
Reading the new light thinkers has been fixed, but is disabled.
The light thinkers savegame format may be changed again before
being enabled for release code.
Made DEFINE for controlling the light thinker read and write formats.
The new lightlev savegame format is disabled, and has not yet been written
by a release version, so the LIGHT147_VERSION define has a dummy value.

*** W107_FreeBSD_IPX
patchfile = w107_5_FreeBSD_IPX
- commit revision 1308
A few lines of code for returning an IPX address value on FreeBSD.
Supplied by Alexy Dokuchaev.
Fixes bug 0639.

*** W107_inventory
patchfile = w107_6_inventory
- commit revision 1309
A Heretic inventory item could be used up by a menu keypress.
If the inventory item had been selected, then the menu entered,
the same inventory keypress when used in the menu would leak into
the inventory response and use up the item.
Fix inventory response code to ignore keypresses during menu and
console.
Reset inventory key trigger when using a key, and for keyup,
and give splitscreen player2 own state.
Fixes bug 0641.

*** W107_ARCH
patchfile = w107_7_ARCH
- commit revision 1310
Give ability to compile for a particular architecture.
The ARCH option is added to the make_option files.
It appears that the default is to compile for  -march=generic32,
which appears to be close to i486.
Compiling for i686 can reduce the code size by 30K.

*** W107_byte1
patchfile = w107_8_byte1
- commit revision 1311
Fix some type conversion problems that affect big-endian machines.
Mostly byte comparisions to -1, and automatic type conversion
from unsigned to int.

*** W107_midi
patchfile = w107_9_midi
- commit revision 1313
Rewrote much of the qmus2midi conversion to bring it up to date.
Changed buffers and variables from char to byte.
Fixed comparisons that affect compilation on big-endian machines.
Removed tests for -1 that were from testing for EOF, as the buffers
do not have a terminator for EOF.
Removed extraneous parameters from the qmus2midi function call.

*** W107_float
patchfile = w107_10_float
- commit revision 1314
Literals like 1.25 are actually double and will generate run-time
double operations.  When the target is float, code size will be reduced
by changing them to a float literal, such as 1.25f.
This does not work for float comparisions. Using a float literal in a
inequality will often make the code grow in size.  The default code generation
avoids using the basic float comparision, apparantly because of some
buggy CPU's.
There is an instruction for float literal 0.0 so that is not affected.
Later processors have an instruction for float literal 1.0 also.  But
that is not the default so sometimes it should be a float literal too.

*** W107_console
patchfile = w107_11_console
- commit revision 1315
The console often overruns the right margin.  The proportional font can be
drawn shorter than the fixed width font, but the actual width is unpredictable.
Reduced the console width to keep it within the margins for most font
sizes and screen sizes.
Some of the font chars ('M' and 'W') are wider than normal, and this can
still cause the line to exceed the right margin.
Changed the min console width from 38 to 32, because the large font can
overrun the right margin at 30 characters.
Modified some of the console recalc code to be more readable and smaller.
Fixes bug 636.

*** W107_heretic_plat
patchfile = w107_12_heretic_plat
- commit revision 1316
Fix bug 642.
Heretic E4M1 has a platform, using linedef 22 (raiseToNearestAndChange),
that would retrigger.
Boom code for the same linedef was releasing the thinker, allowing the
platform to operate again.
For gamemode heretic, made it use the heretic test, which does not
remove the thinker for this linedef action.

*** W107_EN_boom
patchfile = w107_13_EN_boom
- commit revision 1317
Changed some control variables naming and type, now EN_boom, EN_mbf,
EN_pushers, EN_variable_friction.  The EN_ variables are easily
recognized as vars that are set by gamemode and demoversion.
Collected the tests for EN_boom in the W1 types in p_spec to one place,
where it is easier to manage.  Added a test for Heretic, and made it
clear the line type unconditionally, as it should.

*** W107_EN_heretic
patchfile = w107_14_EN_heretic
- commit revision 1318
Added EN_heretic, EN_hexen, EN_heretic_hexen, EN_inventory, EN_boom_etc, enables.
They are set by G_set_gamemode, which also sets the gamemode.
In scattered usage these are easier to read in the code.
They also test faster and with less code than gamemode.
The variable gamemode is still used where multiple tests and switches
are used.
Where an enable such as EN_heretic appears, it has been moved to be
first in the if-stmt so to disable executing all tests, and any
function calls in the rest of the if-stmt.  The existing tests for
gamemode seem to have been stuck in the if-stmt whereever it was easiest.

*** W107_downgrade
patchfile = w107_15_downgrade
- commit revision 1319
Cleanup and organize the demo enables.
Use the EN_boom and EN_mbf enables to set demo defaults.
Added a monster no-infight setting, and made Normal setting enable
infighting (as in Vanilla Doom).
Added Heretic and Normal settings to monster friction so they can be
more easily set up for a particular usage.
Fixed the jumping hack in p_map to test the demoversion number (instead of
testing demoplayback for version numbers).

*** W107_absolute_angle
patchfile = w107_16_absolute_angle
- commit revision 1320
Make the compile options FIXROVERBUGS, ABSOLUTEANGLE, the normal.
Removed the compile tests.

*** W107_bot_indent
patchfile = w107_17_bot_indent
- commit revision 1321
Indent the bot code properly and cleanup the alignment.

*** W107_EN_demo
patchfile = w107_18_EN_demo
- commit revision 1322
Add byte EV field to control structure.
It is updated from value whenever the user sets the value using a
command function.
The CV_Restore_User_Settings() function restores the
user settings by copying the value to EV for every registered cv_ var.

Demos can change the value without disturbing the user setting in value.
After the demo, CV_Restore_User_Settings will restore the user values to EV.
This eliminates the need for setting temp EN_ variables using OnChange
functions just to support demo playback, for most variables.

The byte EV field is faster to access for On/Off values and for enum values,
which is the vast bulk of all control settings.  There are only a few
values that need the 32 bit value size and those are generally not set
from demos.
It is also easier to see that it is a control enable, example cv_xxx.EV.

*** W107_color_TRAN
patchfile = w107_19_color_TRAN
- commit revision 1323
Move the skin color TRANSLATION bits from flags to a new tflags.
DEH and BEX flags TRANSLATION bits are directed to tflags now.
Move the NOCLIPTHING flag to flags2.  This is doomlegacy flag only used
for the camera.
This makes room in the standard location for Boom and MBF flags.

*** W107_weapon_recoil
patchfile = w107_20_weapon_recoil
- commit revision 1324
Added the Boom weapon recoil, using code from PrBoom.
Defined  cv_weapon_recoil.
Added PP_Random and PP_SignedRandom defines, which just call P_Random.
This allows using P_Random calls that pass a Boom pr_xxx attribute,
by only changing P_Random to PP_Random.

*** W107_think_mbf
patchfile = w107_21_think_mbf
- commit revision 1325
Add the definitions, functions and lists for MBF friend and enemy class-lists.

*** W107_skull_bounce
patchfile = w107_22_skull_bounce
- commit revision 1326
Add the code for the PrBoom skull bounce fix.

*** W107_mbf_mobj
patchfile = w107_23_mbf_mobj
- commit revision 1327
Add MBF fields and reorganized mobj_t.
Put ptrs together so alignment does not create so much wasted padding.
Put int16 together.

Old size = 208 bytes.
With MBF fields = 224 bytes.
Reorganized with MBF fields = 212 bytes.

*** W107_mbf_controls
patchfile = w107_24_mbf_controls
- commit revision 1328
MBF enables.
The MBF option controls, cv vars.

*** W107_mbf_move
patchfile = w107_25_mbf_move
- commit revision 1329
The bulk of the MBF TOUCHY, BOUNCES, FRIEND code.
MBF movement and enemy interactions.

*** W107_mbf_lines
patchfile = w107_26_mbf_lines
- commit revision 1330
MBF linedef and switch changes.

*** W107_mbf_sound
patchfile = w107_27_mbf_sound
- commit revision 1331
Added mbf DOG sounds.

Removed the degenmobj being used for sector sounds.
The previous code was casting the sector degenmobj as an mobj in order
to use the x,y,z position.  However, mobj specific tests were then being
done in the sound functions on fields that are not present in a sector.
Made separate calls for sector, mobj, and plain sounds.
The position of the sector and mobj is passed as an xyz_t ptr.
This only requires that the sector x,y,z and the mobj x,y,z be
structured the same.
The mobj is passed separatly so that its attributes can be accessed for
mobj specific tests.

*** W107_boom_PP
patchfile = w107_28_boom_PP
- commit revision 1332
Change P_Random calls that PrBoom has with a parameter to PP_Random
calls that include that parameter.  At this time this only documents
the Boom P_Random parameter and is implemented as a plain P_Random call.

*** W107_boom_physics
patchfile = w107_29_boom_physics
- commit revision 1333
Add support for Boom effects.
Document the Boom comp flags better, as we implement them (if).
EN_boom_physics : previous enabled as EN_boom, are now sensitive to comp.
EN_skull_bounce_floor : Boom skull bounce comp.
EN_blazing_double_sound : Boom comp, just easier to implement than work around.
EN_doorlight : A Boom comp, but affects an MBF light effect.

*** W107_mbf_light
patchfile = w107_30_mbf_light
- commit revision 1334
Opening doors generate the MBF gradual light effect.

*** W107_mbf_telefrag
patchfile = w107_31_mbf_telefrag
- commit revision 1335
Implement the MBF telefrag which expands the determination of who
can telefrag to include Bosses on any map.

*** W107_mbf_func
patchfile = w107_32_mbf_func
- commit revision 1336
Implement the MBF codepointers, somewhat altered.
Mostly copied over from MBF and PrBoom.

*** W107_EN_legacy
patchfile = w107_33_legacy
- commit revision 1337
Add the EV_legacy control var.  It holds the legacy version (demoversion)
only when in Legacy mode, such as playing Heretic, or a Legacy demo.
When playing a Vanilla demo, or Boom demo, or MBF demo, it is 0.
This makes it easier to use in tests for Legacy demoversion.
Many demoversion tests such as  (demoversion > 132)  are being
triggered for Boom and MBF demos too (which have demoversion 200 .. 203).
A test such as  (EV_legacy > 132)  will not trigger for Boom or MBF demos.

*** W107_boom_skymap
patchfile = w107_34_boom_skymap
- commit revision 1338
Add the Boom comp_skymap with a control, as cv_invul_skymap.
The Boom fix makes the sky change with invulnerability.
Add the Boom comp_zerotags with a control, as cv_zerotags.
This prevents many linedef from using a sector TAG that is 0.

*** W107_menu
patchfile = w107_35_menu
- commit revision 1339
Revised the menu system due to more menus and complicated menu paths.
Change from a static prevMenu to a menu stack, with push and pop.
With multiple ways of getting to a menu, more menus would need to save
the previous menu.  It was possible in the prevMenu system to create a
prevMenu loop and lock up the program.
This fixes the problems with escaping a menu back to the wrong menu.
Added the Boom and MBF menu controls, creating a new options page.

*** W107_boom3
patchfile = w107_36_boom3
- commit revision 1340
More boom patches concerning comp flags.
Many of these control existing fixes in DoomLegacy.
EN_catch_respawn_0: enables the fix for (0,0) respawn.
EN_invul_god: enables the fix to make god mode impervious to damage.
EN_boom_physics: enables some boom physic differences
EN_boom_floor: enables some fixes to limit movement of lift ceilings
  and floors.
EN_skull_limit: enables removing the skull limit
EN_old_pain_spawn: enables the fix to where spawning skulls are allowed

*** W107_gravity
patchfile = w107_37_gravity
- commit revision 1341
Combine the DoomLegacy monster gravity control with the Boom comp and
MBF felldown.

*** W107_sight
patchfile = w107_38_sight
- commit revision 1342
Revise some of the monster sight functions to get better compatibility with
Boom and MBF, and to take advantage of improvements.

*** W107_mbf_unstuck
patchfile = w107_39_mbf_unstuck
- commit revision 1343
Add the MBF unstuck code.
Adjust the MBF dropoff code.
Fix an MBF demosync bug fix.

*** W107_mbf_move_bug
patchfile = w107_40_mbf_move_bug
- commit revision 1344
Fix a bug in mbf move code.
This fixes the monsters that stood around after killing another monster.
Change mbf P_SetTarget to P_SetReference, which is a now a nop, and
let each routine set its own target ptrs.
Update to some other code changes that were made during the search for
the bug.

*** W107_mbf_deh
patchfile = w107_41_mbf_deh
- commit revision 1345
Add MBF code pointers and dehacked flags support.
Add the MBF A_KeepChasing code pointer as defined by EnternityEngine.
Add parm1 and parm2 support in DEH, as used by MBF.
Param syntax is
 Unknown 1 = <value>
 Unknown 2 = <value>
Add [HELPER] section in BEX, as used in PrBoom, to define an alternative
to the DOGS to be the player friend.
Syntax is
   [HELPER]
   TYPE = 43

*** W107_fixes4
patchfile = w107_42_fixes4
- commit revision 1346
Misc. small fixes, mostly MBF related.
Change default values for some mbf controls.
Moved call of AddThinker to appear after setting a critical field.
Rearranged the player slide and bounces code.
From PrBoom, no oof when dead.
Added checks and error handling on level load functions.

*** W107_deh_translate
patchfile = w107_43_deh_trans
- commit revision 1347
Fix the dehacked state pointers so that the standard state values
are translated to the DoomLegacy internal state indexes.
This will allow Heretic DEH patches to work, and is
necessary for the MBF DOG states to be found by DEH.

*** W107_mbf_dogs
patchfile = w107_44_mbf_dogs
- commit revision 1348
Added the MBF dogs codes.
Added the MBF dogs sound names.
MBF and PrBoom only have dogs for single player.
In DoomLegacy they also can be used in coop games, and will respawn.
The respawn delay is fixed at 5 seconds.

*** W107_nosync
patchfile = w107_45_nosync
- commit revision 1349
This code is disabled by ifdef.
Elaborate code from PrBoom that keeps demo sync.

*** W107_savegame
patchfile = w107_46_savegame
- commit revision 1350
Update the savegame code to also save the new MBF fields.
Am maintaining the old structures for reading old savegames.

*** W107_tag
patchfile = w107_47_tag
- commit revision 1351
Make a type for the tag values which is uint16_t.
This affects the savegame, but am maintaining the old structures
for reading old savegames.

*** W107_playergibs
patchfile = w107_48_playergibs
- commit revision 1352
Fix P_DamageMobj to allow player gibs again.
Reported by Eckert.

Moved the voodoo intercept of damage earlier so that the tests
on armor and attributes are done on the voodoo redirected target.

*** W107_heretic_deh
patchfile = w107_49_heretic_deh
- commit revision 1353
Include some code pointers for heretic DEH, from EternityEngine.

*** W107_mbf_state
patchfile = w107_50_mbf_state
- commit revision 1354
Fix the MBF function, RandomState, to use the DEH state translation.
This is similar to an EternityEngine fix.

*** W107_numname
patchfile = w107_51_numname
- commit revision 1355
Use numerical_name to search for flats.

*** W107_hexen_detect
patchfile = w107_52_hexen_detect
- commit revision 1356
Detect Hexen wads, and issue an appropriate hud message.

*** W107_skins
patchfile = w107_53_skins
- commit revision 1357
Improvements to the skin selection menu, for player1 and player2.
Fix the menu so that it no long segfaults on overly large skins
(such as "war" from Skins.wad, which has 125 skins).
This required a new draw function, V_DrawMappedPatch_Box,
which has a clipping box.
Change the menu to use the skin name and not the skin indexes
as the skin selection choice.
Change the way that the skin choices are updated to the network.
Improve the skin setting functions to support this.
Make the skins storage dynamic, with a maximum of 128 skins.

*** W107_no_net
patchfile = w107_54_no_net
- commit revision 1358
Make the network XCMD so that when the network is not connected
it will flush the XCMD buffer instead of generating
an error message.  There is no point in saving stale XCMD
in the buffer.  The name, skin, and color of the player
will be updated when the connect.

*** W107_sprite_rot16
patchfile = w107_55_sprite_rot16
- commit revision 1359
Sprites can now have 16 rotation positions.
This uses a naming system in use by EDGE2 (3DGE).
The normal 8 positions still apply (1,2,3,4,5,6,7,8).
It adds 8 more positions between the existing 8 rotation positions.
The 16 positions are (1,8,2,9,3,A,4,B,5,C,6,D,7,E,8,F).

*** W107_corpse_color
patchfile = w107_56_corpse_color
- commit revision 1360
Fix bug from the W107_color_TRAN patch.
In OpenGL, the corpse color was black due to a missed change
to using thing->tflags for color translation.

*** W107_initnames
patchfile = w107_57_initnames
- commit revision 1361
Rename functions with Init, Clear, Create, Load, Setup, so
read clearer.  Get away from the run-together name syntax.
Fix P_Setup_LevelSky to call R_TextureNumForName in only one place,
and add one safety test.

*** W107_texname
patchfile = w107_58_texname
- commit revision 1362
Add a test to exclude texture names that start with '#' (which
are used for parameters) from error messages about textures
not found.

*** W107_patch_width
patchfile = w107_59_patch_width
- commit revision 1363
Modify access to patch fields where the patch might be a patch_t
or a MipPatch_t (hardware draw).  In such places run the patch
access through the function V_patch(p), which returns a patch
field compatible structure when given MipPatch_t.
For now this function is a dummy, because the patch_t and MipPatch_t
have identical patch width, height, topoffset, and leftoffset fields.
This identifies where there are going to be problems if this
should ever change.

*** W107_svn_fix
patchfile = w107_60_svn_fix
- commit revision 1364
Fix of p_enemy compilation errors, discovered by Adam Stylinski.
Comparison of SVN to my current working directory showed significant
differences.  I do not know where or when this occured.
I generated a patch to cover all the differences,
which were extensive.  Most were indenting.

*** W107_TRAN
patchfile = w107_61_TRAN
- commit revision 1365
Comments and brackets, to clarify problems discovered by
Adam Stylinkski.

*** W107_patch_list
patchfile = w107_62_patch_list
- commit revision 1366
Make functions for handling patch lists.
These allow simpler loading and release of patches.
Some simplifications in wi_stuff, st_stuff, and sb_bar.

*** W107_ifdef_enum
patchfile = w107_63_ifdef_enum
- commit revision 1367
Fix of #ifdef tests of enum constants, discovered by Adam Stylinski.
This includes MFT_TRANSSHIFT, dehacked constants, NUMSTATES, etc..
Compilers like gcc, will not see the constant when it is in a #ifdef,
and will test it as a value 0, instead of generating a warning or error.

Enabled compiler flag -Wundef to detect these during debug compiles,
or when PARANOIA is enabled.
Example> make DEBUG=1

Removed the MFT_TRANSSHIFT compile-time test.  Instead included some
PARANOIA tests that detect inconsistencies in the values.

*** W107_const_char
patchfile = w107_64_const_char
- commit revision 1368
Compiled with the -Wwrite-string flag to detect problems.
Change many function parameters from char* to const char*.
Fixed some functions to not modify their string parameters.

*** W107_netid
patchfile = w107_65_netid
- commit revision 1369
Compute netid as unit16_t (instead of unsigned short)
to prevent machine differences.

*** W107_hu
patchfile = w107_66_hu
- commit revision 1370
Split hu init into load graphics, release graphics,
and register functions.

*** W107_cv
patchfile = w107_67_cv
- commit revision 1371
Set command line values into cv variables directly using a new function
CV_SetParam, instead of through console command lines.  Values set using
CV_SetParam are temporary, only setting EV (and value for some cv), but
not changing the string which is saved as the user config.
Sending NETVAL to other machines, and saving NETVAR in savegame, also
do not change the user config in the cv string.  They set EV as a
temporary value instead.  Starting a game via Display Title function
resets all these values to the user config value.

This stops savegames and netgames from changing the saved user config.

*** W107_demo_cv
patchfile = w107_68_demo_cv
- commit revision 1372
Add respawnmonstertime and itemrespawntime to be saved in the demo.
Fixed the demo playback to not duplicate the .lmp extension.
Cleanup some other demo specific code.

*** W107_show_cvar
patchfile = w107_69_show_cvar
- commit revision 1373
Also show temporary values of variables on the console.
Depends upon CV_STRING, CV_VALUE, and EV values.
This makes it possible to see both user settings and param settings.
Testing shows that bug 0136 had been fixed at some point.

*** W107_textcmd
patchfile = w107_70_textcmd
- commit revision 1374
Update network version to 24.  Some changes make the new network
code incompatible.

Added the PT_ACKS message type, which moves some of the existing
PT_ message types.  Message acks had been using the PT_NOTHING message
type.  This resolves a long standing FIXME.
Added 3 more dummy message codes to avoid having to move codes again
if a priority message type needs to be added later.

Reworked the textcmd record formats and code to fix suspected faults.
Gave the textcmd a specific format (textbuf_t), with an explicit
length field.  This removes the odd usage of the first text byte as
the text length.  The text buffer indexing got simpler and much
easier to understand.
Made all textcmd storage use the textbuf_t record type.
Fixed the code to use the length field explicitly.
Fixed tests against the buffer length.
Changed MAXTEXTCMD from 256 to 255, as 256 is impossible to represent
in a 1 byte length field.
The textbuf_t format has room for an additional 0 byte termination
to protect against malicious packets.

Changed other XCmd that used the textbuf as a raw byte buffer
to use the byte_pak_t record format instead.
This does not actually change the packet content but makes
examination and debugging easier.

The PT_SERVERREFUSE message uses a stringpak_t record type.

Made the PT_REQUESTFILE message send multiple messages when the
needed file names get too long, too avoid overrunning the buffer
or aborting.

Changed all packet record formats to have conforming type names,
such as serverconfig_pak_t.

*** W107_version_147
patchfile = w107_71_version_147
- commit revision 1375
Update VERSION to  147.1.
This is not the release yet, but it is too difficult to deal
with changes in the savegame format without bumping the version.
Can still read version 146 savegames.

*** W107_save147
patchfile = w107_72_save147
- commit revision 1376
Update the savegame writing to VERSION 147.
This not all the changes yet for the savegame VERSION 147.
Add a netgame samegame header.
Fix problem of netgames reading savegame in wrong format.
This was triggering a consistency failure in network games.
There is savegame read setup done in the savegame header read.

*** W107_sock_port
patchfile = w107_73_sock_port
- commit revision 1377
Make the alternate client sock port work.
Give the client some alternate sock port addresses and let
the client search for one that is not in use.
The server will use whatever sock port the client uses to connect.
This allows two clients, or a server and client, to use the
same computer and internet stack.

*** W107_state
patchfile = w107_74_state
- commit revision 1378
Add a PT_STATE message, which updates the tick, P_Random index,
and the pause.  Add a broadcast function that the server may
use to send a message to all connected players.
The server will use this state broadcast to pause all players
while a savegame download is performed,
and will update the pause state for the new player.
This allows a player to connect while the server game
is paused, which before would trigger a consistency failure.

*** W107_state
patchfile = w107_75_state_fix
- commit revision 1379
Do not update gametic from PT_STATE message.
Better error handling in the PT_STATE message handler.
Fix an #if NET_NODE_DEBUG, in i_tcp.c.

*** W107_version147
patchfile = w107_76_version147
- commit revision 1380
Remove some old testing setups for VERSION147.

*** W107_correction
patchfile = w107_77_correction
- commit revision 1381
Some previous patches were incomplete.
Repeat: Fix an #if NET_NODE_DEBUG, in i_tcp.c, from w107_75_state_fix
Repeat: Changes in wi_stuff.c from w107_66_hu.

*** W107_buffers
patchfile = w107_78_buffers
- commit revision 1382
From Adam Stylinski.  His compiler reports that some buffers
may be exceeded.  These are temp buffers, just make them longer.

*** W107_release_patches
patchfile = w107_79_release_patches
- commit revision 1383
Got segfault when unexpected exit, such as going to Launcher.
New code for releasing patches, was releasing patches that were not loaded.
This also may have been cause of problem found by Adam Stylinski.

*** W107_reset_freelook
patchfile = w107_80_reset_freelook
- commit revision 1384
Reset the freelook when exiting the level, or spawning.
This fixes bug 0643.

*** W107_ANGLE_1_error
patchfile = w107_81_ANGLE_1
- commit revision 1385
The const, ANGLE_1, from Heretic, has a significant round-off error.
Where Heretic used it, like ANGLE_1*10, to get 10 degree spread of
its missiles, it is what they did.
Other uses of it have caused demo sync problems.
This restores the vanilla calculation to P_SpawnMapThing,
and fixes a fragglescript usage of it.

*** W107_search
patchfile = w107_82_search
- commit revision 1386
Check search directories for case where the default dir is
the home directory, or if it contains "Desktop", "Pictures", or "Music"
directories.  If one of these is detected, the default dir
will not be searched.  This is to avoid long searches due
to the depth of wad search, and to avoid searching the users
home directory, or exposing it to wad loading searches.
Fix Bug 0640.

*** W107_command_menu
patchfile = w107_83_command_menu
- commit revision 1387
Add a third page of command key settings menu, and move
some of the misc. keys to the third menu.
Add a settable command key for screenshot.

*** W107_screenshot
patchfile = w107_84_screenshot
- commit revision 1388
General rewrite of the screenshot code.
Added a console control to select compact, full, or PCX, for
screenshot type.  This does not appear in the options menus.
PCX file type is only available with PC_DOS.
The Targa file type is used otherwise for screenshots.
The "compact" setting will save the screen in the closest format
of the drawing (8 bit with colormap, 16 bit, or 24 bit).
The "full" setting will convert to RGB 24 bit Targa format.
The hardware screenshot code has been changed to only get the screen
and to use the common Targa writing code to save it
to the Targa file format.
Fixes bug 0637.

*** W107_downgrade
patchfile = w107_85_downgrade
- commit revision 1389
Many of the EN enables were messed up by demos, and were not being
restored.  Added calls to the StopDemo and kill_demo code, that
restore the gamemode EN default values.
Changed calls of G_Downgrade(VERSION), to D_setup_VERSION(),
where the value of EV_legacy is also restored.
This fixes 2 errors, where could not start a game after a demo, and
an error where an unrecognized demo code was received after a demo.

A demoversion test was blocking autoaim during demos.
Removed the demoversion test, as it duplicated changes to autoaim
in G_Downgrade().

*** W107_add_text
patchfile = w107_86_add_text
- commit revision 1390
Fix uses of COM_BufAddText to have a "\n" termination.
This must be done as one call, otherwise a partial line could
be executed.

*** W107_win32
patchfile = w107_87_win32
- commit revision 1391
Fix some Win32 compile problems.
Uses WSAEADDRINUSE, instead of the unix EADDRINUSE.
MINGW32 does not have the strndup, so had to imitate one.

*** W107_demo1
patchfile = w107_88_demo1
- commit revision 1392
Fix reading boom demo headers and assigning default values to comp flags
read from boom headers.
Created the EN_demotic_109 flag, that enables old demo tic format
reading.
Created the EN_boom_longtic flag, that enables reading boom demos
with a long tic value.
Created the EN_vile_revive_bug comp flag, and allowed it run some old code
that was commented out.
Changed the method of running demos back to the original method, using
the ga_playdemo state flag.  I do not know what the reason for trying to
do it using a console command, but it took more gametics to start the
demo.  It would run the vanilla demos with a wrong gametic value,
and the gametic is used to determine some monster behavior.

*** W107_demo2
patchfile = w107_89_demo2
- commit revision 1393
Some fixes to demo execution due to SyncDebug testing.
Update tm_flags after SetMobjState.
Fix things test for old demos to exit before Legacy fixes.

*** w107_icyslide
patchfile = w107_90_icyslide
- commit revision 1394
Add MBF icy slide logic to HitSlideLine function.

*** w107_heightsec
patchfile = w107_91_heightsec
- commit revision 1395
DoomLegacy uses model sectors instead of heightsec.
Add correct MBF logic for checking model sectors
for hidden players and monsters.
Ensure calculations using player height setting
are done using unsigned int.

*** w107_sarg
patchfile = w107_92_sarg
- commit revision 1396
Had fixed the sleeping sarg bug before.
But Boom has a demo flag for it, and old demos depend upon it
so give it a enable flag that demos can control.

*** w107_xymove
patchfile = w107_93_xymove
- commit revision 1397
Fix P_XYMovement function looping.
Account for odd momentum in movement stepping.
Add Version compatibility test, and add old movement stepping logic
in the loop, for old demos.

Version compatibility test on fix in LookForPlayers.
Old code would look twice, while fix does the stop test properly.

Add EN_doom_movestep_bug to enable old code for Boom demo compatibility.

Version compatibility test on bob slow down.

Add Heretic/Hexen test on WINDTHRUST decoding logic

Fix sight logic when in same sector.  Assumption that could see was
skipping other tests in the function.  Removing the return fixes
demo sync problems too, but have to add compatibility test for
old DoomLegacy demos.

Fix test of model sector in rendering.

Add comments to document Boom and MBF use of functions.

*** w107_intercept
patchfile = w107_94_intercept
- commit revision 1398
Deal with the different P_InterceptVector.
The other cases are separated into their own functions
and disabled.
P_InterceptVector_float
P_InterceptVector_float_debug
P_InterceptVector_64  (64 bit version from PrBoom)
DoomLegacy just uses P_InterceptVector2 due to not
knowing what would be fixed by using any other.

*** w107_democomptic
patchfile = w107_95_democomptic
- commit revision 1399
PrBoom has a demo adapatation called basetic.
This fixes a revenant missile bug in some demos,
by using (gametic - basetic) in the missile effects randomizer.
In DoomLegacy, have implemented demo_comp_tic, which
does the same thing by keeping a valid corrected tic, which
does not run during menus and pauses.
Effectively demo_comp_tic = gametic - basetic.

*** w107_demoname
patchfile = w107_96_demoname
- commit revision 1400
Pass the demo name using a buffer.  Needed for command line demo names.
Fixes a bug introduced with W107_demo1.

*** w107_zone_debug
patchfile = w107_97_zone_debug
- commit revision 1401
Add the verify_Z_Malloc function to aid with zone allocation debugging.
Update the ChangeTag debugging, it was kludgy.

*** w107_release_patch
patchfile = w107_98_release_patch
- commit revision 1402
Fix the release patch utility functions to work with OpenGL.
The hardware renderer returns a patch_t that is fake, and cannot be
passed to ChangeTag nor Z_Free.
Created a workable release function for hardware cache patches.
Created W_release_patch that can handle releasing either.
This fixes some invalid memory ChangeTag (from release patch functions),
when using OpenGL, found by Adam Stylinski

*** w107_surround_sound
patchfile = w107_99_surround_sound
- commit revision 1403, 1404
Fixed problems when surround sound is enabled.  It modified the
seperation in a way that made the volume settings hit the limits.
Changed the separation from an unsigned, with 128 as the center (which
is apparantly what was needed for Allegro), to a 0 center, +/- 127.
This separation is easier to use in calculations.
Intercepted the SURROUND_SEP special value in all the ports, so
it cannot affect the volume calculations.

*** w107_fs_sound
patchfile = w107_100_fs_sound
- commit revision 1405
Fixed segfault when fs sound plays.
Was passing a bad origin ptr.

*** w107_launcher_escape
patchfile = w107_101_launcher_escape
- commit revision 1406
Block the Escape key from exiting the launcher.

*** w107_dm_spawn
patchfile = w107_102_dm_spawn
- commit revision 1407
Add a deathmatch spawn attempt using the scatter_spawn.

*** w107_sprite16_fix
patchfile = w107_103_sprite16_fix
- commit revision 1408
Fix the missing 'G' rotation in the sprite name detection.

*** w107_1.47_docs
patchfile = w107_104_1.47_docs
- commit revision 1409
Docs updated for 1.47, features and bug fixes.

*** w107_Version1472
patchfile = w107_105_Version1472
- commit revision 1410
Release version 1.47.2.

*** w107_linux_x11
patchfile = w107_106_linux_x11
- commit revision 1411
Fix some compile warnings in the linux_x port.

*** w107_linux_x11
patchfile = w107_107_linux_x11
- commit revision 1412
Turn off the DEBUG in linux_x11 sound server.

*** w108_sound
patchfile = w108_1_sound
- commit revision 1413
Fix the sdl sound interface to use the samplerate from
the sound effect header.
Adjust the audio device number of samples for our new sample rate,
like Eternity does.
The added sounds in biowar now sound more reasonable.
This fixes bug 0645, concerning sound sample rate.
About bug 0646, the modifies the buffer size, which was the concern.
Whether an explicit control is needed is still an issue.

*** w108_misc
patchfile = w108_2_misc
- commit revision 1414
Some code indenting, commenting, and some code rearrangement that has
no new code, nor code testing issues.

*** w108_menu
patchfile = w108_3_menu
- commit revision 1415
Rearrange some of the menu code for video modes, in preparation for
using it to alter the drawmode.
These changes should have no net effect, yet.
Some of the video menus have been rearranged.

*** w108_fraggle64
patchfile = w108_4_fraggle64
- commit revision 1416
Fix bug 0647, where it segfaults on a 64 bit machine when playing phobiata.wad.
The fragglescript variable copy was by default using the i field
to copy most variable types, including ptrs.
The i field is int32_t, and when used to copy a 64 bit ptr, will
corrupt it with sign extension.
Changed the routine to copy using the mobj ptr field, which will
do a full 64 bit copy on 64 bit machines, and does not sign extend.

*** w108_lumpnum
patchfile = w108_5_lumpnum
- commit revision 1417
Regularize the use of lumpnum_t, LUMPNUM(), and WADFILENUM(), in
the general code.  These hide the mechanism that packs the wad
number and lump number into one.
Use NO_LUMP as the value returned when a lump is not found (instead of -1).
Use VALID_LUMP() as the test, replacing all lumpnum tests.
This allows changing the representation, and determining how it meets the
needs from one place.
Changed lumpnum_t from unsigned to signed, so as to prevent triggering
a bunch of errors on any old lumpnum usage that escaped this patch.
This makes it easier to read what the code does, and makes all
the individual lump handling code less hacky.
Fixed some of the most hacky routines to use the lumpnum properly.
This may have fixed some bugs, especially those where lumps could not
be found if they were not in the first wad file.

*** w108_hwrpatch
patchfile = w108_6_hwrpatch
- commit revision 1418
Create HWR_patchstore variable to record that the patches
are stored using the hardware_render method.
This is important when we try to release them.

*** w108_lumpnum2
patchfile = w108_7_lumpnum2
- commit revision 1419
More lumpnum_t usages converted to using lumpnum_t and VALID_LUMP().
Some functions rewritten as cleanup, with almost identical operation.

*** w108_flatanim
patchfile = w108_8_flatanim
- commit revision 1420
Fix usage of lumpnum in the flat animations.  It uses a tricky addition
to the lumpnum that is dependent upon the lumpnum representation.
Convert back to having flat animation information in the animation
structure, instead of in the individual flat items in levelflats.
This gives better locality of reference during the drawing phases,
and isolates the flat animation to specific structures.
Added many additional sanity checks.
Added a function to release structures, which may fix a memory leak.
Left in a fixed up version of the levelflats animation, (disabled) just in case.

*** w108_v1473
patchfile = w108_9_v1473
- commit revision 1421
Bump version to 1.47.3 due to significant operation changes in the
next series of patches.

*** w108_unload
patchfile = w108_10_unload
- commit revision 1422
General cleanup of releasing patches, flats, and textures, so that
they can be unloaded when drawmode is changed.
More uses and tests of lumpnum_t found.
Fixed sloppy handling of colormap allocation.  It now uses
PU_COLORMAP, and has a release function.
Initialize the colormap structures properly.
Moved some of the cv_ switch registration around to put them
where they would be naturally found and already have visibility.
Fixed the CV_Set to not fault when string is NULL.  This can happen
when one cv_ switch changes another switch that is not registered yet.

*** w108_vid_driver
patchfile = w108_11_vid_driver
- commit revision 1423
Change the video driver interfaces to faciliate changing the drawmode
and rendermode from the menus.
Create a cv_drawmode variable for the config file.

New drawmode_recalc and rendermode_recalc variables have been added.
This will allow code to update patches, and other rendermode dependent data.
The video driver no longer handles command line parameters, such as
highcolor and truecolor, which are now handled in d_main common code.
A new drawmode enum that handles the new interfaces has been created.

The I_StartupGraphics video driver function will now report the
native bpp, which can be used for the native drawmode.
The V_CanDraw functions reports if the drawmode software is present
in DoomLegacy (where it is optional).
The VID_Query_Modelist video driver function reports if a drawmode
has any valid modes.
The V_switch_drawmode function will use these to activate a drawmode,
or reject it.  Only this function will change the rendermode,
and will flat that the rendermode has changed.
The I_Rendermode_setup video driver function will handle the
changes for rendermode.
The I_RequestFullGraphics video driver function will now return a
status of success or a failure code, instead of trying to find some
kind of default visual.

*** w108_untab
patchfile = w108_12_untab
- commit revision 1424
Remove tabs from r_data, r_draw, etc..

*** w108_colormap
patchfile = w108_13_colormap
- commit revision 1425
Make it possible to update extra_colormap upon change of rendermode.
Initialize the colormap structures properly.
Use the RGBA_t type in the colormap structure, replacing
explicit shift and mask operations.

*** w108_drawmode
patchfile = w108_14_drawmode
- commit revision 1426
Change the cv_drawmode variable from the menu system.
Make the changes to update rendermode dependent data when the
rendermode changes.
Cleanup and update the video mode functions in the menu system.
Change the submenus to use ">>" instead of "..", which is much easier
to see.

*** w108_taglist
patchfile = w108_15_taglist
- commit revision 1427
Old tag hash was buggy, used the sector count as the hash mask,
which could cause segfaults by returning a bad hash,
and could result in only two hash bins being used while all the
other firsttag fields went unused.
Removed firsttag field from sectors and lines.
Created fixed size hash bin tables.
Fixed the hash functions.
More consistent operation, uses less memory, with much better
locality of reference.

*** w108_fogdraw8
patchfile = w108_16_fogdraw8
- commit revision 1428
Corrected the span fog draw for 8bit, which had the
wrong stepping for dark fog.

*** w108_colormap
patchfile = w108_17_colormap
- commit revision 1429
Reviewed and optimized much of the software draw colormap handling.
The colormap selection has been moved outside of the draw loops.
The light intensity mapping has also been moved outside of the draw
loops.
Have regularized much of the colormap handling, which makes it more
consistent.
Eliminated tests that made no difference in the result.  Previous code
had a test if the colormap was NULL before assigning it as a value.
If the dest var used is known to be NULL, then the test is unecessary.
The assignment of NULL is faster than doing the test.
Found some discrepancies which were corrected.
Found some code that could not have worked, and it was repaired.
This may have fixed some bugs.
The issue of precedence when there are multiple colormaps and multiple
sources of FOG information, still remains.

*** w108_chex_deh
patchfile = w108_18_chex_deh
- commit revision 1430
Patch w107_43 to add MBF DEH capability, broke the chex newmaps DEH.
Must bypass frame number translation and allow new states
when the frame number is not recognized.

*** w108_clipping
patchfile = w108_19_clipping
- commit revision 1431
Cleanup and improvement in the sprite clipping.  The orignal Doom
clipping code was repetitive, and inefficient.
Renamed some clipping vars to better reflect their usage.

There are several CLIP3 improvements that are optioned until regression
testing is completed.
CLIP3_TOP and CLIP3_BOT use better initialization values, that also
work with the normal clipping tests.  This eliminates one special test
for each clipping test.
The CLIP3_COMBINED_CLIP eliminates the separate clipping loops, by testing the
clipping values against each other first, and then applying the most severe
clipping value using only one pass through the sprite clipping arrays.

This change also ensures that the normal clipping also limits the sprite draw
to (0, rdraw_viewheight).  Then the additional clipping tests in the
draw functions can be eliminated too.
There is some RANGECHECK code there now, during regression testing.

Found some usage of a fixed point type with 12 bits of fraction.
Gave it a name (HEIGHTFRAC), and some conversion functions.

*** w108_clipfix
patchfile = w108_20_clipfix
- commit revision 1432
Change the way some CLIP2_LIMIT optional tests are conditionally
compiled.  This includes the safety tests during regression testing.

*** w108_vidstat
patchfile = w108_21_vidstat
- commit revision 1433
Add a function to the video drivers, VID_GetMode_Stat().
This returns the video mode width, height, and some other attributes.
Some of the drivers can use it internally.
It is needed for some future enhancements.

Fix the VID_GetModeName code for some of the drivers, to prevent buffer overrun.

Added a missing call to V_Setup_VideoDraw, to prevent segfaults on
early console display.

*** w108_config
patchfile = w108_22_config
- commit revision 1434
Revise the config and cvar code to support a separate config file for
each drawmode.  This supports loading two config files, tracking
which config file each cvar value came from, and saving each cvar
value back to the correct config file.

Each drawmode can have separate settings for video mode, fullscreen,
gamma, and can save any other cvar that has the CV_SAVE flag.

The main config file will be loaded first, and that can load all
the saved cvar.

Based on the drawmode selected, a drawmode config file
will also be loaded, if available.  Each drawmode has a different name
for its config file.  The drawmode config file is optional.
The cvar values in the drawmode config file will push down
and hide the main config file values.

Changing a menu value will change the current cvar value.  That value
will be saved back to the config file that last loaded the cvar value.

The menu interface can also edit which cvar are saved in each config
file.  Entries can be inserted and deleted.
F1 = normal menu
F2 = Main config values only
F3 = Drawmode config values only
F4 = normal menu
INSERT = add the menu item to the config file
DEL = delete the menu item from the config file

Menu entries that are not relevant to the drawmode config, like the control
key assignments, do not have support for insert to the drawmode config
file.

The config files can always be edited using an ordinary editor
to include anything.

*** w108_draw
patchfile = w108_23_draw
- commit revision 1435
General cleanup and renaming of draw code.
Added dm_texturemid, so could remove a hidden save and restore of dc_texturemid.
Renamed some fields of the vissprite, and reorganized it, for better understanding.
No significant change in function.
Added many comments.

*** w108_sofware_corona
patchfile = w108_24_softcorona
- commit revision 1436
Add software draw of coronas.
Add code to draw using a patch of alpha values.
This is the initial code, without changing the hardware draw effects.
The common tables are moved to p_lights.
The menu controls are moved to a new submenu, under effects.

*** w108_pic_dummy
patchfile = w108_25_pic_dummy
- commit revision 1437
Fix error in generation of a dummy pic, which is only
used during a failure in pic generation.

*** w108_printfloat
patchfile = w108_26_printfloat
- commit revision 1438
Limit printing of floats to 4 fraction positions.
The first attempt at this put spaces in the config file.
Fix the cvar reading to handle leading spaces on numbers.

*** w108_corona
patchfile = w108_27_corona
- commit revision 1439
Upgrade the HW corona generation to use the new routines
in the SW corona draw.
This provides a corona type field.

Corona bit enables:
  SPLGT_corona = 0x01  // enable corona draw
  SPLGT_dynamic = 0x02 // enable dynamic light
  
Corona type field:
  SPLT_type_field = 0xF0
  SPLT_unk = 0x00     // plain corona
                      // near and far fadeout
  SPLT_rocket = 0x10  // rocket corona with random flicker
                      // near and far fadeout
  SPLT_lamp = 0x20    // lamp and corona
                      // brighter than plain corona, different size
                      // near and far fadeout
  SPLT_fire = 0x30    // fire and torches, slow flicker
                      // near and far fadeout
                      // 64 generators
  SPLT_light = 0xC0   // a light source without an object
                      // far fadeout
  SPLT_firefly = 0xD0 // blinking firefly
                      // far fadeout
                      // 64 generator phases
  SPLT_random = 0xE0  // random LED
                      // no fadeout
                      // 32 generators
  SPLT_pulse = 0xF0   // slow pulsation
                      // no fadeout
                      // 256 generator phases


The fire, firefly, random, and pulse, support multiple generator states,
so they can draw multiple independent lights, without them being synchronized.
The generator instance is selected using the lower bits of the mobj ptr.

The built-in tables are upgraded to use the new SPLT_fire, and SPLT_lamp.

Added a corona menu control:
  Off: corona off
  Special: draws special coronas.
     Intended for those who don't want the common coronas, but don't
     want to miss out on the wad special effects.
  Most: draws most coronas, selected by distance, specialness, and alpha.
     Intended for those with CPU limitations, who need to limit draws,
     or with wads with an extreme number of lamps.
  Dim: dims some of the coronas
  All: draw all the coronas
  Bright: brighten some of the coronas
  Old: draw the coronas using the old alpha, and no type field.
  

*** w108_draw_alpha
patchfile = w108_28_draw_alpha
- commit revision 1440
Improve the R_DrawAlphaColumn software draw routines with more options,
and ones that are better suited to drawing coronas and fog.
Includes all the software draw modes, including 8 bit palette draw.

Some of the new draw alpha options will be used for things such as fog
draw.

The R_DrawAlphaColumn routines draw a patch that consists of alpha values,
using the dr_color.
The new alpha draw options only have effect with R_DrawAlphaColumn.

dr_color: the color to be drawn
dr_alpha: the overall alpha due to distance, and effects.
dr_alpha_background: a separate alpha for the background.
  This produces a darkening around the draw.
  Fades the background, for simulating fog or light scattering effects
  of a physical medium.

dr_alpha_mode:
  0: Alpha blend.
    Draw dr_color with alpha of (patch_alpha * dr_alpha)
    Background alpha of (255 - (patch_alpha * dr_alpha))
  1: Alpha blend with constant background alpha
    Draw dr_color with alpha of (patch_alpha * dr_alpha)
    Background alpha is  dr_alpha_background.
  2: Additive Alpha
    Adds to the current pixel.
    Draw dr_color with alpha of (patch_alpha * dr_alpha * (255 - current_pixel))
    The fast compromise, but has reduced effect over bright backgrounds.
  3. Additive Alpha with background alpha
    Background is first faded using background alpha.
    Draw dr_color with alpha of (patch_alpha * dr_alpha * (255 - faded_pixel))
  4. Additive Alpha, Limit math
    Adds to the current pixel, limiting each color to 255.
    Draw dr_color with alpha of (patch_alpha * dr_alpha)
    The brightest alpha draw effect, not affected by the background.

Menu control, cv_corona_draw, added, that selects between the
dr_alpha_modes for corona draw.

*** w108_clipfinal
patchfile = w108_29_clipfinal
- commit revision 1444
Keep the CLIP3 conditional code, removing the alternative.
Missed being committed.

*** w108_debugfile
patchfile = w108_30_debugfile
- commit revision 1441
DEBUGFILE conditional code has not been compiled for a long while.
Fix some compile errors.
This was found by Adam Stylinski.
Fixes bug #0650.

*** w108_drawsegs
patchfile = w108_31_drawsegs
- commit revision 1445
Remove the backscale array from the drawsegs and give it a dynamic
allocation.  This reduces the memory usage because most times that
array was not used, and it had to be allocated at MAXVIDWIDTH.
It is now allocated at the actual vid.width.
This will allow the MAXVIDWIDTH to be increased, as requested.

*** w108_modelist
patchfile = w108_32_modelist
- commit revision 1446
Adam Stylinski found that calls to SDL_VideoModeOK were causing
the modelist to be released, causing error messages on the MAC.
The SDL modelist is released by other SDL calls, as some of them
call SDL_ListModes themselves.
Changed the sdl port code to create our vid_modelist as a copy of the
SDL mode information.
This should fix problems that Adam Stylinski was having with
the MAC SDL port.

*** w108_texgen_options
patchfile = w108_33_texgen_options
- commit revision 1447
Keep the GENTEXT conditional code, removing the alternatives.
GENTEXT_REALLOC
GENTEXT_REUSECOL
GENTEXT_BADPATCH_DETECT
Rearrange some of the GenerateTexture code.
Changed a safety test to print a SoftError.

*** w108_NETBSD
patchfile = w108_34_netbsd,
  w108_34_netbsd_make_options_nix,
  w108_34_netbsd_makefile
- commit revision 1448
NETBSD port fixes to the Makefile and network code.
Optioned as NETBSD.
Feature Request 0090: based on code submitted by Michael Bäuerle.

*** w108_textureformat
patchfile = w108_35_textureformat
- commit revision 1449
Update the texture format and support functions.
Fix the creation of picture format.
Allow forcing creation of picture format.
Remove +3 modification of colofs array settings.
Create a run-time texture render structure to hold texture attributes.
Change getcolumn functions to take texren parameter instead of texture
number parameter.

*** w108_deathmatch_skill
patchfile = w108_36_deathmatch_skill
- commit revision 1450
Deathmatch setup issues a text command, that is missing a switch "-",
making the skill setting ignored.
This was discovered by Leonardo Montenegro, support request 0026.

*** w108_heretic_rev
patchfile = w108_37_heretic_rev
- commit revision 1451
Make most of the heretic engine changes reversible, using tables.
This is to support changing game mode from the menu, but is incomplete yet.

*** w108_coop
patchfile = w108_38_coop
- commit revision 1452
Improve the deathmatch/coop menu selections.
The Deathmatch settings are now:
Coop_SP_Map: Play coop using the single player map, items, and monsters.
Coop_60: Play coop, but the strong monsters added for coop are reduced.
Coop_80: Play coop, but the strong monsters added for coop are reduced.
Coop: Play coop, using the respawn settings in the game options menu.
Coop_weapons: Play coop, using the deathmatch weapon respawn (orig coop).
DM: Play Deathmatch, using the respawn settings in the game options menu.
DM_weapons: Play Deathmatch, respawn weapons (orig Deathmatch 1).
DM_items: Play Deathmatch, respawn items (orig Deathmatch 2).
DM_both: Play Deathmatch, respawn items and weapons (orig Deathmatch 3).

Respawn weapons now works for Heretic too.

*** w108_bot_menu
patchfile = w108_39_bot_menu
- commit revision 1453
Added a bot menu setting to the deathmatch menu, FeatureRequest 0092.
Bot behavior is still not the best.  They will not back off.

*** w108_erandom
patchfile = w108_40_erandom
- commit revision 1454
Add the E_Random support.
E_Random returns a 16 bit unsigned random number, from a very long
period random number generator.
This is needed for random graphics generation because the short
period random number generaters show patterns in the graphics.

*** w108_draw8_alpha
patchfile = w108_41_draw8_alpha
- commit revision 1455
The draw8 implementation of the additive_alpha draw was
missing the add to the current screen value.
This created a dark circle for the corona.
The color12_to_8 table was missing the last entry (defined as [0xFFF]).
An addition that resulted in color (0xF0,0xF0,0xF0) or brighter got 0 from the table.
This fixes bug 0652.

*** w108_BE_SWAP16
patchfile = w108_42_BE_SWAP16
- commit revision 1456
The LE_SWAP16 returns a signed 16 bit on big-endian machines.
In some uses this is getting sign-extended into a large number.
Michael Bauerle reported that this happens when loading the blockmap on
a large wad, preacher.wad, using a big-endian machine.
This fixes bug 0653.

*** w108_148
patchfile = w108_43_148
- commit revision 1457
Version 1.48.0.
Too many features that may need version detection.

*** w108_bots
patchfile = w108_44_bots
- commit revision 1458
Overhaul of bot code.
Cleaned up the bot names, created some more.
Created a new name/color randomizer, the orignal had bugs.
Added controls for bot skill, bot speed, bot respawn time, and bot random number.
This is not compatible with previous bots that may be in saved demos.
I am hoping that there are no bot demos that are important.

Some of the bot skill selections affect all bots, but the rand bot skills
gives each individual bot an independent skill setting.
The game selections make the skill dependent upon the game skill setting.

Bot skill:
  0:crippled
  1:baby
  2:easy
  3:medium
  4:hard
  5:nightmare
  6:randmed   (random 0 to gameskill-1)
  7:randgame  (random 1 to gameskill)
  8:gamemed   (use gameskill-1 setting)
  9:gameskill (use gameskill setting)

Some of the bot speed selections affect all bots, but the botskill
selection makes the bot speed dependent upon the individual bot skill.
The game selections make the speed dependent upon the game skill setting.

Bot speed:
  0:walk
  1:trainer
  2:slow
  3:medium
  4:fast
  5:run
  8:gamemed    (dependent upon gameskill-1, speed=0..4)
  9:gameskill  (dependent upon gameskill, speed=1..5)
  10:botskill  (dependent upon bot skill, speed=0..5)

Bot random number sets the bot random number generator index, and
selects the bot name and color.

Added some code to stop bots from obsessing over things they cannot
reach.  Added code to regulate bots attacking barrels.
This is still a work-in-progress, and there will be furthur
significant changes to bots.

*** w108_hardskill
patchfile = w108_45_hardskill
- commit revision 1459
A new table for skill levels had a bad entry for the hard skill level.
This fixes bug 0xxx (not entered yet).

*** w108_blockmap
patchfile = w108_46_blockmap
- commit revision 1460
Loading strg.wad Map20 would fail due to blockmap overflow.
The previous blockmap overflow detection failed due to blockmap
compression by zennode.  It will reuse an empty blocklist that it
put as the first blockmap list.  This compression also puts some
of the other blockmap lists out of order, making the nearby test fail.
The new code will check for reuse of the first list, then try
blockmap overflow correction.
If that fails it will find the 0xFFFF at the end of a list, and
the 0 at the beginning of the next list.
This fixes bug 0654.

*** w108_autoexec
patchfile = w108_47_autoexec
- commit revision 1461
DoomLegacy may be installed local or in system directory.
Feature Request 93 by Leonardo Montenegro.
There may be a local autoexec, and/or a system autoexec.
Standard Linux behavior: local preferred, chain to system file.
If file  (~/.doomlegacy/autoexec.cfg) is present, it is executed, otherwise
the autoexec.cfg with the executable is executed.
The local file can exec the system autoexec file when preferable
(exec autoexec.cfg).

*** w108_bot_gen
patchfile = w108_49_bot_gen
- commit revision 1462
Improve the Bot generation options.
Create a bot random number that is persistent in config.
Create options for bot generation, using B_Random, E_Random, Random Seed,
Config Random, and System Random.

Fix the bot generation duplicate name detection.
Make the bot generation color selection use all colors before repeating.
Add bot skins, and a bot skin control to the menu.

*** w108_skygen
patchfile = w108_49_skygen
- commit revision 1463
Alternatives to the sky stretch, for normal sized sky textures.
This is a work-in-progress.  Wanted to get it into the 1.48 release,
even though it is not polished yet.  It is still better than always stretch.

Sky gen control:
0: auto   Will look for a replacement sky first, then will make best choice, which is usually extend_bg.
1: subst  Will use a replacement sky. (not fully implemented yet)
10: bg_stars   Extend the sky, replace all of background with stars.
11: extend_stars   Extend the sky, replace missing background with stars.
12: extend_bg      Extend the sky, fill with background color.
13: extend_fill    Extend the sky, fill with random samples.
250: stretch       Stretch the sky to fit.

This only affects Software Render yet.
The Hardware Render (OpenGL) still stretches the sky.

*** w108_texture_get_patch
patchfile = w108_50_texture_get_patch
- commit revision 1464
The SkyGen needs to generate the texture before it extends it.
This fails with OpenGL, because of the tricks with the hardware render cache.
Fix R_GenerateTexture to only get the ordinary texture patches.

*** w108_keynames
patchfile = w108_51_keynames
- commit revision 1465
Change some of the KEY_x names, to a more reasonable pattern.
KEY_2MOUSE ==> KEY_MOUSE2
KEY_DBLMOUSE1 ==> KEY_MOUSE1DBL

Simplify the key name descriptions that appear in the menu.
"2nd mouse b 2" ==>  "mouse2 b2"
It is now (Device, button, action).
Actions like double_click are appended on the end.

Fix the double click detection code.
Provide a double click control, to adjust the detection.

This affects saved config file controller assignments, for mouse2.
Will have to re-enter them.

*** w108_gamepad
patchfile = w108_52_gamepad
- commit revision 1466
Extend the joystick key definitions to handle gamepad, like the XBOX style gamepad.
This has two joysticks, 10 buttons, and 2 triggers.
Added joystick/gamepad controls that can be defined (menuesc, pause, automap).
Detect some of the gamepad keys for menus, game start, and other necessary operations.
This allows using a gamepad without a keyboard,
for vanilla Doom and Heretic maps at least.
Feature Request 93: contains code submitted by Leonardo Montenegro.

*** w108_setrandom
patchfile = w108_53_setrandom
- commit revision 1467
Get and Set functions for P_Random, B_Random, and E_Random.
Rename to be like:  P_Rand_SetIndex();

*** w108_network
patchfile = w108_54_network
- commit revision 1468
Network version 25.
Include B_Random and E_Random in the SV_Send_State message.
This changes some message formating.
Fix the message for Server Refuse Connection, to be shorter,
so it will display properly at the client.

*** w108_savegame
patchfile = w108_55_savegame
- commit revision 1469
Savegame changes for version 1.48.
Include the B_Random and E_Random in the savegame.

*** w108_botnet
patchfile = w108_56_botnet
- commit revision 1470
Prevent problems by updating the network when the B_Random
is altered by bot random number settings.
The bots seem to work in COOP network play now, but not deathmatch.

*** w108_minmax
patchfile = w108_57_minmax
- commit revision 1471
Fix compile on WIN32.
The file that originally defined MAXINT is obsolete.
Change uses of MAXINT to INT_MAX, MININT to INT_MIN, and MAXSHORT to
SHRT_MAX.

*** w108_starsky
patchfile = w108_58_starsky
- commit revision 1472
Fix starry sky generation to handle wads with clouds in the sky.
Make a better sky sampling routine.
Fix sky wrap to handle sky where a horz row is all the same color
(eventual segfault).
Improve the embebedded sky blob handling.
Fixes BUG 0656.

*** w108_swap16
patchfile = w108_59_swap16
- commit revision 1473
Hunt down some LE_SWAP16 that need to be unsigned.
Attempting to fix BUG 0633.

*** w108_help
patchfile = w108_60_help
- commit revision 1474
Add help categories, so that it shows commands specific to the category.
This avoids overflowing the screen, which was not helpful.

*** w108_cvar_call
patchfile = w108_61_cvar_call
- commit revision 1475
The cvar set functions needed to be fixed so that the CV_CALL was
performed when needed.
Added another config push level, to handle netvars in multiplayer games.

*** w108_netvar_read
patchfile = w108_62_netvar_read
- commit revision 1476
Broke the netvar readback with cvar_call patch.
Messes up netvar on netgames, and savegames.

*** w108_addplayer
patchfile = w108_63_addplayer_read
- commit revision 1477
Create an addplayer function to enforce rules on
finding a player slot.
Add a player_state to hold information on pending player joins.
The previous method did not work with bots joining, as they
do have net nodes.
Create some variables to remove dependence on doomcom.
Make most of doomcom conditional on DOSDOOM.

*** w108_botnet
patchfile = w108_64_botnet
- commit revision 1478
Fix bot create and destroy to work better with network play.
When a bot is created, the server bot info is used, and the client bot
info is ignored.
This does not fix everything, still has some problems.

*** w108_botsave
patchfile = w108_65_botsave
- commit revision 1479
Fix savegames to save bot personal information.
This is used in join netgames.

*** w108_netbyte
patchfile = w108_66_netbyte
- commit revision 1480
Cleanup of some network code.
Use byte vars for byte message fields to avoid sign-extension for big-endian machines.
Better checking of network messages for erroneous fields.

*** w108_pind
patchfile = w108_67_pind
- commit revision 1481
Use pind for player-index, where [0]=main player, and [1]=splitscreen player.
Make structures that are duplicated for the splitscreen player, into an
array indexed by pind.
Make network structures for player1 and player2 into one structure indexed by pind.
Make cv_consvar that exist for both players into an array [2], and
in the code access it by pind.

*** w108_player2
patchfile = w108_68_player2
- commit revision 1482
Add cv_autoaim, cv_crosshair, cv_weaponpref for player2, using pind.
Add a player menu for the consvar that exist for player1 and player2.
Update the network Send for NameColor and Weaponpref.

*** w108_fs_player2
patchfile = w108_69_fs_player2
- commit revision 1483
Update some fragglescript functions that modify the player,
for network and multiplayer.

*** w108_netfil
patchfile = w108_70_netfil
- commit revision 1484
Some cleanup of the network file operations.
Remove grunge and kluges.
Fix some endian problems.
Easier to maintain communication with higher level network operations.

*** w108_progdir
patchfile = w108_71_progdir
- commit revision 1485
Fix segfault of progdir in strcmp, for some operating systems that
fail to return the progdir.
Fixes Bug 00640, again.

*** w108_netstate
patchfile = w108_72_netstate
- commit revision 1486
Revise Network state.
Remove node_in_game, replacing it with nnode_state.
This gives the network server proper tracking of the client network state.
Do not co-mingle this with the client tracking the server state,
because there may be a client on the server.
Remove kluges that were present to work around such situations.
Revise the Client connection state with error and states.
Rewrite the Net_packet_handler and unknown_node_handler,
to use this new state.

*** w108_netstate
patchfile = w108_73_netfunc
- commit revision 1487
Clean up the network functions that had kluges.

*** w108_netbug1
patchfile = w108_74_netbug1
- commit revision 1488
Fix some bugs introduced by the last two network patches.

*** w108_netjoin
patchfile = w108_75_netjoin
- commit revision 1489
Upgrade of network join.
Add controls for client download of files and savegames.
Add controls for server allows download of files and savegames.
Add ability to join game at next game start.
Rewrite much of join functions.
Fix of bug in waitplayer network message handling, missing line.

*** w108_netrepair
patchfile = w108_76_netrepair
- commit revision 1490
Upgrade of network repair.
Add controls for client and server repair control.
Protect the server against misuse of the repair message.
Better network handshakes with client.

*** w108_nettimer
patchfile = w108_77_nettimer
- commit revision 1491
Some network exchanges are better done with the game paused,
and those need a timeout.
A network pause with a timer is added.
It is used for adding a bot, and download of savegames.

*** w108_netcontrol
patchfile = w108_78_netcontrol
- commit revision 1492
Add PT_CONTROL to inform clients of what server has decided.
Use it to fix some problems with client join.
Inform client when its players must wait until next game start,
and when that game starts.
Inform player when it is waiting for game start.

*** w108_nettext
patchfile = w108_79_nettext
- commit revision 1493
Cleanup the NetXCmd and textcmd handling in the
network code.
Replace some of the kluges.
Document the usage of the player[0] text channel for server commands like AddPlayer.
Separate the client and server code.
Separate the textcmd code to a separate function.

*** w108_dnet
patchfile = w108_80_dnet
- commit revision 1494
Cleanup of d_net code.

*** w108_nethash
patchfile = w108_81_nethash
- commit revision 1495
Cleanup network node address hash, so hash is always present.
Use a generic hash as default.

*** w108_netwait
patchfile = w108_82_netwait
- commit revision 1496
Add wait_netplayer function to the network code so that nodes can be
put into pause during download operations that might be long enough
to miss a tic.  Adds a timeout capability, and automatic release of the
pause when all nodes are ready to play.

Add control functions to put a node into a wait_for_game_start state,
and to activate that node during the next intermission.

Add a command to serverconfig so that separate messages do not need to
be sent when putting the joining node into a non-normal state.

*** w108_netdebug
patchfile = w108_83_netdebug
- commit revision 1497
Update some of the network debugging code for the changes to network
message fields, and new message types.

*** w108_netsplit
patchfile = w108_84_netsplit
- commit revision 1498
Simplify the handling of splitplayer changes being passed to the network code.

*** w108_neterrcode
patchfile = w108_85_neterrcode
- commit revision 1499
Upgrade the network error codes to include errors from d_clisrv.
Return this error code from HSendPacket so that callers can distinguish
network errors from wait and retry problems.
Try to handle network congestion in HSendPacket, instead of duplicating
that in every caller.
While network congestion and hitting buffering limits is not a big problem
in modern networks, it was in the older ports.
As long as it CAN return an error, it must be handled,
and it is a nuisance in every HSendPacket usage.

*** w108_netclean
patchfile = w108_86_netclean
- commit revision 1500
Cleanup some of the net code, improved comments.
Add/move some NOS values.
Move some declarations around.
Note that the client node numbering is independent of the sever viewpoint.
Rename severnode, to cl_servernode, because it can only be used by the client.

*** w108_netrepair2
patchfile = w108_87_netrepair2
- commit revision 1501
Replaced some net repair code with common code from other efforts (not
committed yet).  This involves some new message types.

Repair will now repair all players, not just the [0] player of the client.
Provided reporting of any difference, for diagnostic purposes.

It is not that net repair is necessary, as networks don't have that
many errors anymore.  But it is the only diagnostic tool that can tell
us WHY the client is having consistency errors.  Network play is still
having major problems with keeping consistency.  Invoking the network
repair does not seem to fix the problem, thus we need more diagnostic
reporting to identify what is happening.  This diagnostic code will
be left in permantly.

*** w108_angleturn
patchfile = w108_88_angleturn
- commit revision 1502
This option is TICCMD_148, which is now enabled.
The netcode had some flags in the lower bits of angleturn.
These add noise to the angle input, as they were not masked out again.
They also create difficulty in detecting errors in ticcmd net packets.
The ticcmd_t type is already being padded to 8 bytes by the compiler,
so it did not take any more room to add ticflags to the ticcmd.

*** w108_netpad
patchfile = w108_89_netpad
- commit revision 1503
The compiler has been padding the structures used for network packets,
in order to align 16 and 32 bit int fields.
This has resulted in erratic message mangling.
The packet size has often been calculated from expected field sizes,
which did not take into account the added padding.
Simply using the packing attribute did not work, as the Mingw32
compiler seems to ignore it.

All the network packet structures have been manually padded, so
that there will not be any surprises.
Any 16 or 32 bit field has been manually aligned to 4 bytes.
Such 16 and 32 bit fields can only be used in structures when
the structure alignment guarantees their alignment will be maintained.

New types, N16_t and N32_t, have been created, which are unaligned.
They appear to be byte arrays to the compiler so it will
not attempt to align them.  Functions have been created that
will store 16 and 32 bit int values into them, using the best
technique available for the machine, as detected.
This makes this safe, even for a SPARC, which cannot do unaligned
int reads and writes.

Optional, repeated, and other unaligned structures must use only
unaligned types,
which for now are byte, char, N16_t, and N32_t.

*** w108_netxcmd
patchfile = w108_90_netxcmd
- commit revision 1504
Revise the NetXCmd channel structure to accomodate future needs.

NetXCmd are also used by the server, and the server NetXCmd
previously were using the player 0 textcmd channel.
This caused several problems, and required that textcmd channel 0
always be transmitted.

Server NetXCmd now signal themselves, with pind=2, or by using SERVER_PID.
SV_Send_NetXCmd handles server NetXCmd, routing them through the server
functions, directly to the BTIC textcmd buffers.

This now gives the capability of this server channel being used for bots.
There are no local textcmd buffers for bots, so they could not send textcmd.

The player textcmd buffers maintained for each tic, have been combined into one
textcmd buffer for all players, by saving the player number with the textcmd.
The server textcmd use the SERVER_PID player number, so they can be
identified, with additional tests and protections applied.
It being that textcmd are rare, and are simply executed sequentially
anyway, there was no good reason to keep these separate buffers
duplicated for each BTIC.  It was rare for any player to have a
textcmd, and even more rare for one player to have more than one.
Having one combined buffer also simplifed transmitting to clients too.

Demos still will put textcmd using player 0, and this is still supported.

*** w108_namecolor
patchfile = w108_91_namecolor
- commit revision 1505
Expand the NameColor NetXCmd to also include the bots maintained by the
server.  This provides the ability to send a NetXCmd over the server
NetXCmd channel, to update the bot names, color, and skins, in
any client that should join the netgame.
The server now uses this NetXCmd to update the bots in clients, the
same as players.

*** w108_sendtic1
patchfile = w108_92_sendtic1
- commit revision 1506
Make conditional wait_game_start code, using WAIT_GAME_START_INTERMISSION.
Move send and handler code together, for client tic, and sever tic.
Repair mistakes in w108_neterrcode, like some missed HSendPacket calls,
and applying LE_SWAP twice, that made download savegame fail.
Some minor cleanup.

*** w108_sendtic2
patchfile = w108_93_sendtic2
- commit revision 1507
Eliminate special network commands for splitscreen.
This is now handled by the new client ticcmd format.
Revise update_player_count for wider usage.

*** w108_sendtic3
patchfile = w108_94_sendtic3
- commit revision 1508
Eliminate problems with too many ticcmds and textcmds for one packet.
This format can now handle 32 players, without errors.

The Version 1.48 server tic packet format allows it to use multiple packets
to send all ticcmds and all textcmd for the selected tic range.
All of textcmds can be handled in each tic.  They are no longer
limited by the size of a single packet.
Logic for tic range now attempts to limit size to 2 packets worth.
Sequence field allows for a maximum number of 8 sequence packets,
which should be enough.
Each sequence packet can be stored independently of the others,
regardless of packet arrival order.

The new server tic format has a player bit field, directly
indicating within the packet, to which players the ticcmds belong.
This no longer sends ticcmds for players that have dropped from
the game, which reduces the size of packets when there are many players
with some dropping out.

*** w108_netstat
patchfile = w108_95_netstat
- commit revision 1509
Fix display of coop netgame stats.
Previous display used a face (with player colors), which was too large
for the listing, so they overlapped badly.
Moved the face out of the list, and gave it a color bar to identify
the local player.
The coop listings now show the player name and player color, similar to the
deathmatch listings.

*** w108_random1
patchfile = w108_96_random1
- commit revision 1510

Expand the PP_Random usage to include Legacy specific uses of P_Random,
and Heretic uses of P_Random.  Give the P_Random uses names like in PrBoom.
These are only used when the enable is uncommented (such as in
SYNC_DEBUG, or when need to debug P_Random usage).
Legacy uses of P_Random have been identified, and are listed
separately in the enum listing.  Some are marked FIXME, see next patch.
Heretic uses of P_Random use names that start with "ph_".

Some other minor changes to Random debugging were made too.
Included some debugging changes used by SYNC_DEBUG in the mainline code,
for the documentation, and to make general debugging easier.

*** w108_random2
patchfile = w108_97_random2
- commit revision 1511
Fixes uses of P_Random by Legacy specific code to make them
netgame safe.
Uses of P_Random would cause problems in netgames,
when they were enabled by cvar that were not NETVAR, as they would
upset the P_Random sync.

Added a new N_Random, which is not netgame synced, nor demo synced.
This is for uses within Legacy that do not affect game sync.

P_Random cannot be used where it is conditional on a cvar that is
not a NETVAR.

*** w108_itemrespawn
patchfile = w108_98_itemrespawn
- commit revision 1512
The netgame kicking due to consistency has finally been traced back
to an inconsistent cv_itemrespawn.  The deathmatch setup was not
updating the itemrespawn in the client.  Thus after the one player
got an armor and it had respawned, a second player could get the
respawned armor, but the client had not respawned any armor.
When shot, the player died sooner in the client, which had bad side-effects.
Deathmatch code had been relying on cv_itemrespawn being updated due
to being a NETVAR, and that did not work.
Changed the deathmatch setup of itemrespawn to be directly done
in each client.

*** w108_netclean2
patchfile = w108_99_netclean2
- commit revision 1513
Cleanup of minor things throughout network code.
Bring debugging printout up to current network message formating.

*** w108_netgamestart
patchfile = w108_100_netgamestart
- commit revision 1514
Complete some of the WAIT_GAME_START_INTERMISSION stuff.
WAIT_GAME_START_INTERMISSION allows a client to join the game at the
start of the next level.
This avoids needing to download a savegame, which BIG_ENDIAN machines
cannot do on a little endian server, due to savegame endian issues.
Add message PT_SERVERPLAYER, that updates all the player information
for a client joining the game at game start.  The client will create
and remove players to match the indicated player state.
Player health, armor, weapons, and inventory, are sent.
Add message PT_SERVERLEVEL, that updates all the level information
needed to join the game.  This essentially is the same information
that the map command needed.

The Map command does not support the start-game waiting players yet.
After many many failed attempts, it has a warning message now.
The Map command in the server forces it to start game immediately,
preventing using GS_INTERMISSION state.
The clients seem to get stuck in an intermission state,
waiting for the Map command.

*** w108_repair3
patchfile = w108_101_repair3
- commit revision 1515
Make some better messages for repair player.
Move some network message handler tests, to ensure they get executed.
Fix the set_mobj to create proper mobj, and update.

*** w108_docs
patchfile = w108_102_docs
- commit revision 1516

*** w108_v1481
patchfile = w108_103_v1481
- commit revision 1517
Update to rev. 1.48.1.

*** w108_config_v1482
patchfile = w108_104_config
- commit revision 1518
Config file was not being written in new install.  Fixed.
Update to rev. 1.48.2.

*** w108_modeswitch
patchfile = w108_105_modeswitch
- commit revision 1519
Fix some problems during modeswitch, such as a segfault
due to a palette function not being ready to use yet.
Fix uses of HWR_patchstore to be protected by HWRENDER, as that
variable only exists within HWRENDER.

*** w108_config2
patchfile = w108_106_config2
- commit revision 1520
Fix config file loading to properly record when a file has been
loaded, and to clear that indication when the data is cleared,
and when config file names are changed.
Fix the menu instructions for drawmode and video mode, as they
were giving false information.
Add a menu command to create an initial drawmode config file,
and populate it with some initial settings.

*** w108_endtext
patchfile = w108_107_endtext
- commit revision 1521
Implemented fixes proposed by Michael Bauerle for endtext (with
some modifications).
Fix endtext for big-endian (SDL port).
Added UTF8 output for endtest.
Added cv_textout to select between vanilla output and UTF8 output,
because user setups differ.

Add "-noendtext" as command line parameter, to match the docs,
as that is the spelling that the user is likely to use.
The existing "-noendtxt" is left in place for compatibility.

*** w108_not_network_game
patchfile = w108_108_not_network_game
- commit revision 1522
Fixes bug 0660, by Adam Stylinski.
The NE_not_netgame error indication got moved around, and ended up
right after NE_empty.  This error is returned by the Internal_Get function,
which does not get any packets.
It got missed by the check for NE_fail, and the test for NE_empty.
The test for doomcom->remotenode was not adequate too.
Put in all the necessary tests to catch this condition.

*** w108_patch
patchfile = w108_109_patch
- commit revision 1523
Fixes bug 0661, by Adam Stylinski.
Stray semicolon in sky code, removed.
Fixes bug 0662, by Adam Stylinski.
Type conversion after LE_SWAP looks suspicious.
Would need a C Manual, and 3 programmer opinions, to figure out
if it actually does the correct operation.
More trustworthy conversions are used.

*** w108_linux_x11
patchfile = w108_110_linux_x11
- commit revision 1524
Fix some Linux_x11 compile issues.
Linux_x11 is still using OSS sound, and has some compile warnings.

*** w108_opengl
patchfile = w108_111_opengl
- commit revision 1525
Fix the feet-in-ground problem for OpenGL, for drawmode switch.
The original fix did not work when switching drawmode.
It had to be moved from sprite load, to sprite project.

*** w108_v1483
patchfile = w108_112_v1483
- commit revision 1526
Release Version 1.48.3, svn 1526.

*** w108_vid
patchfile = w108_113_vid
- commit revision 1529
The video mode state has turned into a can of worms.
The current code did not pass config width and height
to the port drivers.
Created explicit req_width, req_height parameters into
the port video drivers.
Created a function to pass the config width and height
to the req_width, req_height.
The port drivers are responsible for setting vid.width and vid.height,
along with everything else vid.
Created a new state bit for cv_drawmode, that prevents
the restore_user_settings code from destroying the current setting.
Finally, the drawmode and video mode menus might behave as expected.

*** w108_v1484
patchfile = w108_114_v1484
- commit revision 1530
Release Version 1.48.4, svn 1530.
Current legacy.wad version bumped to 148 (new legacy.wad).
Oldest legacy.wad version it will run with is 145 (current legacy.wad).

*** w108_fullscreen
patchfile = w108_115_fullscreen
- commit revision 1531
Fix config fullscreen implementation.
Add call to pass config fullscreen to video setmode, after allow_fullscreen
gets set.

*** w109_verrev
patchfile = w109_001_verrev
- commit revision 1536
Add recording in demo of version and revision numbers,
and capability of testing revision using VERREV().

*** w109_infight
patchfile = w109_002_infight
- commit revision 1537
DoomLegacy has used PrBoom as a reference, and PrBoom has a test for
monster_infighting in its test for missile invulnerability between
monsters of the same species.
Some other ports (Boom, MBF, eternity engine) do not have the
infight test, so their monsters are always invulnerable to missiles
from their own species.
Add "Full Infight" to monster infighting.
Implement "Full Infight" setting as in PrBoom, with missile damage.
Implement other infight without missile damage.
Fixes BUG 0664.

Add MBF infight logic to A_PosRefire and A_SpidRefire.
This stops firing on friends.

*** w109_demo
patchfile = w109_003_demo
- commit revision 1538
Legacy demo would fail to start due to blocking the textcmd to load
the map.
The Legacy demo was recorded with player 0 issuing the map textcmd.
Player 0 was not in the game yet, and this was detected as
a textcmd from a non-existant player.
The demo needed to use SERVER_ID for textcmd
issued before player 0 is in the game.
Fixed demo read to redirect player 0 demo textcmd to SERVER_ID.
Fixes BUG 0665.

*** w109_demo2
patchfile = w109_004_demo2
- commit revision 1539
During record demo, commands for each player are saved independently.
Most textcmd will be within the 255 provided by an ordinary textbuf.

Ver 1.48 has a very long combined textbuf, containing all players.
Also the commands to create a player are now issued by SERVER_PID,
where in older demos they were issued by player 0, before player 0 existed.
Legacy demo could not be fixed and stay compatible with older formats.

Separating the textcmd into separate players, and appending it again
upon reading is extra work, without any benefit.
SERVER_PID does not have a slot in the demo, nor a way to identify them.
It is also now possible for textcmd to run over 255 bytes, even it would
almost never happen.
Several ways to deal with these problems were considered,
all with flaws, and few actual benefits.

LEGACY 1.48 LONG TEXTCMD FORMAT
Decided to just put all textcmd into the player 0 slot, which is being
used by the demo for server textcmds anyways.  No need to separate
them into individual buffers again.
This textcmd format has a two byte length and has player pid for
each textcmd within it.
There are no format conversions needed this way, and this demo format
is only used for DoomLegacy, not compatible with other ports anyway.
There are few textcmd in a demo, so this probably only costs 8 more bytes
in an actual demo.
The demoversion will be the only control for the demo format.

It uses SERVER_PID in the textcmd to identify server textcmd.
It will get recorded into demos.
Changed the SERVER_PID to 250 now, for future expansion of players.
This fixes bug 0665.

*** w109_moonwalk
patchfile = w109_005_moonwalk
- commit revision 1540
Fixes moonwalk bug, where monsters would sometimes walk backward.
This was due to error in translation of Killough's everything-in-one-expression
to more maintainable code.  He puts assigns in his expressions, with a comma.
There was an assignment in the expression for monster-avoid-hazard,
but it did not have a comma, and the dest needed to be tested too.
This ran the avoid code whenever monster_avoid_hazard was enabled.

Regressed some other code inherited from PrBoom back to something
that can more easily be compared to PrBoom code, for easier maintenance.
Subtle differences might hide other bugs.

*** w109_oof2s
patchfile = w109_006_oof2s
- commit revision 1541
From PrBoom, Killough enhancement.
Make an oof sound when hit a 2s line, just like when hit a 1s line.
PrBoom added a dedicated line search for this,
but I did the 2s line detection in the existing search loop.

*** w109_devmode
patchfile = w109_007_devmode
- commit revision 1542
Make optional, and disabled, some old development hacks.
Option DEVPARM_LOADING:
  Loading development wads from a special directory.
  Also switches  -wart, -devgame (even older -shdev, -regdev, -comdev).
  I doubt anyone remembers how to use it.
Option WADFILE_RELOAD:
  If a filename started with a tilde "~", it was taken as an indication
  to reload the file on every lump access.
  This was to enable leaving doom running while changing wad files.
  Another hack that would no longer be used, due to the loading time
  from disk being faster now.
Option LOADING_DISK_ICON:
  Not implemented in any port anyway.
  This removes the hooks.

*** w109_fullscreen
patchfile = w109_008_fullscreen
- commit revision 1543
The Full Graphics startup was fragile, requiring constant fixing.

Removed mode_fullscreen, an indirect indication of fullscreen, that
existed as a means to apply allow_fullscreen during startup.
Now it modifies cv_fullscreen.EV to do a similar thing. 

Changed allow_fullscreen to be controlled by main code.
Added command line switch "-window" that forces window mode,
as a way to recover from a bad fullscreen video mode.
Video drivers no longer directly block fullscreen.
If one drawmode cannot find modes,
that should not block fullscreen for all drawmodes.
This allows using the Query function to discover what is capable.

Startup Full Graphics is now done by SCR_SetMode, instead of
having a near duplicate of the same code that was repeatedly
a source of bugs. Added a parameter to SCR_SetMode to control
the few differences, init vrs change existing setup.
It now fully starts up the graphics including the draw routines.

Fixed use_font1 to be controlled by the main code, instead of
being buried in a loading function.  This was after chasing
down a setfault (due to whitemap not loaded) when the font
loading got called too soon.  There was a similar problem if
it got called too late.  Now the main code tests the flags
and makes the decision cleanly.

Video startup now changes directly to the config modes,
which is faster and cleaner.  It does not need to do two
intermediate video changes.

A few other cleanups of video code.

*** w109_zip1
patchfile = w109_009_zip1
- commit revision 1544, 1545
Add zip file reading, for Linux only.
It is option ZIPWAD.
This requires lib libzip.
It will load the wad, deh, bex files in a zip archive.
If searching for a file, it will also search in
a zip archive of the same name.
This has not been totally integrated with net play yet.
For other ports, will have to find a libzip.

There is also ZIPWAD_OPTIONAL, which will use dlopen to
optionally load libzip.  The ZIPWAD_OPTIONAL requires lib dlopen.
It detects that libzip is loaded, and enables the zip functionality.
This prevents libzip from being a hard requirement.
It makes lib dlopen a hard requirement, but that is lib that is
normally present.

The libzip before version 1.2 do not have the seek function.
This is detected, and a local version of seek is substituted.
I currently have libzip-1.0.1, so I need this and others may too.

*** w109_deepsea
patchfile = w109_010_deepsea
- commit revision 1546
Recognize and handle DeePsea Tall patches.
Enable with compile option DEEPSEA_TALL_PATCH.
Michael Bauerle submitted a patch, derived from crispy doom,
but that only handled 2 of the 10 places that handle patches.
This fixes the trees and tall sprites of BUG_0663.

It does not fix the violet line in some of the wall textures.
That is also a DeePsea tall patch artifact, but DoomLegacy
wall drawers assume that the patch is one column, so they
do not process patch posts.
Have start fixing that problem, but it is a much more extensive change.

*** w109_deepsea2
patchfile = w109_011_deepsea2
- commit revision 1547
The use of DeePsea patches on walls has made a latent problem to fester.
The DeePsea patche used on walls draw with a violet line, which is the
DeePsea post being drawn as pixels.  The wall drawing routines cannot
handle patches, as they expect monolithic pixel columns.

This requires that the usage be recognized and to GenerateTexture
as a TM_Picture.

Some patches are used both in masked draw and in wall drawing.
They require different texture formats in the cache.
They either thrash, or one of them gets the wrong format.
To handle a texture that requires two different formats, had
to create Extra texren, with a complete allocation system.
This is enabled by option  TEXTURE_RENDER_EXTRA_FULL.
The default will try to use one common texren, and will
thrash if there are too many texture needing to use it.

In a well designed wad, these should not be needed.

The texture_model is removed from the texture,
and only stored in the texren.
Upon a reload, a picture texture_model in the texture
would prevent generating the correct data for masked draw.

*** w109_noblock
patchfile = w109_012_noblock
- commit revision 1548
Bug 0666, Patches by Michael Bauerle.
SunOS does not have FIONBIO ioctrl.
For Linux and SunOS use POSIX fcntl.

An unused function uses "label_t"
which is also undefined, even on SunOS now.
Disable the header declaration.

*** w109_maskedtile
patchfile = w109_013_maskedtile
- commit revision 1549
A large tree in "lost civilization" is a texture which is
not a power of 2 in width.
The masked draw setup selects a tiling width less than the texture width
and tries to tile the draw.  This is noticable for a tree.
Adopt a masked draw column select similar to PrBoom,
which handles negative offset and odd texture widths.
Keep the masked tiling for power-of-2 width textures.

*** w109_ver1486
patchfile = w109_014_ver1486
- commit revision 1550
Update to 1.48.6.
Update docs and make_options.

*** w109_savebuffer
patchfile = w109_015_savebuffer
- commit revision 1553
The SG_Writebuf in P_ArchiveThinkers was misplaced.
Due to continue stmts, it was getting skipped, and the
savebuffer was overrun (Antaresian Reliquary Map04).
Moved SG_Writebuf to top of loop.
Max buffer usage is now 67K, half of savebuffer.
Fixes Bug 0667.

*** w109_skyheight
patchfile = w109_016_skyheight
- commit revision 1554
The sky draw had been passing a fixed_t value of sky height to
the draw functions, which expected an int sky height.
Fixed the sky texture height in the sky setup functions to be an int.

We have been maintaining an old legacy draw function, and
a copy of a Boom draw function.
Combined the inherited Boom drawing code into our draw functions,
and removed the unused draw function.
The draw option is maintained, but it switches a much smaller
chunk of code.

*** w109_highcolormap
patchfile = w109_017_highcolormap
- commit revision 1555
Removed the HIGHCOLORMAP and HICOLORMAP optional code.
It was never completed.
It would have used a large colormap directly to 16, 24, or 32 bit RGB.
This would have used a large amount of cache during drawing, to
only save an additional array lookup.
Keeping the 256 byte colormap lookup in cache is more reasonable.
The current drawing code is working well, and modern processors can
do the extra lookup operation far faster than a main memory access.

*** w109_freedoom
patchfile = w109_018_freedoom
- commit revision 1556
Changed the freedoom wad names, avoiding
doom wad names as that was conflicting with doom2 gamemode.
Freedoom: "freedoom2.wad", "freedoom.wad", and "fdoom2.wad".
Ultimate freedoom: "freedoom1.wad", "freedu.wad", "fdoomu.wad".

*** w109_rangecheck
patchfile = w109_019_rangecheck
- commit revision 1557
Separated the drawing limits rangechecks to  RANGECHECK_DRAW_LIMITS.
These are no longer enabled by default.

Made separate debugging defines in doomdef.h for DEBUG mode, and
for normal compile.  This will better ensure that the debugging
defines get turned off for release code.

*** w109_skypict
patchfile = w109_020_skypict
- commit revision 1558
The software mode sky draw has had line artifacts above and below the sky.
Due to using a patch to draw the sky texture, which is treated
like a wall texture, the artifacts are the post headers being drawn.
This also caused the sky to be misaligned, from what is seen in PrBoom.

Changed the sky to be a TM_picture format, which is suitable for drawing
a wall, as it has no transparent regions.
Updated R_Create_Patch to create TM_picture and other variations.

Limit the sky drawing to the texture, so to not tile the sky draw.
Created a skytop_flat for above the sky, and a ground_flat for below the
sky.  These are drawn when the sky draw exceeds the bounds of the
sky texture.
For now, these flats are created as solid textures.  Any pattern
looks like a wall.

Added a vanilla sky draw mode.

*** w109_gentexture
patchfile = w109_021_gentexture
- commit revision 1559
Make R_GenerateTexture a bit more robust.
Moved common patch tests earlier and shared them for all options.
Moved some common cleanup later and shared it.

*** w109_skypict2
patchfile = w109_022_skypict2
- commit revision 1560
Texture does not always have correct settings.
Set the sky height in texture when 200 or 240 size, so
that it creates the correct size TM_picture.
Previous code got away with this due to a special test in
R_GenerateTexture, that only worked for single patch textures
that are generating a TM_patch.
Fixes bug 0668.

*** w109_overlap
patchfile = w109_023_overlap
- commit revision 1561
Fix the overlapped string copies detected by GCC 10.
Fixes bug 0671, Michael Bauerle.

*** w109_debug
patchfile = w109_024_debug
- commit revision 1562
Straighten out some of the DEBUG compile tests.
Regularize some of the DEBUG tests.
Make LOGMESSAGES work again.

*** w109_oppdir
patchfile = w109_025_oppdir
- commit revision 1563
This fixes bug 0670, Monsters mysteriously disappearing, moving large distances into the void space.

This was caused by a broken calculation to determine the opposite direction.
This bug was introduced in the moonwalk patch (svn 1540) when I copied
the opposite calculation code from PrBoom, in an effort to reduce
differences that might lead to bugs, replacing a table lookup
implementation.  However, the PrBoom calculation must be guarded against
DI_NODIR, which the table implementation could handle inherently.
Without that protection, an olddir of DI_NODIR introduced a direction
of 12 into the logic, which can only handle directions of 0..7, with
NODIR=8.  Several times a game that 12 value would survive long enough
to get used, which would be expressed as a wild walk movement.
Both options were fixed, with the fixed calculation barely winning a speed comparison
over the table lookup, and having a slightly smaller cache impact.

Having monsters escape the play area adversely affects all games played with 1.48.6,
so another release will be scheduled soon.

*** w109_gcc10
patchfile = w109_026_gcc10
- commit revision 1564
Fix compile warnings from GCC10.
Most of these were about using a char as an array index,
because a char could be signed char.

*** w109_blockmap
patchfile = w109_027_blockmap
- commit revision 1565
Fix the blockmap for Lost Civilization wad.
This includes an index referencing a previous linedef list,
which is blockmap compression used by zennode.

*** w109_mouse2
patchfile = w109_028_mouse2
- commit revision 1566
Bug 0669, mouse2 not working.
Found that in sdl for mouse2, code for Linux was commented out,
and code for Windows was missing entirely.
Copied Windows mouse2 code from Win32, and activated the Linux code.
The Windows code was for a PS mouse, and the Linux code was for MS
mouse format.
Rewrote the mouse2 code entirely.
Added support for PS/2 mouse.
It allows the selection of mouse type (PC, MS, PS/2).
Fixed the port selection to have 8bit serial data for MS and PS/2 mice.

Discovered several bugs:
BUG1: Console was receiving event posts from the mouse, and was trying
to interpret the button presses as keypresses.
The event has a key code as data1, and an ASCII code as data2.
The console would enter data2 into the console buffer.
BUG2: Mouse1 code was clearing data2 to 0.  Mouse2 was leaving data
as garbage, which the console was trying to interpret.
BUG3: The joystick code was also leaving data2 as garbage.
These were all fixed, thus keeping mouse keypresses off the console.

*** w109_ver1488
patchfile = w109_029_ver1488
- commit revision 1567
Update to 1.48.8.
Update docs.

*** w109_fullvideo
patchfile = w109_030_fullvideo
- commit revision 1569
Added failure detection for setting drawmode from config file.
If config file drawmode fails then use a window at native bpp.
If that fails, then I_Error out.  In linux_x this used to fail
ungracefully.

Video initialization was changed to use mode tables until
after ReqestFullVideo is completed. The earlier uses of QueryModes
does not initialize the modetables. At least not in the sdl port,
it tests an independent mode table query so that it does not
disturb the mode tables for the current video setup.

Turned off using direct draw in linux_x (draw directly to the XLib buffer).
This worked for my nVidia card, but with my Radeon it segfaults after
a few prints to the console.
Have to investigate more do discover why, or if there are some rules.
May make this a user switch but the test would invite segfaults.

*** w109_x11mouse2
patchfile = w109_031_x_mouse2
- commit revision 1570
Update the linux_x mouse2 code using the new mouse drivers from sdl.
This allows using PC, mousesystems, and PS2 type mice.
The ports that have mouse2 are SDL, WIN32, and X11.

*** w109_gcc10c
patchfile = w109_032_gcc10c
- commit revision 1571
Fixes complaints from Gcc10 about snprintf, and strncpy.
Michael Bauerle worked to find workable solutions.
There needs to be an assign of term 0 after snprintf, and after strncpy.
Gcc10 also complains when truncating a larger buffer into a shorter
buffer using strncpy.
The strncpy solutions are ugly, and tempting to rework again.
To prevent future problems, made a dl_strncpy that does
what is right, does not pad the dest, and always terminates with 0.
Fixes bug 0671.

*** w109_clang
patchfile = w109_033_clang
- commit revision 1572
The Clang compiler caught some mistakes.
A parameter had been changed from boolean to an enum, and had to
use SP_reliable as an input.  The old code probably did work.
It does not like extra parenthesis around a comparision, as they
think that an assign might have been intended.  Not a good check.
Does not like using -1 on an unsigned.
A few places where a char was used, where a glib function
was implemented using tables, so had to use unsigned char.
A bad test was found is the savegame header, where it decided
if fragglescript had to be included in the savegame.
It complains when a printf of a string does not have a format,
for security reasons.
Did not like an assign of a const float value to a int.
Fixes bug 0672.

*** w109_ver1489
patchfile = w109_034_ver1489
- commit revision 1573
Up to 1.48.9, to separate identity.

*** w109_sound1
patchfile = w109_035_sound1
- commit revision 1574
Remove I_SetChannels, as name was misleading.
Moved any table setup to a function setup_mixer_tables().
Created I_SetSfxChannels to pass  cv_numChannels setting
to ports that depend upon it.
Only the X11 port does anything with the setting,
and that may change.
Prepare for X11 sound enhancements with support in the
Makefile.

*** w109_sound2
patchfile = w109_036_sound1
- commit revision 1575
Finish the changes to sound interface in all the ports.

*** w109_zip3
patchfile = w109_037_zip3
- commit revision 1576
The optional libzip support does not use dlopen correctly.
Using dlsym is required.
I don't know why it worked during the test, it should not have.
Also made changes in some names, to meet uniformity goals,
such as enable OPT_LIBZIP.

*** w109_x11sound
patchfile = w109_038_x11sound
- commit revision 1577
Total rewrite of sfx sound for X11 port.
X11 sound only supported OSS sound, and ESD sound.
Added support for ALSA, JACK, and PulseAudio sound.
The make_options must be edited to select which
sound devices are included in the binary.
When there is more than one sound device, a sfx sound device
menu selection is enabled, to choose between the sfx sound devices.
Optional sound devices are also supported.
If a optional device is selected, the library will be detected,
and dynamically loaded.
This allows compiling a distribution that has support for the sound
devices, but does not require the library to be present.
A device that is not optional, must have the device libraries present.

*** w109_x11sound
patchfile = w109_039_sound3
- commit revision 1578
Total rewrite of sfx sound for X11 port continued.
Changes to how OPTIONAL devices are indicated.
Changes to make_options.
Changes to menu support for multiple sound devices.

*** w109_x11sound
patchfile = w109_040_x11sound3
- commit revision 1579
Total rewrite of sfx sound for X11 port continued.
The ALSA sound device driver is included.
A working ALSA music player.
Not quite done debugging yet.
Other devices, like FluidSynth have no code yet.

*** w109_wait99
patchfile = w109_041_wait99
- commit revision 1580
When starting a netgame as server, after having tried to connect as client,
the program is stuck in client mode.
Starting the server from the menu, does not set server mode.
This results in the player wait count being initialized to 99.
Fixed to set server mode.
Fixes bug 0677.

When starting a splitscreen game, player2 was not getting their
skin and color set.  A test that prevents sending skin and color updates
more than once per tick, also blocks sending any skin and color
updates for all players after the first.
Fixed by sending the skin and color updates for just our player,
whenever the general update is blocked.

*** w109_splat
patchfile = w109_042_splat
- commit revision 1581
Players are kicked during netgame when their blood splat setting
is different than the server.  The control variable is not NETVAR,
and it uses P_Random.

It was desireable to allow players to turn off blood splats
independently of the server setting.
This was fixed by creating a dummy splat function, that uses
the correct number of P_Random to keep random number sync.
A DemoAdapt var was created to control calling this splat function.
Fixes bug 0678.
This also fixes a demo consistency error.

*** w109_numplayer
patchfile = w109_043_numplayer
- commit revision 1582
There are several places where MAXPLAYERS is used, such as modulo
calculations.  Demos may expect a different value for MAXPLAYERS.
This is already determined in the demo read function.
Export this value as max_number_players, and use it in place
of MAXPLAYERS where appropriate.

Changed the netgame repair random_state_checkset function to correctly
report differences in random number settings for the server.
The message syntax was only appropriate for the client,
as it reversed the server/client values in the server.

Adjusted some of the uses of P_Random to more closely follow
PrBoom, with comments to that effect.  Commented where there
was a usage of P_Random that was controlled by something optional.

Adjusted the xdir/ydir logic that calls TryWalk to more closely
follow PrBoom, even though it looks like it should not matter.
The resultant code should also be very slightly faster.

Caught some typos in optional code.

*** w109_extnode
patchfile = w109_044_extnode
- commit revision 1583
Support for extended nodes.
Allows playing several wads, such as Avactor.WAD, and Lost Civilization,
that are otherwise playable by DoomLegacy, but use
extended nodes for several of their maps.

Code from FR_0095 by Michael Bäuerle, woof, and crispy doom.
DeePBSP nodes.
ZDoom extended nodes based on woof 1.2.0, supporting uncompressed.
Will support compressed when ZLIB support is added.

This fixes bug #657, due to DeepBSP V4 extended nodes.
Fixes the segfault in Eviternity.wad Map15 and Map32, due to
use of uncompressed ZDoom extended nodes.

Add file: p_extnode.c
Add file: p_extnode.h

*** w109_zlib
patchfile = w109_045_zlib
- commit revision 1584
Add support for ZLIB.
Used to uncompress compressed ZDoom nodes.
Supports dynamic loading of ZLIB, so DoomLegacy
can run without it.

*** w109_bsp
patchfile = w109_046_bsp
- commit revision 1585
Some incremental performance revision of bsp
search code.
Removes tail recursion, like PrBoom.
Removes the -1 test from the bsp search loop, saving a test.
The children nodes are unsigned, and cannot be negative.
The only case this was supporting is the degenerate case
of a single sector, where upon there will be no nodes.
This case has been moved to be handled outside the search loop.

*** w109_dehcmp
patchfile = w109_047_dehcmp
- commit revision 1586
Fix deh to read Avactor.wad dehacked.
Read buffer length at 200 was too short, made it 1028 like PrBoom.
Made the keyword lookup use strcasecmp.
Made a blank line in a section, exit the section,
as in PrBoom and Eternity.
Detect comments that start with "//", as Avactor has some, even
though I have not seen documentation that says they are valid.
Dehacked itself is not really documented.  It is "do what the other ports did".

*** w109_dehcmp
patchfile = w109_048_hwrbsp
- commit revision 1587
The changes of w109_046_bsp applied to the hardware render bsp.
Somehow they got left out.

*** w109_hwrdata
patchfile = w109_049_hwrdata
- commit revision 1588
Preparation for hw data to be independent of Glide.
Made macros for hw data and format.
Improved some of the loop code found in hw_cache and r_opengl.
Made the allocation of mip blocks keep the previous data allocation
block if it was the right size.  This happens at run-time, so
it can save significant time in opengl.

*** w109_drawsel
patchfile = w109_050_drawsel
- commit revision 1589
Fix broken drawing mode select string.
The table used to get the string for a draw mode was broken,
due to many optional draw modes.
It could fail to get the right string for some optional draw modes.
Replaced it with a generic function that looks up a value
in the PossibleValue list and returns the string.

*** w109_voodoo
patchfile = w109_051_voodoo
- commit revision 1590
Make Compile option for Voodoo card support and Glide: USE_VOODOO_GLIDE.
Disable the option, as there are not likely any Voodoo cards in use.
Drivers for voodoo card are in win32, and linux_x.
They probably do not work anymore, after so many changes.

*** w109_hwsky
patchfile = w109_052_hwsky
- commit revision 1591
Make the hardware sky draw use the extended textures from r_sky.
Fix the hardware sky draw scaling, which was off.
Adjust the movement to draw translations to keep the sky stationary
relative to nearby walls.
The constants do not make sense, but it looks better when the
sky does not wander.
There is still some horizontal wander.

The hardware sky has only one colormap, so it does not change when
Invulnerable.  Fixing the sky Invulnerable bug will require multiple
mipmaps for the sky, which is not supported right now.



*** w109_hwlight
patchfile = w109_053_hwlight
- commit revision 1592
The wad light field is int16_t, but the valid light range is 0..255.
Most ports allow the light field to exceed 255, allowing some
lighting tricks (that few wads take advantage of).
Some wad editors put in a default light value of 256.
Avactor.wad has some lights at 256, and these show up as black sectors.
Fixed the hardware draws to clip lights at 0..255.
Fixed the light values passed around in the code to use the proper type.

*** w109_hwblend
patchfile = w109_054_hwblend
- commit revision 1593
Revise the hardware render blend mutually exclusive flags to be a field.
Revise the OpenGL and other hardware drivers to use a lookup table
for blend, and more efficient attribute setting where possible.
Possibly slightly faster code.
No change in capabilities, but can expand the blends.
Moved the invisibility flag to a blend.

*** w109_hwpowtwo
patchfile = w109_055_hwpowtwo
- commit revision 1594
Make the hardware render texture memory sizes a power of two,
so GL renders more efficiently for all video cards.
This is what the Voodoo card was forcing, so it mostly restores
part of one function.

*** w109_blockmap
patchfile = w109_056_blockmap
- commit revision 1595
Added the blockmap generation code provided by Michael Bäuerle (FR_0096).
Some of the code is borrowed from crispy doom, altered a bit by
Michael Bäuerle to suit DoomLegacy.
And then totally mangled by me (it violated some programming principles,
could be made much easier to maintain by rewriting, and I think
a bit more efficient).
May help with Lost Civilization, map04.
A blockmap control has been put into the menu.
1. Vanilla  - Load the blockmap, preserves blockmap tricks.
2. Large    - On large blockmaps (error prone), Generate instead.
3. Generate - Always Generate a blockmap.
4. Auto     - Try to Load, upon significant errors then Generate.


*** w109_hw2
patchfile = w109_057_hw2
- commit revision 1596
Fix missing stmt in bsp, when not PARANOIA.
This was fixed a different way, but that got left out
of the committed patch.

*** w109_loadesc
patchfile = w109_058_loadesc
- commit revision 1597
Fix Load savegame menu controls to allow ESCAPE
from the Load savegame after changing to another directory.
Make most menu functions static.

*** w109_hwbsp
patchfile = w109_059_hwbsp
- commit revision 1598
This fixes a missing floor in Avactor.wad (Map04, sector 1757).

The hw_bsp SplitPoly has to deal with a partition line that misses
the poly.  It must be determined if the poly is to the right,
in which case it is the frontpoly, or to the left, in which case
it is the backpoly.  This must match the bsp partitioning, as
those poly will be assigned to the front sector, and back sector.

The particular case was when the divline missed the poly,
but intersected at one vertex.
The test for right or left needs to test a polyvertex
that is not on the divline.
In this corner case, it was being determined wrong, leading to
the poly being assigned to the wrong subsector, and the floor
being missing.

The point_rightside function has been changed to return a float,
which indicates how much right of the divline the point is.
The result is porportional to the length of the divline,
so the test now compensates for the length of the divline.
The test now looks at all the poly vertex, until it finds
a point that exceeds half the divline length in right/left.

In Avactor.wad, there are an excessive number of partitionings
that miss the poly.
The new blockmap generator seems to be the same.

Added hw_bsp DEBUG and TRACE optional capability.
Removed an old debug test that no longer worked.


*** w109_hwadjust
patchfile = w109_060_hwadjust
- commit revision 1599
This fixes some bad subsector assigns for hardware-draw
in Avactor.wad (Map05 sector 1502).

The function Find_Poly_Sector is used on a polygon, to find the its sector.
With subsectors that have a seg as a side, this can be done by
inspection.  For subsectors that are not adjacent to a sector side,
Find_Poly_Sector is used to find the sector that they are within.
This is done by finding a linedef of that sector.

Find_Poly_Sector generates a vertex within the poly by averaging the
polygon vertexes.  It then searches all the linedef for the closest.
The calculation for closest overflows sometimes.

When the wrong linedef is deemed to be closest, the sidedef of that
linedef is used to assign the sector to the subsector.
This makes the wrong sector be used to display the floor height, and floor flat.

I tried several approaches to this.  I ended up using of the
current code, rewritten to be faster, and more robust in large maps.
The linedef considered are limited to those that bracket the test point.
The measurement is the distance to the line, on the same x or y
coordinate.  This ensures that the distance is to a point on the line
that is within the linedef boundaries.  All the distances are measured
along the same lines, so it is the closest linedef along a particular line.
This still finds a linedef of the enclosing sector because any wrong
linedef would be beaten by the linedef of the sector that crosses that line.

Using a cross product failed due to it finding the closest point to
the linedef without restricting it to be within the boundaries of the linedef.
A far linedef that was angled could be considered closest to the
test point, even though it was farther away using other criterea.

Eliminating linedef from test consideration using dx vrs dy had to be removed.
There may be only one linedef that beats another wrong linedef
from being used.  Every linedef has to be tested for every geometric relationship.


*** w109_dogs
patchfile = w109_061_dogs
- commit revision 1600
The extra dogs, enabled in menu, were using the MT code
instead of the doomed code to spawn them.
Fixed the spawning by changing Spawn_Mapthing to allow
MT codes to be specified.
Fixes bug 0681.

*** w109_sprite
patchfile = w109_062_sprite
- commit revision 1601
Often the dog sprite is missing from the wad.
Some of the tests for missing sprites is only enabled during DEBUG.
Include these tests for normal compile too.

*** w109_hw_trans_wall
patchfile = w109_063_hw_trans_wall
- commit revision 1602
Lost Civilization has some masked textures used on upper textures and single
sided walls.  This is not entirely valid usage, but happens.
The software render draws black in the missing portions of the texture.
OpenGL is drawing a masked texture, showing sky through the wall.
Changed the drawing of such textures in hardware draw to not use the
texture alpha.
Changed the SplitWall function to support such alternative drawing
blends.

*** w109_dehack_dog
patchfile = w109_064_dehack_dog
- commit revision 1603
Thing 140, in Valiant.wad dehacked, is changing the rocket smoke to
a monster.  When the rocket-launcher is fired, a monster immediately
appears and explodes the rocket.

The line has: Thing 140 (Avanc... (DOG SLOT)).
In Eternity Engine MT_DOG = 140, but in PrBoom MT_DOG = 138, but in
Legacy MT_DOG = 143.
Legacy savegames are dependent, as will be Legacy specific wads.
This cannot be fixed by moving the MT_DOG code.

For Thing numbers in the range 138..150, have added an additional
test of the dehacked text.
Have created a table of a characteristic words that might appear for each
of the thing numbers in this range.  If one of these words is found,
the thing number is changed to our MT code.
This fixes the rocket-launcher in Valiant.wad.

*** w109_dehack_dog2
patchfile = w109_065_dehack_dog2
- commit revision 1604
Fix error in Thing valid range test.
Fix deh_thing_id values, which are +1 of MT_xxx values.

*** w109_draw_1s
patchfile = w109_066_draw_1s
- commit revision 1605
Some masked textures are used on 1s walls, in lost_civilization.
These were fixed in 1602, but if a blackened textures is encountered first
the software draw will get stuck with it when it should use the masked texture.
This fixes the Generate texture post detect to indicate 1s or 2s draw ability directly.


*** w109_dehack_dog3
patchfile = w109_067_dehack_dog3
- commit revision 1606
The previous dehack_dog patches only worked because they moved the
dehack thing numbers.  The code to adjust thing numbers was non-functional.
This patch creates a more comprehensive dehacked thing number
adjustment.

Created a command line parameter to force the adjustment of DEH thing
numbers.  It currently has four possible values.
-dehthing legacy
-dehthing boom
-dehthing prboom
-dehthing ee

*** w109_odd_width
patchfile = w109_068_odd_width
- commit revision 1607
Some textures in LostCiv have an odd texture, with a width that is not
a power of two.  Such odd textures cannot have their column number
masked.
Added modulo operations to tile such odd width textures.

*** w109_version 1.48.10
patchfile = w109_069_ver14810
- commit revision 1608
Update to version 1.48.10, with docs.

*** w109_strcasestr
patchfile = w109_070_strcasestr
- commit revision 1609
Mingw32 does not have strcasestr.
Had to write one for Mingw32 and Watcom.


*** w109_dynload
patchfile = w109_071_dynload
- commit revision 1610
Fix compile errors in dynamic load of zlib, and libzip.
Detect version of libzip from header file.
Remove version of libzip from make_options.
Fix HAVE_LIBZIP in make_options to be same
syntax as HAVE_ZLIB.
Update all docs to reflect this.

*** w109_hwr_draw_cache
patchfile = w109_072_hwr_draw_cache
- commit revision 1611
Fix a segfault in biowar.wad Map08 with OpenGL.
It would segfault when a texture being drawn in cache,
had one patch extending lower than the texture bottom.
The draw in the cache would overrun the allocated memory.
Fixed the limit test to test against the dest index, instead of a
source index.  They differed in scaling.

*** w109_misc
patchfile = w109_073_misc
- commit revision 1612
Update docs for 1.48.10 rev 1612.
Unused ext state are set to zero.
Update release scripts.

*** w109_x11sound4
patchfile = w109_074_x11sound4
- commit revision 1616
Fix x11 musserver quitting whenever trying
any device other than TiMidity.
Make FluidSynth MIDI detection work.
Include the DEBUG options in #ifdef.
Fix a HAVE_ZLIB test that would error when compiling for X11.

*** w109_clang
patchfile = w109_075_clang
- commit revision 1618
Fix a number of clang compiler complaints.

*** w109_pickup_clip
patchfile = w109_076_pickup_clip
- commit revision 1619
Player picks up clip when has full ammo.
A return stmt was left out during patch, w105_22_playermsg, svn 1225.
This resulted in the clip being used up, even when
the player already has max ammo.

*** w109_flat_animation
patchfile = w109_077_flat_animation
- commit revision 1620
Rewrite the flat animation.
A long time ago the flats were optimized by only loading the flats
that appeared in the level map, into the levelflats.
This is incompatible with flat animation, as the animation requires
flats that may not have appeared otherwise.  This results in the
animation not working for some flats that should be animated (doom2 map17).
Also, the flat animation uses ptrs into levelflats.
Trying to add the missing flats later often results in levelflats being
reallocated and moved out from under the animation ptrs.
Rewrote the flat animation using the flat_list.
Updates the flat animation again when levelflats has moved during the update.
Removed the old animation code that checked all flats in the wad.

*** w109_mac1
patchfile = w109_078_mac1
- commit revision 1621
Changes to support compiling on Mac OS X (Darwin).
Uses App folder.
Based on support from Gibbon.


*** w110_mp3
patchfile = w110_001_mp3
- commit revision 1622
Fix the existing MIDI, MP3, and OGG music playing.
Put the o_xxx lump read into s_sound.c.
Put the music type detection into s_sound.c, passing
it as a parameter to all port music code.
Add a control to select music type, with an automatic mode.
Add automatic music type selection and playing.
See bug #682, and w110_mp3_11.

*** w110_misc
patchfile = w110_002_misc
- commit revision 1623

*** w110_sdl2
patchfile = w110_003_sdl2
- commit revision 1624
Add SDL2 support.
This provides video, sound, and keyboard alterations
for the SDL2 library calls.
Still supports SDL1, for target machines that are not supported by SDL2.
The SDL1 is working better than SDL2, at this point.

*** w110_mp3_11
patchfile = w110_004_mp3
- commit revision 1625
Bump the version to 1.48.11.
Fix MP3 music, by passing the correct data.
Detect the music type upon replay too.  Otherwise it
tries to play MP3 as a MUS.
Some other comments and small changes.
Fixes bug #682.

*** w110_misc5
patchfile = w110_005_misc5
- commit revision 1626
Misc. changes.
Standardize the usage of structs.

*** w110_rdraw
patchfile = w110_006_rdraw
- commit revision 1627
Remove extraneous texture step statements from Fuzz draw routines.
Remove extraneous height step calculations from Fog render routine.

*** w110_dyn_cover
patchfile = w110_007_dyn_cover
- commit revision 1628
VISPLANE_DYNAMIC_COVER
Replace arrays of [MAXVIDWIDTH] in visplane with dynamically
allocated array of [vid.width].
This reduces each visplane from 6464 bytes to 3268 bytes.
Give better locality of reference.
This will allow MAXVIDWIDTH to be increased, to allow larger screen sizes.


*** w110_rend1
patchfile = w110_008_rend1
- commit revision 1629
Start of transition to new software render structure.
In r_bsp, some code cleanup. add comments.
Rename a few to more descriptive names (MAX_SOLIDSEGS).
Reduce redundant structure accesses.
Introduce  first_subsec_seg.

*** w110_rend2
patchfile = w110_009_rend2
- commit revision 1630
Cleanup drawsegs, and add comments.
Update and clarify some DEBUG_STOREWALL code.
Make some of the drawseg creation (Killough code) easier to
read and understand.  Reduce redundant structure accesses.

Create pool16 allocation for int16_t arrays.
It allocates in chunks, and does not reallocate.
It does not require fixing existing ptrs.
Collect scattered openings and pool16 allocation code to one place.
The pool16 will replace expand_openings, and its ptr fixing code.

*** w110_rend3
patchfile = w110_010_rend3
- commit revision 1631
New masked draw structures, and changes to drawseg, to support
sorting sprites using drawseg.
The drawnodes will be eventually removed, as they do not achieve
anything unique.

Rename sprite screen positions from sz_top, sz_bot to y_top, y_bot.

The ffloor (3d floor) now have separate drawseg structures
(drawsprite_t, draw_ffside_t, and draw_ffplane_t) that are only allocated
when a ffloor is present.  This greatly reduces the memory footprint
for most wad maps, which reduces useless cache invalidations.

Change clipping array uses of short to int16_t.

*** w110_sprite_x0
patchfile = w110_011_sprite_x0
- commit revision 1632
Fix to sprite draw, to separate the sprite 0 position from the x1 position.
The sprite 0 for drawing will be tex_x0 now.
For flipped sprites, tex_x0 and tex_x_iscale are flipped.
This fixes errors on draws of some flipped sprites.

*** w110_rend4
patchfile = w110_012_rend4
- commit revision 1633
Cleanup of existing code in preparation for change to
new software draw rendering.
Organize the clip array support better, collected it together.
Add comments.
Re-indent some of the r_things.c code.

*** w110_rend5
patchfile = w110_013_rend5
- commit revision 1634
Remove drawnodes structures and code.
The drawnodes were in the drawseg order as determined by the BSP,
and it existed only to aid the sorting of sprites into the draw order.
The occlusion of sprites by planes was buggy in the drawnode version.
Sprites cannot be sorted into the drawnodes to satify all the conflicts
that occur.

Add new software draw rendering.
Basically it performs much the same drawseg operations as before,
but without having to allocate and sort drawnodes.
Drawing the drawseg is done directly from the drawsegs.
The sprites were already sorted by scale.
The search, occlusion, and masking of sprites is done during
R_Draw_Masked now.  There is no longer any need to save sprite sort
information.

The sprites are split vertically when only part of the sprite is
occluded by a drawseg.  The occluded part is drawn and removed.
The non-occluded part continues to be tested against other drawsegs.

The occlusion of sprites by planes is now done by masking the sprite
with a clip array.  The portion of the sprite occluded by a solid plane
will not be drawn anymore.  It will be drawn only if the plane is transparent.
The remainder of the sprite will continue to be tested against other
segments and planes, until it is entirely masked or drawn.

Instead of trying to save all the sprite conflicts in one sprite structure (like a drawnode),
the sprite is split and clipped until all parts of it have been drawn (or masked),
which will be when all the drawseg conflicts have been handled.

*** w110_014_rend6
patchfile = w110_014_rend6
- commit revision 1635
Optimize some sprite clipping loops.

*** w110_dyntwitch
patchfile = w110_015_rend5
- commit revision 1636
OpenGL display, wall textures would distort when a fireball or rocket
would pass by.
This would happen on any wall under a 3d floor (but not the top floor).
Hitting the top wall with a plasma, would cause distortion of the
lower walls.
Disabling dynamic lights would stop the distortion.

This occurred because the HWR_SplitWall function was going through the
light planes, displaying each, using the GL vertexes as if they would
not change.
The dynamic lights overwrites the tow and sow of the GL vertexes with
light values.  As the x,y,z values were the same, and as the dynamic
lights are projected after the wall is projected, for most walls this
was more efficient.
Fixed the HWR_SplitWall function by adding explicit saving of the sow
and tow values, restoring them before each call to project the wall.

Also added some conditional code that would give the dynamic light
projection its own copy of the GL vertexes.  This also worked, but
was much more expensive.

*** w110_maputil
patchfile = w110_016_maputl
- commit revision 1637
Add const to some parameters of the maputl functions, like in PrBoom.
Some of the maptutl functions, were expanded out from the PrBoom versions
using variables and XOR, to the point that they are inefficient.
Eliminated some indirect inversions, XOR, and variables, to be more efficient.
Trying to share a common return was not saving code size.  In this case,
an IF done immediately is more efficient than a couple XOR, and an IF
done later.
Made the code smaller by 16 bytes.
Added a remalloc failure test.

*** w110_light_trans
patchfile = w110_017_light_trans
- commit revision 1638
Mitigate a segfault in cyberarena3.zip, that was not reproducible.
Protect against NULL line ptr in some light functions.

Optimize some transparent texture handling.

*** w110_zipseek
patchfile = w110_018_zipseek
- commit revision 1639
Fix zip seek error in cyberarena3.zip.
When opening an archive, and have a zip file open, must
close the zip file, or its position will be different
than what is recorded in position_z.

*** w110_map_adjust
patchfile = w110_019_map_adjust
- commit revision 1640
Add controls to adjust monster health,
health pickup, armor pickup, and ammo pickup.
This allows adjusting play of an overly difficult map such
as one with multiple cyberdemons and you have only three players
on your coop team and one is a newbie, or adjusting a map weak in ammo,
or increasing difficulty when feeling cocky.

*** w110_win
patchfile = w110_020_win
- commit revision 1641
Fix for Mingw32, "near" cannot be used as field name, so using "nearer".
Fix sdl/i_sound, to make it compatible with the SDL Mixer 1.2.8 that is on
the WinXP machine.
The SDL Mixer 1.2.8 (on WinXP) does NOT have MIX_INIT, but the SDL Mixer
1.2.10 (on Linux) does, and SDL2 Mixer does too.
Add SDL_DIR to the make_options, because win/mingw32 cannot reliabily
find SDL/include otherwise, and it is better than having the end user editing
the Makefile.

*** w110_version14812
patchfile = w110_021_ver14812
- commit revision 1642
Docs and version 1.48.12.

*** w110_post_term
patchfile = w110_022_post_term
- commit revision 1646
Fix to Bug 687.
In Pagodia.wad, Map06, the hanging vine texture had visual artifacts.
(AUR008, texture #624, lump 132961).
Due to some of the columns being totally empty, some
of the columns of the generated texture had the 0xFF termination,
in the wrong place.

*** w110_1s2s
patchfile = w110_023_1s2s
- commit revision 1647
In Lost Civilization Map04, the arch texture ARC1ABRN was rendered
with black holes.  The wad uses it on a wall and as a masked texture,
next to each other.
The use on a wall had texture generation using the TM_picture
format.
To fix this, gave the masked texture draw the same capability to
generate an extra texture_render holding a TD_2s_ready texture.

*** w110_midi_control
patchfile = w110_024_midi
- commit revision 1648
Fix to Bug 0674 Midi track playing late.
The MIDI put out included some padding of Track 0, that caused
the Win10 and Win11 MIDI player to delay the track and change
it to a piano.
Do not know why these were in the MIDI output.
The Track 0 padding has been disabled, and may be removed entirely
(eventually).
The Program_Change inclusion is now enabled by control variable
"midi_create_program", which is default 0.
The midi compression is enabled by control variable "midi_compression",
which is default 1.

*** w110_joystick
patchfile = w110_025_joystick
- commit revision 1649
Add JOYSTICK_SUPPORT compile-time option, so that joystick code can be
disabled.  This was necessary due to some port situations not having
joystick hardware.

*** w110_dos1
patchfile = w110_026_dos
- commit revision 1650
Steven Newbury has been trying to compile for DOS.
These are changes based on a something he summitted.
This got delayed for a while, so I can no longer record how complete
the changes are.  I suspect this is not complete, thus it is part1.
It covers some network problems with DOS.
Within djgppdos, there are DOS sound fixes and many fixes to bring the
the interface up to date.

*** w110_gcc
patchfile = w110_027_gcc
- commit revision 1651
Fixing complaints from gcc 11.2.
Also snprintf does not honor string max field size.
Must copy possibly long strings to some shorter buffer first.
Make a common send function for send to master_server.
The code_size seems to have been reduced by 56K, perhaps due to new compiler.

*** w110_bob4
patchfile = w110_028_bob4
- commit revision 1652
Fix error from w104_23.  When made BOB_MOM code a standard feature, one of the compile tests
was missed.  Removing the BOB_MOM define, also made it active.
Removed that code.
Some other cleanup, ptr declares.

*** w110_misc4
patchfile = w110_029_misc4
- commit revision 1653
Disabled a RANGECHECK in wi_stuff as many wads violate those assumptions.
Many other typo and ptr declares encountered while working on UMAPINFO.

*** w110_umapinfo
patchfile = w110_030_umapinfo
- commit revision 1654
UMAPINFO, derived from umapinfo-lib (GPL)
written by Michael Bauerle, who has allowed us to use
and modify it in DoomLegacy.
It got heavily modified, as it was complicated with hiding internal structure,
and that was not useful when it was embedded in DoomLegacy.
Errors and messages were rewritten to attach to DoomLegacy error reporting.

*** w110_viewfit
patchfile = w110_031_viewfit
- commit revision 1656
Add viewfit control.
Has settings:
AUTO: auto select based on actual screen size
stretch: stretch to fit screen
fit width: fit to screen width, scale to correct aspect ratio
fit height: fit to screen height, scale to correct aspect ratio

*** w110_14814
patchfile = w110_032_14814
- commit revision 1656
Release version 1.48.14.

-- commit