The code is mostly a straight port from PrBoom+.
Also, as a proof of concept, apply this to the "Weapon Attack
Alignment" feature which now offers a choice of "Off", "Centered" and
"Bobbing".
* composite all textures, whether single-patched or not
With this commit, Crispy now composes all textures, whether they are
single-patched or not. It generates to composites per texture, one for
rendering mid-textures on 2S wall which may contain translucent areas,
and another one for rendering textures on 1S walls and the sky,
respectively.
No column is ever read directly from a patch lump anymore. This keeps
the Medusa bug fixed but also fixes graphical glitches with e.g.
single-patched textures that are shorter than the patch, etc.
* initialize opaque texture column offset earlier
* compose tall patch compliant texture columns
Once we pass the 254 pixel boundary, the topdelta value becomes relative.
This is a "light" variant of the same feature in Crispy Doom, i.e.
removed map objects may finish their sounds but this does not apply to
sounds with origin == NULL, i.e. sounds that emerge "in the player's
head".
This enables both optimizations (-O2) and debug symbols (-g), so strip
the latter during the install rule. While at it, increase verbosity
for the default build.
The deh_bexptrs[i].lookup is a pointer to a char array and is never
NULL. Check for the actual code pointer being NULL instead. This fixes
a crash with Dehacked patches pointing to non-existent code pointers,
e.g. the one embedded into SihR2fix.wad.
Thanks Catpho for the report.
Presently in SDL2_Mixer, Mix_OpenAudio() will by default always open
the "best matching" channel count it can of the sound driver. Certain
headphones only report a 7.1 output to the device driver which means
it will always open 8 channels, even if you only specify 2. This may
end up causing the audio buffer to come out malformed with sounds
playing too fast and producing corruption, failing to produce
directional audio and crashing in rather obscure ways.
It is concluded by SDL2 upstream that Mix_OpenAudio() should be
considered deprecated, and that Mix_OpenAudioDevice() should be called
instead directly with the additional flag removed that adapts the
channel count that Mix_OpenAudio() always uses. Reportedly, this fixes
all the problems.
Thanks to Edward850 for pointing this issue out and proposing the
fix.
We are going to replace calls to the deprecated Mix_OpenAudio() API
with Mix_OpenAudioDevice() which has been added to SDL2_Mixer 2.0.2,
which in turn depends on SDL 2.0.7.
Both library versions have been released in Oct 2017.