Commit graph

1668 commits

Author SHA1 Message Date
Feels Duck Man
cf5b3687f2 Added an option to draw speed under the crosshair with cl_showspeed 2, fixed drawing the speedometer when the game wasn't playing. 2024-03-10 10:26:53 -05:00
Feels Duck Man
9cff22b55c Removed 'Speed' label for speedometer when being displayed 2024-03-02 13:54:43 -06:00
Feels Duck Man
cfece2f55d Added a speedometer that displays the player's speed in QU/s. Wasn't quite sure how to implement it without adding GetPlayerSpeed() to pmove.c. Unsure if there is a cleaner way to do this while keeping it inside cl_screen.c 2024-03-01 14:05:36 -06:00
Yamagi
e72ef48ae7 Add gl4 to the video menu renderer list.
GL4 is community maintained variant of GL3 using somewhat more up to
date OpenGL APIs. Requsted in #1045.
2024-02-03 16:18:06 +01:00
apartfromtime
8beb3d8a2e Case insensitive sort for player skins
Case insensitive compare in quicksort compare function for player names.

Closes #1082
2024-02-02 21:33:14 +11:00
Jaime Moreira
adf638d1f4 Controller buttons read more succinctly 2024-01-06 13:35:48 -03:00
Jaime Moreira
fb46007bc3 Fixed gl1_overbrightbits limiter, for real now
Allowed values are 0, 1, 2 and 4 only.
Updated documentation, again.
2024-01-06 13:32:48 -03:00
Jaime Moreira
9f9c212648 OpenGL 1 errors are visible now
Needs DEBUG=1 to enable
2024-01-06 13:29:13 -03:00
Yamagi
e40f5d1480
Merge pull request #1077 from apartfromtime/Fix-duplicate-entries
Fix duplicate menu key keyboard entries
2023-12-19 18:33:39 +01:00
apartfromtime
87ae381ed2 Attempt to fix indentation 2023-12-18 09:27:57 +11:00
apartfromtime
1570baee4d Remove superfluous switch statement 2023-12-18 08:52:35 +11:00
apartfromtime
089a1cd53f Fix duplicate menu key keyboard entries
Fixes a bug where duplicate keyboard entries would occur in menu fields when using the keypad keys with num-lock on.

Adds `IN_NumpadIsOn` function returning the state of the numpad key.
2023-12-17 09:55:58 +11:00
apartfromtime
ef456964e3 Revert "Fix duplicate menu key keyboard entries"
This reverts commit 2180ca6c40.
2023-12-17 08:18:38 +11:00
apartfromtime
2180ca6c40 Fix duplicate menu key keyboard entries
Fixes a bug where duplicate keyboard entries would occur in menu fields when using the keypad keys with num-lock on.
Menu fields now mirror behaviour of the console field.
Removed keypad left arrow case from console key ignore list.
2023-12-12 14:29:52 +11:00
apartfromtime
71570bb2ef Revert changes to shaders
Uses min/max from shader language.
2023-12-09 12:28:30 +11:00
apartfromtime
f0d2c5afaa More min\max function renaming
Missed function renaming.
2023-12-04 22:59:31 +11:00
apartfromtime
9ac19de4ac Rename min\max to avoid conflict with c-plus plus
While trying to compile the yquake2 rebased heretic2 source from 0lvin, a name conflict with min\max of different parameter counts included by a std::cpp library occurred.
2023-12-01 11:58:21 +11:00
Yamagi
90402c3f85 Move miniz into a subdirectory.
An upcoming update will add several files, having miniz in it's own
subdirectory makes it clear what belongs to it an whit to unzip.
2023-11-23 18:21:44 +01:00
David Carlier
a5192af173 fix curl uaf previous fix. 2023-10-25 18:46:03 +01:00
Jaime Moreira
36bf9de5a8 Typos 2023-10-18 20:37:49 -03:00
Jaime Moreira
fa218c9f4c Fixed gl1_overbrightbits limiter
Allows values between 0 and 4. Updated documentation.
2023-10-18 20:35:51 -03:00
Yamagi
5c642b6a5b
Merge pull request #1061 from DanielGibson/curl-uaf-fix
Fix use-after-free bugs in htttp download code
2023-10-15 18:09:25 +02:00
Yamagi
73c3afd47e
Merge pull request #1060 from devnexen/constify_it
"constifying" where underlying C calls expect compile time constants.
2023-09-16 18:14:17 +02:00
David CARLIER
3b8053edae "constifying" where underlying C calls expect compile time constants. 2023-09-16 16:20:21 +01:00
Daniel Gibson
3c8f087bb5 Fix use-after-free bugs in htttp download code
CL_RemoveFromQueue(qdlqueue_t *entry) free()s that entry, so the loops
that call q->next after CL_RemoveFromQueue(q) are accessing free'd
memory. Fix that by getting a pointer to the next entry before calling
CL_RemoveFromQueue().

