This fixes the missing music in hipdemo1 caused by a leading space
character before the cdtrack number, which ended up being parsed
incorrectly. https://github.com/andrei-drexler/ironwail/issues/60
Note: original issue with fscanf (mentioned in the code comments)
was caused by the inclusion of the newline in the format string.
We work around it by reading the newline character separately.
See https://github.com/Novum/vkQuake/pull/438. Also see
https://github.com/andrei-drexler/ironwail/issues/32
Note: Changing that 24 to 39 does prevent the crash, but
the buffer size is still insufficient, so some entities
(e.g. nails) are missing occasionally. A MAX_DATAGRAM of
48000 seems enough to fix that (MAX_DATAGRAM in ironwail
has been bumped to 64000.) Long term though, it would be
much better to add support for pkt fragmentation like in
QSS since this jumbo packet size is only used in single-
player mode - multiplayer uses the much smaller value of
DATAGRAM_MTU (just 1400 bytes.)
Potential fix for https://github.com/andrei-drexler/ironwail/issues/27:
The focused window is not the game window on initial startup until the
game window is clicked on with mouse. Confirmed that it doesn't happen
with only one screen.
This matches the standard library and also fixes the following bug:
- load ad_sepulcher and move to an area where water is visible
- open up the console
- save waterbug
- load waterbug
Water is now invisible as long as the console is still active.
The issue stems from the fact that cvar_set is called at startup
with the arguments ("r_wateralpha", ftos(liquid_alpha)) [1],
and ftos pads its output (" 0.6"). Without skipping the leading
whitespace, Q_atof ends up returning 0, which then gets assigned
to r_wateralpha. This makes the water invisible until a stuffcmd
that sets r_wateralpha again is later received from the server.
With the console open at startup, however, the stuffcmd message
can be delayed indefinitely.
[1] 320f1cec45/world.qc (L641)
SDL_config_windows.h from development version of SDL added inclusion of
winsdkver.h which may not be available in old SDKs. we have no use for
the functionality provided by it, therefore disable it.