Commit graph

3922 commits

Author SHA1 Message Date
Yamagi
a4e23e6fd9 Force C standard to gnu99 in cmake builds.
The Makefiles forces gnu99 since ages. Additionally gcc15 started to
default to C23 and our code doesn't (yet) build with it.
2025-02-22 11:42:27 +01:00
Yamagi
404450d186 Add a CI build for Linux/aarch64.
It's called aarch64 instead of arm64 because that is what we are using
as internal architecture descriptor in savegames, etc.
2025-02-09 11:15:24 +01:00
Yamagi
b607eb4d42 Rename linux.yml to linux_amd64.yml in favor to upcoming aarch64 build. 2025-02-09 11:14:47 +01:00
Yamagi
ec18568bd7 Make clear that the Win64 build is SDL3 instead of SDL2. 2025-02-09 11:07:11 +01:00
Yamagi
4b18825805
Merge pull request #1184 from 0lvin/partial_fix_stb
sdl3: Fix memory leak in IN_Controller_Init
2025-02-09 11:06:08 +01:00
Yamagi
aa43b2df8c Update CI to use 4 CPUs on Linux and Windows. 2025-02-09 10:58:58 +01:00
Denis Pauk
971b2d1360 sdl3: Fix memory leak in IN_Controller_Init
Detected by ASAN=1
Build Win64-SDL3 as part of github actions
2025-02-09 00:58:00 +02:00
Yamagi
4fe0d0be6b
Merge pull request #1183 from protocultor/sdl3_buttons
Consistent binding between multiple gamepad types + labels by style
2025-02-08 16:55:59 +01:00
Yamagi
39c81b8afc
Merge pull request #1181 from 0lvin/partial_fix_stb
update stb_* codes to latest master
2025-02-08 16:48:24 +01:00
Denis Pauk
720223bcb0 Add MacOS DMG build
Based on #542
2025-02-04 00:36:51 +02:00
Denis Pauk
b55452f20c Update stb from NBickford-NV/stb fork
wget https://raw.githubusercontent.com/NBickford-NV/stb/ce191b546e4efd91b9e35ab9de0a320eb02ddc1b/stb_image.h -O src/client/refresh/files/stb_image.h
wget https://raw.githubusercontent.com/NBickford-NV/stb/ce191b546e4efd91b9e35ab9de0a320eb02ddc1b/stb_image_write.h -O src/client/vid/header/stb_image_write.h
wget https://raw.githubusercontent.com/NBickford-NV/stb/ce191b546e4efd91b9e35ab9de0a320eb02ddc1b/stb_vorbis.c -O src/client/sound/header/stb_vorbis.h
2025-02-03 23:26:14 +02:00
Denis Pauk
074c938c56 update stb_* codes to latest master (5c205738c191bcb0abc65c4febfa9bd25ff35234)
wget https://raw.githubusercontent.com/nothings/stb/master/stb_image.h -O src/client/refresh/files/stb_image.h
wget https://raw.githubusercontent.com/nothings/stb/master/stb_image_write.h -O src/client/vid/header/stb_image_write.h
2025-02-03 23:19:01 +02:00
Jaime Moreira
a7551dae26 Refactor for joy_confirm operation
Removed consecutive comparisons in Key_GetMenuKey()
2025-02-03 14:29:56 -03:00
Jaime Moreira
29d95e3388 Fixed gyro_mode irregular behavior
"Always on" now works properly.
New default values for gyro sensitivity.
2025-02-03 10:07:00 -03:00
Jaime Moreira
c27ce2a7bf Gamepad's left stick allowed to navigate menus
Uses logic from the triggers handling.
2025-02-02 17:44:39 -03:00
Jaime Moreira
9e07dc2485 Cvar to set gamepad's confirm & cancel buttons
Autodetect again needs SDL 2.0.12.
Status bar has correct button prompts in gamepad binding menus.
2025-02-02 16:58:22 -03:00
Jaime Moreira
1d6d17beb3 Button labels by type of Gamepad
Visible only in "customize button" menus.
Cvar set to 'autodetect' by default, which requires SDL 2.0.12
2025-02-02 15:49:37 -03:00
Jaime Moreira
f995839e4b Don't use keynames for gamepad button names
Faster to look for them in their own array.
Fixed GLES1 warning on compilation with SDL3.
2025-02-02 12:41:17 -03:00
Jaime Moreira
b23bfb6ee2 Gamepad buttons are now SDL3 style
Uses button position instead of label.
SDL2 has to be forced to do this by disabling a hint.
Deleted redundant JOY_BACK definition, it's just the Escape key.
Renamed 'in_sdlbackbutton' to 'joy_escbutton'.
2025-02-02 11:38:43 -03:00
Yamagi
b8a6f2b760 Remove superfluous hints regarding rumble on Playstation gamepads.
SDL3 replaced the Playstation specific hint to the more generic
SDL_HINT_JOYSTICK_ENHANCED_REPORTS hint which is enabled by default.

