Commit Graph

579 Commits

Author SHA1 Message Date
Tim Angus
cb2974d8b4 Fix incorrect 'say:' prompt offset 2025-10-29 09:27:34 +00:00
Tim Angus
66330c72b0 Add con_scale, for high DPI displays 2025-10-29 09:27:34 +00:00
Tim Angus
f2c1f990f8 Use full screen width for console 2025-10-29 09:27:34 +00:00
Tim Angus
b3f148b848 Correct comment re console history 2025-10-27 12:42:54 +00:00
Tim Angus
0ebf1df742 XDG home directory support 2025-10-19 15:58:27 +01:00
Tim Angus
da4f9bd13d Fix demo command file completion 2025-10-18 17:54:19 +01:00
Tim Angus
12ae6973a6 Extend size of serverInfo_t.hostName (handle longer server names) 2025-10-17 14:20:53 +01:00
Tim Angus
7d0117c183 Make sound channel exhaustion warning a Com_DPrintf 2025-10-03 20:17:20 +01:00
Tim Angus
65a1da4a01 Enable format warnings under MinGW 2025-09-07 17:18:07 +01:00
Tim Angus
07b9c1bd83 Wrap __attribute__s in macros 2025-09-07 17:16:31 +01:00
Tim Angus
f976711fb4 Fix various warnings 2025-09-07 17:03:20 +01:00
Tim Angus
3b90b76d7f Rename FS_SV_* to FS_BaseDir_* 2025-09-04 15:40:55 +01:00
Tim Angus
cadc8ab017 Add FS_BaseDir_BuildOSPath and replace hacky uses of FS_BuildOSPath 2025-09-04 15:40:55 +01:00
Tim Angus
8dfedc60c1 Remove architecture from binary filenames 2025-08-29 21:30:17 +01:00
Simon McVittie
dc00968bc1 client: Remove i386 GNU assembler version of S_WriteLinearBlastStereo16()
This was the last remaining GNU assembler code that was in its own
independent source file, as opposed to being embedded in C code with
GNU `__asm__ volatile` or MSVC `__asm` (which tends to be much easier
to deal with in a modern build system).

When the Quake 3 engine was originally written, this might have been
an "expensive" function when written in portable C, but after 25 years
of CPU development it's less likely to matter (and modern compilers
might produce faster results from the C code anyway).

