Commit Graph

3455 Commits

Author SHA1 Message Date
Daniel Gibson 502ff345c3 Introduce cl_maxfps -1 for "use optimal value based on render framerate"
(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.
2022-05-09 02:05:19 +02:00
Daniel Gibson 7cf1392765 Qcommon_Frame(): Improve max framerate handling when vsync is enabled
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)
2022-05-09 01:43:08 +02:00
Daniel Gibson 5a8382064a Remove 0.95 factor for packet framerate
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.
2022-05-08 18:10:25 +02:00
David Carlier 77aef1d732 cmake Haiku build little improvement for SDL retrieval. 2022-05-08 09:06:13 +00:00
Jaime Moreira 422715cee2 Hot plugging / hot swapping of game controller(s)
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.
2022-05-08 01:05:07 -04:00
Jaime Moreira 20542420ef New controller alt buttons menu option
Allows to bind buttons that only will work with "+joyaltselector" active.
The definition of another "scope" of keys was needed, to identify ALT bindings.
2022-05-08 00:24:52 -04:00
Jaime Moreira 0aa44afa13 New customize controller buttons menu option
Handles game controller button bindings exclusively.
Classic "customize controls" option now handles only keyboard / mouse bindings.
This separation is achieved with the new order of QKEYS in keyboard.h, and
binding functions in menus (especially "MenuKey" functions) now take into
account the "scope" where they operate: keyboard/mouse only, controller only,
or both.
2022-05-07 23:55:00 -04:00
Jaime Moreira d4100f7113 Menu inputs standardised
Streamlined menu inputs by making most "*_MenuKey(key)" functions to use
Key_GetMenuKey(). "Backspace" is not a special case anymore, so any menus
that have a "delete" option can already handle any input expected, like the
backspace or delete keys, or the "Y" button of the controller, to run it.

Also, fixed a bug where changing the key for "team chat" also changes the one
for "chat" in the "multiplayer" -> "customize controls" menu.
2022-05-07 22:45:44 -04:00
Jaime Moreira 2bb1b33d7e Full transition to use only SDL_GameController for gamepad
This removes the usage of SDL_Joystick for joystick buttons and hat, and
relies exclusively on SDL_GameController for input. This allows to identify
buttons in a consistent manner across multiple types of controllers, which
in turn allows to assign specific tasks to them without worrying of breaking
usability, like having "A" to accept and "B" to cancel in menus.

Init and Shutdown logic of game controller have been separated from main SDL
Init and Shutdown functions.

Old style button names "JOYx" have been removed.