Also did a tiny non-functional change to CL_RemoveFromQueue() to
make it easier to understand.
2023-09-16 16:59:31 +02:00
Yamagi
43e2a67f12 Fix indention problems introduced in the last commits. 2023-09-16 16:33:13 +02:00
Yamagi
49d4f2ce1f Merge remote-tracking branch 'menu/oss' 2023-09-16 16:30:04 +02:00
Yamagi
4afcd900cc
Merge pull request #1049 from protocultor/g_swap_speed_fix
Fix for g_swap_speed behaviour with extreme values
2023-09-14 21:01:42 +02:00
Jaime Moreira
9821c4b0a2 Show correct replacement for gl_lightmap cvar
Typos corrected
2023-08-26 19:18:24 -04:00
Jaime Moreira
c2ab0f61d7 Fixed Zoid Kirsch's name in credits 2023-08-26 19:10:26 -04:00
Johan Mattsson
9c929ab463
Fix potential index out of bounds 2023-08-13 18:04:04 +02:00
Denis Pauk
63d990487a models: ignore sprites/skins bigger than MAX_MD2SKINS 2023-07-02 00:30:21 +03:00
Denis Pauk
5c0883594f cl_cin: Support of RGBA png/jpg image with r_retexturing as cinematic 2023-07-02 00:03:18 +03:00
Denis Pauk
86dd7e6d2d Remove redudant rserr_invalid_fullscreen check 2023-07-01 23:17:17 +03:00
Yamagi
cb317f2cd3
Merge pull request #1031 from protocultor/g_swap_speed
Cheat to speed up "weapon change" animations
2023-07-01 16:21:42 +02:00
Yamagi
8855d650c6
Merge pull request #1030 from devnexen/compile_time_checks
adding compile time assertion support whenever possible
2023-07-01 16:10:34 +02:00
Jaime Moreira
c5e2d51fd7 Cheat cvar "g_swap_speed" implemented
Allows to skip frames of "putting down weapon" and
"raising weapon" animations, speeding them up.
2023-06-28 15:28:40 -04:00
David Carlier
ce3e9136a8 adding compile time assertion support whenever possible
and convert some runtime which deserve to be evaluated earlier.
2023-06-17 16:37:29 +01:00
David CARLIER
1ce09d7ef9 R_SetFrustum micro optimisation. 2023-06-16 13:06:05 +01:00
Yamagi
9212ded546
Merge pull request #1011 from devnexen/cl_setenv_overflow_fix
fix potential overflow on env vars settings.
2023-06-05 19:15:56 +02:00
Rykita
cd351a0602 Fixed vid_pauseonfocuslost, final. 2023-05-25 23:59:26 +02:00
apartfromtime
be1e6e1743 Fix pause/un-pause on window focus gained or lost
Fixed pause/un-pause on window focus gained or lost in pull request #1017.
Fixed ogg playback when switching video options, missed in #1004.
Fixed ogg playback when the last menu closed, misplaced in #1004.
2023-05-25 15:33:12 +10:00
Rykita
8cbbfaae9e Pause on Minimized/Focus Lost is now in the options menu 2023-05-24 16:42:36 +02:00
Daniel Gibson
218ac53ce9 GL3: Add hack to make lava glow, fix #1014
Normal warping surfaces (SURF_DRAWTURB) with water etc should use
brightness 0.5*intensity (like they did before), but those with lava
should be brighter, so use 1.0*intensity in the shader.
The reason that intensity needs to be scaled down is that these surfaces
have no lightmaps, so they'd be rendered fullbright otherwise.