Pointed out by @erysdren and @protocultor in #1178.

Based on PR #1178 by @erysdren.

Closes #1178.
2025-02-02 10:25:33 +01:00
Yamagi
9e127cf71f
Merge pull request #1175 from 0lvin/1173_crash
Make more function local and use const with names
2024-12-22 19:28:16 +01:00
SiemensSchuckert
49b4e97f5d
disable certificate validation for HTTPS (#1174)
disable certificate check for HTTPS

disable SSL certificate check - to allow download from servers with self-signed cert, or when some certs are missing from system certificate store that CURL uses

add new cvar `cl_http_verifypeer`
2024-12-22 19:12:48 +01:00
Denis Pauk
f70ec69470 hide local functions under static
Also apply recomentadion of msvc for use size_t with strlen.
2024-12-21 13:50:08 +02:00
Denis Pauk
02e6784111 renders: make pic name const 2024-12-21 13:03:44 +02:00
Yamagi
7211e06c8c Fix drawing of UDP download progress bar with r_consolescale > 1.
When calculating the Y position of the UDP download progress bar the
scale factor must be taken into account. Otherwise the bar will be drawn
outside the visible area of the console. This was missed when scaling
was first implemented years ago and broken since then.

Reported by @SiemensSchuckert, closes #1172.
2024-12-21 10:10:42 +01:00
Yamagi
290c9ecabe
Merge pull request #1170 from protocultor/wpn_preview
Sound backend selector + weapon preview for cycleweap
2024-12-21 09:51:42 +01:00
Jaime Moreira
d3a98cf66b Text simplified for sound backend menu option
"Quality vs performance" might not correspond to reality; text deleted.
Documentation updated to reflect current state of both OpenAL and SDL
sound systems.
Authored by @Yamagi.
2024-12-20 16:36:53 -03:00
Yamagi
8c8488657c Fix less planes reserved for hull box testing than used down below.
This is an original bug, already present in Vanilla Quake 2.

Reported by @m-x-d, closes #1171.
2024-12-20 15:30:32 +01:00
Yamagi
cdf1cba106 Correct strncmp() checks in download code.
Reported by @m-x-d, closes #1167.
2024-12-20 15:24:27 +01:00
Yamagi
9522e9e490
Merge pull request #1169 from SiemensSchuckert/HTTP_dnl2
fix HTTP download crash (on 404)
2024-12-20 11:38:07 +01:00
Yamagi
bc168a7bfa
Merge pull request #1168 from SiemensSchuckert/HTTP_dnl1
fix HTTP download crash (on empty file)
2024-12-20 11:37:41 +01:00
Jaime Moreira
60f0fdd969 Makefile parameter to disable SDL Gyro support
"make NO_SDL_GYRO=1" disables sensor reading support and forces
behavior of SDL < 2.0.14 under any version, even SDL 3.
Meant for Arch Linux ARM, which supports 2.30.10 at this time, but
doesn't support gyro readings (no HIDAPI support?), even if it shows
an additional "IMU joystick" when connecting Nintendo gamepads.
This commit allows to use the "IMU joystick" in game, extending #990.
Identification of joysticks as "IMU" or "Left Joy-Con" is more
generic now, covering more possible naming conventions.
2024-12-15 22:51:56 -03:00
Jaime Moreira
661761f047 Gamepad Gyro properly detected in SDL3
Using correct return value for SDL_SetGamepadSensorEnabled now.
Added menu command for gamepad sticks.
2024-12-15 22:22:28 -03:00
Jaime Moreira
5d201fce9a GL1 water warp effect
A basic "squeeze/stretch" effect to fov when diving underwater.
Intensity is controlled by gl1_waterwarp, 0 disables the effect.
Original from Fitzquake.
2024-12-11 21:05:27 -03:00
Jaime Moreira
6a3a081b4b Refactored gluPerspective-like function in GL1
It was being called repeteadly with the same parameters, so it was
re-written with only one needed parameter, with the rest of the data
being obtained inside the function, to avoid logic duplication.
2024-12-11 20:46:53 -03:00
Jaime Moreira
6b8cd8fdf9 Weapon preview for cycleweap
'Pickup style' just like weapprev/weapnext, only works when cycleweap
is called with 3 or more parameters.
Weapon binds in gamepad menus now include xatrix and rogue weapons.
2024-12-04 18:57:19 -03:00
Jaime Moreira
1825aa9723 Sound backend selector
Changes s_openal, replaces sound quality selector.
2024-12-04 18:53:57 -03:00
SiemensSchuckert
4cb319216f
fix HTTP download crash (on 404)
change parameter type to match CURL lib

(prevents crash on HTTP download)


example

test server:
q2.bot.nu:27912

server config:
set sv_downloadserver "https://quake2.pages.dev/"
map DEBEQUA2


Client connects, and three files added to queue:

HTTP download: /.filelist - Queued
HTTP download: /maps/DEBEQUA2.filelist - Queued
HTTP download: maps/DEBEQUA2.bsp - Queued


 from URL:
https://quake2.pages.dev/.filelist		- no file
https://quake2.pages.dev/maps/DEBEQUA2.filelist	- no file
https://quake2.pages.dev/maps/DEBEQUA2.bsp	- exists

when 404 response received for '.filelist' file,
CL_HTTP_Recv() is called and uses wrong file length in malloc()


one of tests:

==43024==ERROR: AddressSanitizer: requested allocation size 0x8000000000000000 (0x8000000000001000 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    0 0x7ffff74b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    1 0x55555566b023 in CL_HTTP_Recv src/client/curl/download.c:98
    2 0x7fffcbcc257a  (/lib/x86_64-linux-gnu/libcurl.so.4+0x5157a)
2024-12-04 18:54:45 +03:00
SiemensSchuckert
03d22045ad
fix HTTP download crash (on empty file)
when empty filelist downloaded from HTTP server,
CL_ParseFileList() uses unallocated buffer for strchr()

segfault happens:

0  __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:65
1  0x00007ffff743de2c in __interceptor_strchr (s=0x0, c=<optimized out>)
    at ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:705
2  0x000055555566d7f8 in CL_ParseFileList (dl=0x55555587a178 <cls+20984>)
    at src/client/curl/download.c:484
3  0x000055555566e26c in CL_FinishHTTPDownload ()
    at src/client/curl/download.c:670
2024-12-04 18:51:47 +03:00
Yamagi
9f6c455b45 Fix usage, the command is named dumpuser and not info.
This is likely a left over from some earlier version. Noticed by @m-x-d.
Closes #1166.
2024-11-30 16:30:55 +01:00
Yamagi
6ff7413b65
Merge pull request #1163 from ps5-payload-dev/master
Simplify compiling for targets that lack GL drivers
2024-11-23 14:52:46 +01:00
John Törnblom
e21e057b04 backends: ensure _wgetcwd() is declared when compiling for windows 2024-11-23 13:39:40 +01:00
John Törnblom
24888cc3c1 backends: add portable variant of getcwd 2024-11-23 13:12:36 +01:00
John Törnblom
e87bcfb906 backends: ensure unistd.h is included when compiling for apple OSes 2024-11-23 13:11:19 +01:00
Yamagi
8b9f506a50
Merge pull request #1162 from devnexen/cmdparser_optim
cmdparser/server command little optimisations.
2024-11-23 08:49:48 +01:00
John Törnblom
9700eb6baf cmake: only gl1 renderer needs to be specifically linked 2024-11-17 01:34:07 +01:00
John Törnblom
38843f0f33 backends: when failing to determine executable path, print full path to cwd instead of just ./ 2024-11-16 15:53:43 +01:00
John Törnblom
c0eda78e43 sdl2: avoid spamming warnings when setting relative mouse mode fails 2024-11-16 15:52:24 +01:00
John Törnblom
0ea0dbf4ac ref_soft: check if renderer and texture are created correctly during context initialization 2024-11-16 15:51:58 +01:00
John Törnblom
ccc9027b1a ref_soft: if SDL renderer does not support SDL_RENDERER_ACCELERATED, fallback to SDL_RENDERER_SOFTWARE 2024-11-16 15:51:44 +01:00