If your gamepad has paddles or other extra buttons, you'll need at least
SDL version 2.0.14 to use them.
2022-05-07 21:26:50 -04:00
Yamagi ab8d700674 Add hangar1.ent entity file.
This fixes two stuck monsters. Found and submitted by @Dremor8484.
Closes #821.
2022-05-07 10:08:49 +02:00
Yamagi e294fc94e5
Merge pull request #822 from DanielGibson/gles3-rb
OpenGL ES 3.0 support
2022-05-07 09:45:30 +02:00
Yamagi 22ff171007
Merge pull request #825 from devnexen/curl_progress_fix
curl client show progress only when there actually some
2022-05-07 09:44:00 +02:00
Yamagi 434e85feaf
Merge pull request #823 from 0lvin/benchmark
Remove framelimits for timedemo
2022-05-07 09:42:16 +02:00
Yamagi 5dd7a56c57
Merge pull request #820 from ConHuevosGuey/master
Update retexturing command in configuration document.
2022-05-07 09:40:30 +02:00
Yamagi 56d5342fa7
Merge pull request #816 from devnexen/refactor_cpu_pause
frame cpu pause refactoring.
2022-05-07 09:39:57 +02:00
David Carlier c34071d05c curl client show progress only when there actually some 2022-05-07 07:03:40 +01:00
Denis Pauk bbaf6d6b20 Remove framelimits for timedemo 2022-04-27 23:09:28 +03:00
Daniel Gibson ef7ba41932 Update documentation for GLES3 and gl3_usefbo 2022-04-27 00:33:46 +02:00
Daniel Gibson 56e1b9bc1e Add gles3 renderer to videomenu 2022-04-27 00:33:46 +02:00
Daniel Gibson 0881a63b1e GLES3: Explicitly don't handle gl_drawbuffer
GLES can't render to the front-buffer
2022-04-27 00:33:46 +02:00
Daniel Gibson e124ddb4d0 GLES3 support in CMake 2022-04-27 00:33:46 +02:00
Daniel Gibson 2a8bd9e7a6 GL3: build ref_gles3 in addition to ref_gl3
instead of making it a compile-time option, just build both
2022-04-27 00:33:46 +02:00
Daniel Gibson a195305592 GL3: Fix particles on RPi4
tested V3D 4.2; OpenGL ES 3.1 Mesa 20.3.5
2022-04-26 04:10:57 +02:00
Daniel Gibson 89f63915a3 GLES3: Make newer shaders work with OpenGL ES 2022-04-26 04:09:38 +02:00
Daniel Gibson c936e43420 GL3: Use one projection-view matrix in shaders
instead of separate projection and view matrices - this way there is
one less mat4 multiplication in the 3D vertex shaders.
2022-04-26 04:09:38 +02:00
Daniel Gibson 1eabde6b55 GL3: Make GLES3 work on Raspberry Pi 4B
(older Raspberry Pi versions don't support OpenGL ES 3.0, only 2.0)
2022-04-26 04:09:38 +02:00
Daniel Gibson 8737ce64fc GL3: Support OpenGL ES3.0 (compile time option GL3_GLES=yes)
the option defaults to no, of course.
2022-04-26 04:09:38 +02:00
Daniel Gibson c6145b4e6a GL3: Only use FBO if under water
because on some systems (like RPi4 with my experimental GLES3 branch)
the overhead of a FBO is really noticeable, so no reason to pay for it
when it's not needed
2022-04-26 04:08:21 +02:00
David Carlier df86c15395 frame cpu pause refactoring.
expanding to powerpc archs also for visual studio/MSVC while
keeping clang support for windows.
2022-04-25 18:17:46 +01:00
ConHuevosGuey 9c6c2fa749 Update retexturing command in configuration document. 2022-04-25 11:35:23 -05:00
Daniel Gibson 3d619a1441 GL3: Implement underwater postprocess effect using framebuffer object
Can be disabled with gl3_usefbo 0.
Mostly this adds an underwater warping effect, like the soft-renderer,
and also like the vulkan renderer (the shader is based on the vk one).
When this is enabled, the v_blend effect (for fullscreen overlay with
one color, like when hit or to make the screen white-ish when under
water) is now applied in the shader used for rendering the FBO instead
of rendering a fullscreen quad in blendmode.
2022-04-25 17:44:51 +02:00
Yamagi 4db6534ab3 Implement damage tracking for the framecounter.
This fixes the framecounter in the soft renderer when `viewsize` is set
to something smaller than 100. This requires the renerer to rerender
bigger parts of the borders which has a measurable speed impact. About
5 frames less with the framecounter enabled on my system. No impact with
`viewsize 100`.
2022-04-24 00:17:48 +02:00
Yamagi be3e0cc695 Fix `viewsize` not working correctly with the GL renderers.
The GL renderers require that the borders are redrawn after every
glClear() call, the damage tracking doesn't take that into account.
Since the speedup by the damage tracking is neglibiable in the GL
renderers, don't use it. Just redraw everything when we're running
with everthing which isn't the soft renderer.
2022-04-24 00:01:14 +02:00
Yamagi a9a0c35a98 Rename the nightmare menu entry to hard+.
I think this looks ugly, I always called it nightmare and it was one of
the first changes I've made to Quake II. But for the sake of peace and
quiet change it to be standard conformant. Closes #809.
2022-04-23 16:35:27 +02:00
Yamagi aa5d6636d6
Merge pull request #814 from protocultor/gamecontrollerdb
Load gamecontrollerdb.txt for SDL2 joy mappings
2022-04-23 16:21:09 +02:00
Yamagi 60b5ec3268
Merge pull request #812 from 0lvin/fixes
Fixes for soft render with disabled color lighting
2022-04-23 16:11:34 +02:00
Denis Pauk b2500d6aed soft: revert to use colormap
Apply light uses colormap for each color components with colorlights.
2022-04-17 23:25:22 +03:00
Denis Pauk afc892001d soft: move light code to separate function 2022-04-17 23:07:38 +03:00
Denis Pauk a58fb0ed01 soft: fix colors 2022-04-17 23:07:38 +03:00
Denis Pauk 96a78c41c8 soft: speedup apply grey light to wall 2022-04-17 23:07:38 +03:00
Denis Pauk e1d5bad4db soft: fix grey light with fix c20c47b0 2022-04-17 23:07:38 +03:00
Jaime Moreira 45d8228dff Corrected silly string concatenation 2022-04-16 11:53:22 -04:00
Jaime Moreira db0e643419 Load gamecontrollerdb.txt for SDL2 joy mappings 2022-04-16 01:37:15 -04:00
Yamagi 6e45f5a66b
Merge pull request #810 from protocultor/prefweap
Added prefweap command to select weapon by priority
2022-04-13 11:51:33 +02:00
Yamagi c9a5bc5d03
Merge pull request #811 from protocultor/sdlbackbutton
Added cvar to define SDL gamepad's 'Back' button
2022-04-11 09:26:07 +02:00
Jaime Moreira fadb281ec9 Added cvar to define SDL gamepad's 'Back' button 2022-04-06 22:15:14 -04:00
Jaime Moreira f80e5224bb Added prefweap command to select weapon by priority 2022-04-06 15:28:34 -04:00
Yamagi 9d451faca5
Merge pull request #808 from devnexen/sw_useq
S/W last instance of strncpy usage.
2022-04-03 17:46:58 +02:00
Yamagi 8fa5ea3599
Merge pull request #807 from devnexen/config_settings_haiku
saving data into Haiku system user config.
2022-04-03 17:44:06 +02:00
Yamagi d827636c73
Merge pull request #804 from 0lvin/softcolorlight
WIP: Add color light to soft render
2022-04-03 17:43:38 +02:00