I'm using the simple heuristic of texturename contains "lava" to
detect lava textures.
2023-05-20 21:07:16 +02:00
Yamagi
51cdc80525 Fix game with older SDL versions.
The window `flags` must be returned always, otherwise there won't be
usable Window flags and the game doesn't start.
2023-05-20 16:26:02 +02:00
David CARLIER
07553f0980 fix potential overflow on env vars settings.
changing a bit Q_strlcpy flow as it can report wrong bytes copied
if src > buffer size.
2023-05-14 19:16:18 +01:00
Yamagi
5f03705c5d Update stb_image.h to v2.28. 2023-05-14 10:01:04 +02:00
Yamagi
dbc0fa12ec Update glad-gles3 to it's latest version. 2023-05-14 09:57:45 +02:00
Yamagi
83fd0d092e Update glad-gl3 to it's latest version. 2023-05-14 09:55:37 +02:00
Yamagi
a5560ff3a2 Implement high dpi awareness into the client and all renderers.
Over the last years high dpi displays became increasingly popular. We
already implemented very basic high dpi support for Windows several
years ago by setting the "please don't scale us" option. Linux (and
all other unixoid platforms) hadn't a real understandig of high dpi
and everything involved until the advent of Wayland and finally the
*fractional-scale-v1* protocol last autumn.

Since then SDL (even bevore the protocol was finalized) and all three
common Wayland compositors (Gnome, KDE and wlroots) have grown support
for the protocol and are now high dpi aware. In a high dpi aware world
the choice is scale yourself or get scaled by the compositor. The later
option isn't so good for fast paced games like Quake II, it introduces
blur and slugishness. Therefore implement hig dpi awareness through SDL.

This isn't perfect right now:
* SDL is still getting high dpi awareness fixes with every release. High
  dpi awareness in YQ2 is currently limited to at least SDL 2.26 and we
  may rise the required version even more if necessary.
* There are stll bugs in the compositors. For example Gnome 44.1 has a
  tedency to misscalculate the space occupied by the fullscreen window,
  the game ends up wit a white bar on top. sway even misscalculates
  some scaling factors: https://github.com/swaywm/sway/issues/7463
* SDL hasn't got a reliable way to get the real non scales desktop
  resolution.

Because of this:
* High dpi awareness is currently restricted to Wayland. Let's get one
  platform right before we implement it for everything else.
* It's hidden behind `vid_highdpiawareness` and disabled by default.

High dpi awareness is implemented by setting `SDL_WINDOW_ALLOW_HIGHDPI`
on the window. After the window and rendering context are created
`SDL_GL_GetDrawableSize()` or `SDL_GetRendererOutputSize()` are used
to query the actual drawable size and the internal representation is
overwritten with it.

This would scale the fullscreen window over the full screen, no matter
what resolution was selected. Some work arounds are implemented to
(mostly) keep the old behaviour were resoltions lower than the desktop
resolution weren't scaled. There is one inconsistency: While the non
high dpi aware soft renderer always scaled over the full screen, the
high dpi aware variant doesn't. This is a restriction by SDL Renderer.

Setting native fullscreen was broken before when running on high dpi
displays and it's not fixed. This is caused by SDL being unable to
determine the real resolution (or whatever the compositor thinks the
real resolution is). Depending on the compositor or if the client is
high dpi aware the correct resolution must be set by hand **or** auto
setting with `r_mode -2` must be used. Resolution detection was switched
to `SDL_GetCurrentDisplayMode()` because it's somewhat less problematic
than `SDL_GetCDesktopDisplayMode()`.

The renderer API was extended by one function pointer `*GetDrawableSize`
used to communicate the actual drawable size between renderer and
client. The API version was bumped to 6. I'll fix ref_vk before pushing
this change to master.
2023-05-14 09:44:23 +02:00