Resolves: https://github.com/ioquake/ioq3/issues/778
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-08-23 21:23:03 +01:00
Tim Angus
2d7100dc97 Fix HTTP downloads being disabled after first download (issue #768) 2025-08-23 11:48:43 +01:00
Tim Angus
6367fdfe28 Map SDL gamepad buttons to keys explicitly 2025-08-05 11:23:05 +01:00
Tim Angus
877bde8994 Make the fallback renderer the default renderer 2025-08-01 22:36:51 +01:00
Tim Angus
d07bf88ce9 Add USE_ARCHLESS_FILENAMES 2025-08-01 22:36:51 +01:00
Martin Gerhardy
2e753008d5 CLIENT: restore older curl version support 2025-07-29 18:17:45 +01:00
Pan7
96fefcb7c9 Replace USE_LOCAL_HEADERS with USE_INTERNAL_* 2025-07-29 17:32:18 +01:00
Tim Angus
1a256983ad Update OpenAL (headers) 2025-07-24 12:23:43 +01:00
Tim Angus
9814f5f42f Implement WinINet based HTTP downloads 2025-07-22 14:57:01 +01:00
Tim Angus
94c9be05c9 Pull out non curl specific code from the curl backend 2025-07-22 14:57:01 +01:00
Tim Angus
1cbba07fc3 Add abstract frontend to HTTP support and stop using curl on Windows 2025-07-22 14:57:01 +01:00
Tim Angus
bc30e0186b Fix curl deprecations and remove FTP support 2025-07-22 14:57:01 +01:00
Tim Angus
dfa0e23395 Update curl 2025-07-22 14:57:01 +01:00
Ryan C. Gordon
9901144641
cl_cgame.c: Fixed a typo in a comment. 2024-12-04 00:10:56 -05:00
Zack Middleton
3b984d2b51 OpenGL2: Add OpenGL ES 2.0+ support
This mainly targets OpenGL ES 2.0 but it also supports compiling GLSL as
ESSL 3.00. It's missing support for framebuffer objects which should be
possible on ES 2. (Though using renderbuffers instead of textures.)

opengl1 cvars that are not supported will display a message and disable
the cvar. This has not been reviewed for new opengl2 cvars. Enabling
cvars may cause rendering issues. Some of the broken cvars may be
possible to support using OpenGL ES 3 features.

The game displays okay with the default cvars.
2024-06-05 21:33:08 -05:00
Zack Middleton
70d07d91d6 Fix (disabled) Wavelet sound decompression
The first chunk of Wavelet sound was decoded as ADPCM and then
following chunks were decoded as Wavelet. It played as static
noise.

Using Wavelet compression requires engine code changes to enable.
2022-11-23 12:23:50 -06:00
Zack Middleton
f92c293f7b Add keys for SDL 2.0.14's new gamepad buttons
This fixes the additional buttons triggering binds for ioq3 left
and right joystick direction keys.
2022-09-22 09:18:22 -05:00
Mickaël Thomas
84daa28267 Fix memory corruption in S_TransferPaintBuffer
When using a non-default sound configuration (such as 6 channels), after
a long time (about 4.5hours for 6 channels at 22050 Hz) an overflow will
occur in `S_TransferPaintBuffer`, causing an out of bounds write into
the dma buffer.

The problematic line is:
```
out_idx = (s_paintedtime * dma.channels) % dma.samples;
```

With `s_paintedtime` large enough, the result of the multiplication will
overflow to a negative number (since `s_paintedtime` is signed), and the
index into the output buffer will be negative.
2021-12-08 18:46:58 +00:00
Ane-Jouke Schat
44b18d72ac Fix PRINT_ERROR print level missing from CL_RefPrintf
It's used for one message in the OpenGL2 renderer.
2019-04-15 23:13:36 -05:00
Zack Middleton
0cf10d2b77 Make s_info command display channels instead of stereo
channels-1 was displayed as '# stereo', affectively a boolean for
mono or stereo. However '3 stereo' for quad surround sound doesn't
make sense.
2018-10-01 22:31:36 -05:00
Zack Middleton
58b0fb07cd Fix SDL audio playback with 16-bit stereo sound
My commit last month "Fix SDL audio playback with surround sound" broke
16-bit stereo sound. S_TransferStereo16() still assumed that dma.samples
was a power of two. I also cleaned up code related to the previously
mentioned commit.
2018-10-01 22:28:51 -05:00
Zack Middleton
aab1d92b13 Allow binds to use hex values for all key codes 2018-09-30 14:40:02 -05:00
Zack Middleton
812a3dbfa5 Fix SDL audio playback with surround sound
If user has surround sound enabled, ioq3 would not play any sound.
Fix painting sound buffer for 4/5.1 audio channels. Extra channels
currently play no audio.
2018-09-13 12:58:23 -05:00
Simon McVittie
5909b9a1cf Isolate the Altivec code so non-Altivec PPC targets can use the same binary.
Moved all the code using Altivec intrinsics to separate files. This 
means we can optionally use GCC's -maltivec on just these files, which
are chosen at runtime if the CPU supports Altivec, and compile the rest
without it, making a single binary that has Altivec optimizations but
can still work on G3.

Unlike SSE and similar extensions on x86, there does not seem to be
a way to enable conditional, targeted use of Altivec based on runtime
detection (which is what ioquake3 wants to do) without also giving the
compiler permission to use Altivec in code generation; so to not crash
on CPUs that do not implement Altivec, we'll have to turn it off
altogether, except in translation units that are only entered when
runtime Altivec detection is successful.

This has been tested on Linux PPC (on an Altivec-enabled CPU),
but we may need further work after testing trickles out to other
PowerPC devices and ancient Mac OS X builds.

I did a little work on this patch, but the majority of the effort belongs 
to Simon McVittie (thanks!).
2018-05-12 14:14:47 -04:00
Zack Middleton
f3f29e9670 Make s_useOpenAL be CVAR_LATCH
After changing s_useOpenAL the sound needs to be restarted (snd_restart)
for it to take affect.
2018-05-01 16:18:44 -05:00
Ryan C. Gordon
69f92daf08 Added audio capture support to SDL backend.
This lets you speak through VoIP when not using OpenAL. Previously you could
listen but not speak.
2018-04-13 22:38:17 -04:00
Ryan C. Gordon
4f8c7c2f2f Support SDL audio devices that require float32 samples.
Fixes missing audio when playing on Windows with SDL 2.0.7, which started
using WASAPI, which demands floating point audio.
2018-04-13 14:05:12 -04:00
Zack Middleton
3ad427c68d Fix q3history buffer not cleared between mods and OOB-access
Loading a 1024-byte q3history file will fill the whole consoleSaveBuffer
leaving no space for a string terminator. Com_Parse will read at least
one byte beyond the end of consoleSaveBuffer. The written console
history file can only be 1023 bytes (enforced by Q_strcat) so don't
allow loading size of 1024.

If switching to a mod with a shorter q3history file, the data in
consoleSaveBuffer that isn't overwritten will be parsed. So always
add a string terminator.

String not terminated reported by David "devnexen" CARLIER.
2018-04-09 02:20:49 -05:00
Mickaël Thomas
e986384fde Maximize cURL buffer size
Allows higher download throughput (from ~2 MB/s to ~60 MB/s at 120FPS)

This has no effect for curl versions older than 7.53.0 (for which the
buffer can only be shrunk below 16k)
2018-04-08 22:40:37 -05:00
Dominic Fandrey
b8ee77cecc Avoid srcList[-1] in snd_openal.c 2018-04-08 21:41:31 -05:00
Dominic Fandrey
62cec249d7 Fix shift into sign in cl_cin.c 2018-04-08 21:41:31 -05:00
Dominic Fandrey
a494edeb94 Fix undefined behaviour due to shifting signed in snd_mem.c 2018-04-08 21:41:26 -05:00
Zack Middleton
738465d677 Revert my recent cvar latch changes
My cvar latch system changes prevent the Game VM from changing
g_gametype when the value is out of range due to it being registed in
the engine. It's been pointed out as fragile method of security, which
was still exploitable, by Noah Metzger (Chomenor). It doesn't seem like
this is working out to be a good solution.

The issue of fs_game '..' on server being relicated on client via
systeminfo exploit is still fixed as it's not affected by latch.
There are a few cases from current values of fs_game are used which
ideally should use fs_gamedir char array which has been validated.

Revert "Don't let VMs change engine latch cvars immediately"
Partially revert "Fix fs_game '..' reading outside of home and base path"
Revert "Fix VMs forcing engine latch cvar to update to latched value"
2018-01-21 22:45:46 -06:00
Zack Middleton
3638f69dff Fix fs_game '..' reading outside of home and base path
VMs could set fs_game to '..' at anytime to access files outside of home
and base path. fs_game sent by server to clients could also be '..' to
access files outside of home and base path.

'..' was not caught by FS_CheckDirTraversal() as it expects filenames
not a single directory.

I've made fs_game be latched to prevent VMs from changing it with no
good way to validate it before it's used. com_basegame and fs_basegame
are now latched as well.

Additionally, it's now possible to change com_basegame while the engine
is running. game_restart or vid_restart will make it take affect.
com_homepath is now CVAR_PROTECTED to prevent VMs from changing it
to a directory traversal.

This requires my two previous commits for preventing VMs from changing
engine latch cvars and only Cvar_Get fs_game in FS_Startup (so CVAR_INIT
isn't added in serveral other places).

Reported by Noah Metzger (Chomenor).
2018-01-21 06:02:28 -06:00
Zack Middleton
adef4e6c9e Don't register fs_game cvar everywhere just to get the value 2018-01-21 06:02:08 -06:00
Thomas Köppe
ed1794fe17 Change shift expressions to unsigned types. Shifting signed values to
a result that is not representable has undefined behaviour.
2018-01-21 06:01:50 -06:00