Commit Graph

2969 Commits

Author SHA1 Message Date
Tim Angus
fe9f611ed5 Fallback on legacy game library name if canonical name doesn't exist 2025-08-29 21:30:17 +01:00
Tim Angus
8dfedc60c1 Remove architecture from binary filenames 2025-08-29 21:30:17 +01:00
Jack Slater
92e9ddf02b
Update sv_init.c to point to new directory server address
directory.ioquake3.org has a new ip address as well
2025-08-28 22:41:32 -10:00
Tim Angus
3371603c50 OCD 2025-08-27 12:51:39 +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
Simon McVittie
9f0280bca1 Remove unused matha.S
Before commit a7d33b1c "(bug #3639) BoxOnPlaneSide rewrite" there
was more code here, but since then the only thing left is the
Invert24To16 function, to which I couldn't find any references since
the beginning of ioquake3's git history.

Resolves: https://github.com/ioquake/ioq3/issues/774
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-08-23 21:23:03 +01:00
Tim Angus
d133be28eb Add DEFAULT_RELATIVE_BASEDIR
Sys_BinaryPathRelative takes a parameter which is path concatenated with
Sys_BinaryPath, and resolved to a canonical path. The intended use case
is to facilitate the situation where you want the game data directory to
exist outside the same directory in which the binary lives, but relative
to it. More specifically, if you want to distriute multiple binaries for
different architectures, in the same tree, this allows for a means of
having said binaries in architecture subdirectories, with a shared data
directory, e.g.:

  ioq3/x86/ioquake3.exe etc.
  ioq3/x86_64/ioquake3.exe etc.
  ioq3/baseq3/pak0.pk3 etc.

Here, when building you would define DEFAULT_RELATIVE_BASEDIR=".." by
appending it to the build system CFLAGS, and then the executables will
by default look in their parent directory for the data.
2025-08-23 21:01:08 +01:00
Simon McVittie
9293a45368 asm: Remove unused S_PaintChannelFrom8
This is `#if 0` anyway, and has been since the initial Quake 3 Arena GPL
release, so clearly it hasn't been used for some time.

Signed-off-by: Simon McVittie <smcv@debian.org>
2025-08-23 12:04:28 +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
3aee97dfab Fix GCC x86 build 2025-08-22 18:38:46 +01:00
smallmodel
b297c596e9 Add Windows ARM platform 2025-08-19 11:00:27 +01:00
Tim Angus
a36d9bc392 Remove clientHtmlFallback 2025-08-13 13:06:14 +01:00
Tim Angus
787bdba0ec Rewrite the LCC process spawning code on Windows, to handle file names containing spaces 2025-08-12 20:10:46 +01:00
Tim Angus
0912659484 Move responsibility for defining NO_VM_COMPILED from build system to q_platform.h 2025-08-07 15:10:24 +01:00
Tim Angus
858ccc928c Add architecture guards to VMs 2025-08-07 15:10:24 +01:00
Tim Angus
2c91b38899 Simplify VM sources for old architectures 2025-08-07 15:10:24 +01:00
Tim Angus
1591f4ad1c Whitespace fixes 2025-08-05 21:15:09 +01:00
Tim Angus
31f79ca94e http -> https on URLs 2025-08-05 15:48:59 +01:00
Tim Angus
6367fdfe28 Map SDL gamepad buttons to keys explicitly 2025-08-05 11:23:05 +01:00
Tim Angus
282bd6513e Move third party code to code/thirdparty 2025-08-02 20:01:03 +01:00
Tim Angus
8976973d3b Move puff.* to renderercommon 2025-08-01 22:36:51 +01:00
Tim Angus
92fb145f43 Merge identical tr_subs.c into renderercommon 2025-08-01 22:36:51 +01:00
Tim Angus
9dfe9d6a6a Allow Windows icon to be set by defining WINDOWS_ICON_PATH 2025-08-01 22:36:51 +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
Tim Angus
cb11c5e339 Make client.html and Autotools style input file 2025-07-31 11:02:38 +01:00
Tim Angus
1a4abacaff Fix incorrect architecture detection on Windows 2025-07-30 12:31:44 +01:00
Tim Angus
b512b786ec Move Linux ARCH_STRING definition out of Makefile 2025-07-29 21:53:21 +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
7962686d2d Adjust resource path to quake3.ico
I'm aware this probably breaks the MSVC build, but

