"init_delay" was renamed to "updates_countdown", since it's now a "general
purpose" countdown, having also to count the inputs left for gyro calibration,
besides controller initialization.
Reason for the countdown is now explicit, not having to depend if
"gyro_calibration" was true or not to select what was the purpose of the
countdown.
Explanation comment added for gyro initialization on Linux & Mac.
REMINDER: see if SDL2 will keep the difference of gyro readings between Windows
and Linux/Mac for the Switch controllers.
For example, on Windows with AMDs drivers, GLES3 isn't supported,
so CreateSDLWindow() will fail. We should just try the regular GL3
renderer then instead of exiting with Com_Error()
Also make (Windows') Sys_Error() print to stdout (in addition to stderr),
so errors end up in stdout.txt as well (like all other messages).
SDL2 provides different gyro readings between Windows and Linux/Mac for
the Switch Pro Controller. To keep the natural sensitivity scale intact
(in-game turn = controller turn), the normalization factor is handled
differently by platform, at least for now.
Also, now giving info when there's no gyro sensor available/detected.
And green light for the DualShock 4, because why not :)
Cvar to choose between "yaw" (0) or "roll" (1) axis of the controller
to turn (change your yaw) in-game.
Cvars to change pitch and yaw gyro sensitivities.
Updated cvar documentation with new section "Game Controller".
SDL 2.0.16 and a controller with a gyroscope required to make it work.
Manual calibration of the gyro sensor is needed to avoid "drifting"; a menu
option to do it is included.
New cvar 'gyro_mode' for mode of operation, and to assign action to the new
"+gyroaction" button: disable or enable the gyro.
Several effects use dlights which are rendered for only one frame.
Muzzle flashes are an example. While this worked on 1997th computers,
todays hardware renders way too many frames for these dlights to be
visible at all. Work around that by enforcing a minimal display time
of 32 milliseconds for each dlight.
Fixes part of #815.
When a key/button name is too long, and its bound to an inventory element, its
display in the inventory screen misaligns the item it is bound to, even pushing
it out of the inventory frame.
This commit limits its display to the maximum of 6 characters the inventory
screen allows.
Adds menu bitmap struct, drawing of a menu bitmap and highlighting if bitmap menu item is in focus.
Allows items that are gray (inactive) to be skipped when adjusting the menu cursor.
Removed switch case from Menu_SelectItem, all items either do or do not call their callback functions.
This ensures that we call ARM64 `aarch64` on all platform, which aren't
MacOS or Windows. And it fixes the bug, that `arm64` was normalized to
`arm`, making incompatible savegames between 32 bit and 64 bit ARM
loadable. Leading to crashes.
.. by running a packet frame if the current renderframe is closer to
the time the packet frame *should* be run than the next renderframe
(presumably) will be.
This should also help when using cl_maxfps -1 on a slow system that
can't reach the desired rfps (vid_maxfps or display refresh rate).
Without this change, we might run int the problem described in the
following example:
Imagine having cl_async 1, cl_maxfps 100, no vsync and a system that
mostly only reaches about 60fps. So rfps is 100 and pfps is 50.
But then (without this change) running at 60fps means that only every
second renderframe is a packetframe, so the packetframerate
*effectively* is 30, which can cause movement/clipping/physics bugs
(for example when hugging some non-perpendicular walls, like the right
wall with the window that leads to the last room in base1).
With this change the packet framerate would effectively be 60 (every
renderframe is also a packetframe), which is less buggy and also closer
to 50 than 30 is.
(this is the default value of that cvar now)
In Qcommon_Frame(), if cl_async is 1, the packet framerate should
ideally be a fraction of the render framerate, and to avoid movement
glitches and such it should be between 45 and 90, ideally around 60.
With cl_maxfps set to -1, pfps now is set to such a value automatically.
When setting rfps based on GLimp_GetRefreshRate() and vid_maxfps,
take into account that GLimp_GetRefreshRate() might return a value
that's slightly too low (like 58 or 59 when it's 59.95 and should be 60)
The 20% tolerance that, in case of vsync enabled, used to be handled
with `packetdelta < 0.8 * 1000000/pfps` (and the same for rfps) is now
instead added to rfps (and thus implicitly pfps, if it's >= refreshrate)
It could make things stutter, especially if cl_maxfps was deliberately
set to a fraction of the display refreshrate (as it'd target a few
frames less).
The 0.95 factor was supposed to ensure that we don't have more packet
frames than renderframes (or two packet frames in a row without
rendering in between), as that apparently breaks the movement prediction
code. We now ensure the same thing my not running a packet frame if no
render frame is run at the same time.
May be unreliable on some devices, e.g. Nintendo Switch Pro Controller.
Works great on others, e.g. DualShock 4.
Delay added to gamepad initialization on hotplug, gives time to the OS to
recognize the device.