a) I think it's probably broken already
b) I have good reasons that will hopefully make this a non-issue anyway
2025-07-29 16:26:40 +01:00
Tim Angus
19f53d6fbe Cleanup opus and vorbis more 2025-07-29 16:11:46 +01:00
J.Ingram
934e7b9372 Call SHGetFolderPathA directly
Removing shfolder.h satisfies MSVC, and calling the function directly makes PFNSHGETFOLDERPATHA unnecessary.
2025-07-29 14:41:57 +01:00
Tim Angus
4303784442 *Don't* configure zlib so we get the generic zconf.h 2025-07-25 17:19:38 +01:00
Tim Angus
322883b65c *Don't* configure SDL so that we get the generic SDL_config.h 2025-07-25 14:45:42 +01:00
Tim Angus
69ad3699ea Update SDL 2025-07-24 20:29:53 +01:00
Tim Angus
a4d4b1743e Remove macOS ppc support 2025-07-24 18:41:52 +01:00
Tim Angus
1a256983ad Update OpenAL (headers) 2025-07-24 12:23:43 +01:00
Zack Middleton
1132abe3dc Replace strncpy usage with Q_strncpyz 2025-07-24 09:47:13 +01:00
Zack Middleton
c8553223ec Add range check for UI text buffer
It can't overflow because buff and text have the same max length (1024
and MAX_TOKENLENGTH).
2025-07-24 09:47:13 +01:00
Zack Middleton
797168fa08 Fix possible CGame network buffer overflow 2025-07-24 09:47:13 +01:00
Zack Middleton
84715f421b Ignore CHAR_WIDTH from C23 spec 2025-07-24 09:43:28 +01:00
Zack Middleton
ed2c470f50 Revert "Rename CHAR_WIDTH to CHARACTER_WIDTH"
This reverts commit 526edd37f9.
2025-07-24 09:43:28 +01:00
Tim Angus
fd0d65c439 Remove more dead 3rd party code 2025-07-22 20:32:11 +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
Tim Angus
279f4e5239 Be slightly more targetted in cleaning up jpeg source 2025-07-20 22:14:04 +01:00
Tim Angus
c3248e54a4 Undefine real error codes to fix warnings 2025-07-18 14:53:02 +01:00
Tim Angus
dede9aa79a Revert "define guards to prevent warnings" (fixes #737)
This reverts commit 20634976e9.
2025-07-18 14:53:02 +01:00
J.Ingram
465f72dcd4 Use PFNGETFOLDERPATHA typedef
FARPROC is defined with an empty parameter list, which newer versions of GCC consider equivalent to (void). Compilation fails when qSHGetFolderPath gets called with arguments.
2025-07-17 17:46:44 +01:00
Tim Angus
abc448faec Selectively disable -Warray-bounds 2025-07-14 17:47:18 +01:00
Tim Angus
75fb0ddccc Use correct abs function in FBO_FastBlit 2025-07-14 17:42:18 +01:00
Tim Angus
7095006414 Update libjpeg 2025-07-14 17:42:14 +01:00
Tim Angus
7af17542d2 Update zlib 2025-07-14 13:17:17 +01:00
Tim Angus
20634976e9 define guards to prevent warnings 2025-07-14 12:24:16 +01:00
Tim Angus
d89925ffba Fix a few misleading indentation warnings 2025-07-13 22:57:33 +01:00
Tim Angus
ac239a68fa Fix GCC warning 2025-07-13 22:57:32 +01:00
Tim Angus
28929ad213 Update xiph.org internal libs 2025-07-13 22:57:32 +01:00
Tim Angus
d793e38f58 Expand buffers to prevent potential truncation 2025-07-13 13:29:50 +01:00
Tim Angus
aea99aa3a3 Replace various sprintf calls with snprintf calls 2025-07-13 13:29:50 +01:00
cake
ab18167a09 fix minor spelling errors 2025-06-12 18:10:37 -04:00
James Darpinian
dac3062dde OpenGL2: Disable the VAO cache by default
The VAO surface cache uses glBufferSubData and triggers a very slow
path in some GLES implementations. Specifically I have observed 10x
frame times under Emscripten with ANGLE/Metal on macOS and with Mali
on Android.

Co-authored-by: Zack Middleton <zack@cloemail.com>
Co-authored-by: WofWca <wofwca@protonmail.com>
2025-06-12 18:02:28 -04:00
Trung Lê
526edd37f9 Rename CHAR_WIDTH to CHARACTER_WIDTH
For some time glibc has defined a macro with the same name in limits.h.
Avoid the warning by renaming our macro.
2025-03-16 09:53:12 +00:00
Tim Angus
c9697a0104 Rename LCC constexpr function to constantexpr, avoiding C23 keyword clash 2025-03-08 13:00:48 +00:00
Ryan C. Gordon
9901144641
cl_cgame.c: Fixed a typo in a comment. 2024-12-04 00:10:56 -05:00
smallmodel
cc18246f22 Prevent SV_DropClient() from being called recursively if the client is dropped by a kick or timeout and has too many reliable commands 2024-10-11 21:03:44 +01:00
Zack Middleton
009f520633 Change URL for missing files dialog 2024-10-10 16:46:27 -04:00
Zack Middleton
4ee389b6b2 Fix reading non-sequential lumps in AAS files in pk3 files
FS_Seek() doesn't always return 0 on success. If the file in a pk3 file
it returns the seek offset. This change doesn't fix any known AAS files.
2024-09-24 22:06:13 -04:00
Zack Middleton
00d60d05c4 OpenGL2: Increase flare limit to match opengl1 2024-08-29 16:42:51 -04:00
Zack Middleton
a1fe522d3d Show fs_homepath in Flatpak missing pk3 error
Tell users to copy pk3 files to fs_homepath as fs_basepath is not user
writable.
2024-08-28 21:56:38 -04:00
Zack Middleton
118a533cbf Use XDG_DATA_HOME for Flatpak
Use XDG_DATA_HOME for Flatpak so that fs_homepath is accessible without
special permissions/handling. This changes the home path for Flatpak
from ~/.q3a/ to ~/.var/app/org.ioquake3.ioquake3/data/q3a/.
2024-08-28 21:56:38 -04:00
Zack Middleton
7112bfb77f Make copy to clipboard in Windows error dialog include error message
There is a copy to clipboard option but the error itself wasn't printed
to the console so it wasn't copied to the clipboard.

Unix-like platforms print it to the console so it's written in
crashlog.txt.
2024-08-28 17:52:54 -04:00
Zack Middleton
e42db5b2b0 Make Team Arena pk3 error show when missing all pk3 files
The error was only displayed for Team Arena if one of the Team Arena pk3s
were found. Fix it to be display when trying to run Team Arena even with
no Team Arena pk3s present.
2024-08-28 17:52:54 -04:00
Zack Middleton
814e1755f5 Add better directions/error for missing default pk3 files 2024-08-28 17:52:54 -04:00
Zack Middleton
a575c1c710 OpenGL2: Fix still projecting sun shadows onto nothing
Increase the range for clamping the screen shadow depth to 1.0 (nothing
drawn). Old epsilon ~0.00000006, new 0.001. This fixes it on another
computer.
2024-08-28 16:52:20 -04:00
Zack Middleton
4c19ff2b55 OpenGL2: Don't project sun shadows onto nothing
Don't project sun shadows (r_forceSun 1) on to view depth equal to 1.0
(nothing drawn or skybox). This caused a full second shadow of the
entire level in tr.screenShadowImage. It would move as the camera far
plane changed and rotate/stretch strangely as the camera view changed.

It was visible in-game on lightmapped transparent surfaces facing the
skybox and happen to overlap the extra shadow of the level.

This affected the glass in wop_padship's underwater room.
2024-07-27 02:30:32 -04:00
Zack Middleton
15f5fe78ad Fix compiling without PATCH_STITCHING defined 2024-07-13 23:53:48 -04:00
James Darpinian
e505e34d79
Fix framerate throttling in Emscripten builds
Default com_maxfps to 0 under Emscripten. Under Emscripten the browser
handles throttling the frame rate. Manual framerate throttling interacts
poorly with Emscripten's browser-driven event loop.
2024-06-25 02:52:11 -04:00
Zack Middleton
99be1151f7 Fix web client vid_restart with r_mode -2
If getting the display index of the existing window fails, fallback to
the default display size instead of falling back to 640x480.

emscripten r_mode -2 worked on window creation but vid_restart fellback
to 640x480.
2024-06-24 22:38:48 -04:00
Zack Middleton
c1ab47a764 Rename client-config.json based on CLIENTBIN
Also make viewing client.html directly use client-config.json in the
same directory so it's possible to "live edit" both the files without
having to run make.
2024-06-11 04:40:08 -04:00
Zack Middleton
7bfd5c90b8 Add support for mods to web client
ioquake3.html?fs_game=missionpack will run Team Arena when not using
--preload-file.
2024-06-11 04:40:08 -04:00
Zack Middleton
2660bb4a03 Add support for overriding basegame to web client
List files for multiple games in a single client-config.json file so
that com_basegame argument can pick different game data.

Use ioquake3.html?com_basegame=demoq3 (or tademo) to run the Quake 3 or
Team Arena demo. They require new QVMs from baseq3/missionpack to run.
2024-06-11 04:40:08 -04:00
Zack Middleton
8365ea7ed2 Customize the web client HTML file
Modify the client HTML file when copying it to the build directory to
apply current CLIENTBIN and BASEGAME. It always loads engine/data from
the current directory (no need to try to locate the build directory).
2024-06-11 04:40:08 -04:00
Zack Middleton
e6c0776d98 Allow web client to use unzipped QVMs
Compile the QVMs and automatically uses them when not using --preload-file.
2024-06-11 04:40:08 -04:00
James Darpinian
db24dfe13f ioquake3.html replaces Emscripten-generated HTML shell
This enables several things:
* Optionally load pk3 files from a web server at runtime instead of bundling them with Emscripten at build time
* Set command line arguments via URL param
* It's not ugly
2024-06-09 22:10:52 -04:00
Zack Middleton
f41bd37fde Add minimal emscripten support 2024-06-06 20:51:44 -04:00
Zack Middleton
f869bffe97 OpenGL2: Fallback to OpenGL ES if OpenGL fails 2024-06-06 19:49:17 -04:00
Zack Middleton
551fa6c797 OpenGL2: Fix issues running under WebGL 2024-06-06 19:49:17 -04:00
Zack Middleton
98b9008c0d OpenGL2: Use CPU vertex animation if too few vertex attributes
OpenGL ES has a minimum of 8 vertex attributes while desktop OpenGL has
a minimum of 16. Vertex animation uses attributes 10 to 12.
2024-06-05 21:36:48 -05:00
Zack Middleton
b25a3c6e4d OpenGL2: Add run-time support for unsigned short indexes
OpenGL ES 2 is only required to support unsigned short for indexes.
2024-06-05 21:36:05 -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
Alan Zhao
aecf3f55ce
Use nanosleep(2) instead of usleep(3)
usleep(3) was declared obsolete in POSIX.1-2001 and removed in
POSIX.1-2008 and nanosleep(2) was recommended to be used instead.
2024-05-15 18:14:52 -04:00
Zack Middleton
5a918bfa96 opengl1: Fix skybox in OpenGL 1.1
Fix six image skybox having a black border around the sides of the sky
when using OpenGL 1.1 (using CL_CLAMP instead of GL_CLAMP_TO_EDGE).

It's technically visible in q3dm10 but it's more obvious in Team Arena
maps such as mpteam6.
2024-04-18 00:04:33 -04:00
Zack Middleton
f9547e4533 OpenGL2: Don't mix drawing to default framebuffer and FBO
Don't draw the world scene to a separate FBO from the rest of the
screen.

This fixes the world scene having HOM instead of seeing through to the
previously drawn content. World of Padman uses this to have a separate
3D scene for the sky and world in wop_padship for dynamic skybox.

This also makes r_ext_framebuffer_multisample apply to HUD models
instead of depending on r_ext_multisample (which doesn't work on Linux
with some Intel graphics).
2024-03-02 06:09:59 -05:00
Zack Middleton
7d711f8121 Fix running on Windows XP
Newer mingw-w64 changed default Windows version compatibility.
Need to specify older behavior for EnumProcesses() to avoid "missing
K32EnumProcesses()" runtime error.
2024-02-17 17:01:44 -05:00
Zack Middleton
9881c561ad OpenGL2: Fix flares behind mirror being visible
When r_ext_framebuffer_multisample > 0 was used, flares behind the
mirror in q3tourney6 were incorrectly visible. This was because it
checks scene depth in the depth prepass which only drew opaque
surfaces. It also needs to contain depth for mirror/portal surfaces.
2024-02-13 09:11:35 -05:00
Zack Middleton
5d60f6035a OpenGL2: Fix hack for tcMod transform on merged lightmaps
When using merged lightmaps, only change tcMod transform for tcGen
lightmap.
2024-02-10 16:23:54 -05:00