Commit Graph

2788 Commits

Author SHA1 Message Date
Johan Mattsson c2a0a7d986 Fix memset 2022-02-05 13:27:42 +00: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
Zack Middleton 75ae9119e6 Fix passing arguments to VM dylib on Apple M1
The engine function pointer to vmMain used variadic arguments but
the vmMain function in the dylib has explicit arguments. Evidently
the arguments are stored on the stack and/or registers differently.

Found by fretn.
2021-11-19 14:54:59 -05:00
Zack Middleton fe7325be29 Improve setting Microsoft Store path
Respect configured Program Files directory and use MSSTORE_PATH for
the directory name.
2021-11-06 21:04:06 -04:00
Zack Middleton d1d5a89aad OpenGL2: GL_DEPTH_TEXTURE_MODE was removed from OpenGL 3.0/Core
GL_DEPTH_TEXTURE_MODE defaults to GL_LUMINANCE. Code sets it here as
part of a workaround old nvidia drivers (apparently? the URL in comment
is dead). GL_DEPTH_TEXTURE_MODE was removed in OpenGL 3.0 / 3.2 Core
contexts and may be treated as an error.
2021-10-23 12:49:48 -04:00
Zack Middleton 1c8b1122c5 Fix being unable to enter Team Arena CD key
The CD key defaulted to spaces. Q3 UI uses text overwrite mode by
default so typing the CD key writes over the spaces. Team Arena UI
uses text insert mode by default so to enter the CD key the user
had to delete the spaces or toggling overwrite mode by pressing
the insert key.

Now the CD key defaults to empty so in Team Arena you can just type
it in.
2021-10-23 08:36:10 -04:00
Zack Middleton f734a2da9a Print full GL_EXTENSIONS list for OpenGL contexts before 3.0
Printing GL_EXTENSIONS list might be cut off for OpenGL contexts
before 3.0 due to glConfig.extensions_string being a limited length.
Instead get the full extensions list directly.

This was already fixed for OpenGL 3.0 and later contexts.
2021-10-23 07:31:38 -04:00
Zack Middleton f9ba7c667d OpenGL2: Fix r_grayscale 1 making everything solid black
Using LUMINANCE with OpenGL 3.2 Core contex results in all images being
solid black (in the menu, world, and the console). In the end the whole
screen was solid black except the intro video.

Store images in RGB and RGBA instead. This doesn't affect r_grayscale
visually. If there is issues with it now possibly using compressed
formats, then it would already be an issue for r_grayscale 0.9.
2021-10-23 06:36:45 -04:00
Tom Kidd de055995d0
Merge pull request #482 from tomkidd/vs2019
Upgrade to build and run from VS2019
2021-10-22 16:38:11 -05:00
Tom Kidd 3afe37a896 Modified MS Store path handling to better follow the pattern of Steam/GOG 2021-10-22 11:28:55 -05:00
Tom Kidd 3d06d07516 Addressed PR suggestions 2021-10-22 10:00:20 -05:00
Tom Kidd 294eeb3c1c Updated SDL 2.0.16 headers and Mac version of libraries to fix GitHub actions 2021-10-02 21:54:26 -05:00
Tom Kidd 2fef57fffa Merge remote-tracking branch 'upstream/main' into xcode 2021-10-02 21:30:17 -05:00
Tom Kidd bc96500fe6 Added missing variable. 2021-10-02 21:24:45 -05:00
Tom Kidd 7533dcd00b Addressed string concatenation issue and added dummy method for Mac/Linux 2021-10-02 21:21:10 -05:00
Tom Kidd 3c78fe2295 Merge remote-tracking branch 'upstream/main' into vs2019 2021-10-02 21:19:48 -05:00
Adam Mizerski 26780805c8 qsort cannot be called with NULL
resolves #519
2021-09-27 11:15:14 +01:00
Tom Kidd fa64d4f8a8 Added rudimentary support for automatically finding Microsoft Store version of Quake 3
Unlike the Steam and GOG support I'm not doing a registry search as I don't see anything in the registry that would show us the path. If we find more official ways to search for it later we can address that, in the meantime the path is just hardcoded to where it's installed by default.
2021-09-25 21:30:03 -05:00
Tom Kidd e987a81edf Update SDL2 to 2.0.16 2021-09-25 21:11:58 -05:00
Tom Kidd 0b45535613 Merge remote-tracking branch 'upstream/main' into vs2019 2021-09-25 20:40:58 -05:00
Tom Kidd 2dc9f006df Architectures in libSDL2 restored for ppc and i386
The ppc arch is the 2.0.1 that was there originaly.
The i386 arch is 2.0.16, now compiled with an SDK later than 10.9 so the Notarization process is cool with it.
So now all post-ppc SDL libraries are 2.0.16.
2021-09-25 17:50:22 -05:00
Tom Kidd 5c5a599929 UB2 now signs and notarizes, upgraded to SDL 2.0.16
Also works on Apple Silicon. Specific signing values are in a non-committed file, and the ub2 script only notarizes if a "notarize" flag is passed in on the command line.

NOTE: the SDL dylib currently only has x86_64 and arm64, will need extra work to graft those back in and keep the Notary service happy.
2021-09-18 18:40:12 -05:00
Zack Middleton 77d6cde137 Fix compiling against SDL 2.0.17
KMOD_RESERVED was replaced with KMOD_SCROLL.
2021-08-15 12:07:02 -04:00
James Canete bc8737d707 OpenGL2: Flip normals for backfacing triangles.
https://github.com/ioquake/ioq3/issues/513
2021-07-20 13:51:19 -07:00
Tom Kidd 96db7a064f Ad-hoc signed libSDL2-2.0.0.dylib 2021-07-19 23:44:26 -05:00
Tom Kidd b1ffdd1be0 Removed signature from SDL dylib, enabled dark mode on macOS. 2021-07-10 19:58:06 -05:00
Tom Kidd 46a793b5b3 Reverting alert style to deprecated methods
Until I can find a way to branch around this in a way Xcode 3 is cool with we'll just have to use the deprecated version
2021-07-06 17:30:27 -05:00
Tom Kidd eef3a40ed6 Restored original opus sse files, excluded from Xcode
Also added line break in script for consistency, thanks @zturtleman
2021-07-06 17:30:27 -05:00
Tom Kidd 1ab25673c5 Update SDL2 to 2.0.14 2021-07-06 17:30:27 -05:00
Tom Kidd 52a43ae1c4 Upgrades to Xcode project and Apple Silicon support
- Reorganized Xcode project
- Added missionpack support to Xcode project
- Incorporated changes from MaddTheSane for Apple Silicon support https://github.com/maddthesane/ioq3
- Built SDL 2.0.14 for Apple Siicon, added to existing SDL dylib
- Built SDLMain for Apple Silicon, added to existing libSDL2main.a
2021-07-06 17:30:27 -05:00
James Canete b8be5a8bd7 Fix line not removed in previous commit. 2021-07-06 00:18:06 -07:00
James Canete 69ec389335 Add r_parallaxMapOffset. 2021-07-05 21:59:20 -07:00
James Canete 66cb20a7f3 Add epsilon to avoid division by zero in CalcSpecular(). 2021-07-05 21:50:39 -07:00
Tom Kidd 693264caf4 Merge branch 'main' into vs2019 2021-06-26 18:19:31 -05:00
Ch40zz bc7842e301 Allow unwinding of qvmcall64 call-stub for msvc/masm
qvmcall64 has its own custom calling convention due to pushing all non-volatile registers to the stack. The game uses set/longjmp which on Windows uses "RtlUnwindEx" to unwind the callstack. qvmcall64 cannot be unwound by default due to the custom calling convention. To allow unwinding, we need to add custom SEH unwind data to the function.
2021-06-23 18:01:53 +01:00
Ch40zz 60a2000419 Fixes a crash when compiling the project on windows in 64 bit mode.
Not all non-volatile registers were actually saved and restored, leading to a few registers being trashed after calling the vm instructions.
All non-volatile registers have been added.
2021-05-20 10:12:38 +01:00
Zack Middleton 4003a5b78c Fix the number of weights in the IQM model calculation
[The fourth bone influence of each vertex was ignored. --zturtleman]

Patch by Romulo Fernandes (razor85).
2021-04-03 15:40:45 -04:00
Tom Kidd 3104945bc5 Updated SDL2 include files to fix Mac build in GitHub Actions 2021-03-08 17:41:59 -06:00
Zack Middleton 359db19619 Restore bots crushing unseen player on q3tourney6 in non-CTF
The affect of my 2017 commit c3e64d3806

    "Make bots only use q3tourney6 crusher to kill their enemy"

made it easier to beat the last map of the Quake 3 single player
campaign. It was mainly intended for CTF and Team Arena gametypes
variants of the map. (Team deathmatch is usually treated as deathmatch
with teams rather than an actual team based gametype.)

Restore original difficulty for non-CTF/Team Arena gametypes; bot will
crush player even if bot hasn't seen the player since either they or
player respawned. [This is not good in CTF where all five bots on the
team suddenly flip around and shoot at the crusher trigger.]

Team deathmatch still uses my added behavior of not triggering crusher
if there is a teammate under the crusher.
2021-02-27 00:26:03 -05:00
Zack Middleton eacb83a244 Allow using pulseaudio for SDL audio capture
Pulseaudio audio capture didn't stop when paused on Debian 8 but works
on Debian 9 when using the same manual SDL build. So it seems to have
been an issue in pulseaudio, not SDL.
2021-02-26 23:55:12 -05:00
Tom Kidd e274d7fa05 Update SDL2 to 2.0.14 2021-02-26 17:20:55 -06:00
Tom Kidd d82a1cb7b3 Upgrade to build and run from VS2019
- New msvc142 directory (keeping with naming after version of C compiler)
- Added SDL2.lib/SDL2main.lib back in (compiled from SDL 2.0.8 source from libsdl.org)
- Post build step to copy SDL2.dll to debug directory
2021-01-25 21:59:55 -06:00
Thomas Köppe d1b7ab6b22 [sdl] Turn tentative definition into actual definition.
There is no need for a tentative definition in this case. By providing
an explicit initializer, the resulting definition has the same effect
as before, but is no longer tentative. This avoids easy errors
resulting from multiple tentative definitions in different translation
units. (Previous compilers permitted those common errors, but GCC 10
rejects them by default.)
2020-11-17 18:08:13 +00:00
Jack Slater e7a7a2b6b6
Merge pull request #436 from Calinou/default-texturemode-mipmap-linear
Use `r_texturemode GL_LINEAR_MIPMAP_LINEAR` by default
2020-09-29 16:56:30 -10:00
Tim Angus 8e74119d0f Avoid platform sed differences 2020-09-08 13:25:50 +01:00
Tim Angus 909ab13aeb Make LCC path resolution more robust 2020-08-29 21:40:57 +01:00
r-a-sattarov daae32ddfd E2K: fixed build by MCST lcc compiler when using USE_CURL=1 option 2019-12-07 08:16:15 -05:00
Hugo Locurcio 2171d070de
Use `r_texturemode GL_LINEAR_MIPMAP_LINEAR` by default
This improves visual quality without a noticeable performance loss,
especially on maps that use textures with high-frequency details
such as q3dm1.
2019-11-20 20:55:52 +01:00
Zack Middleton a6e66700e1 Fix duplicate team join center print for bots and g_teamAutoJoin
My 2017 commit f7c3276 ("Fix g_teamAutoJoin and g_teamForceBalance")
caused BroadcastTeamChange() to be run an extra time when bots connect.
This caused a duplicate center print message to be sent to all clients.

g_teamAutoJoin 1 sent an extra center print when any player or bot
connects. Though that is the original behavior from Team Arena.

Team set during connection no longer sends broadcast as it will be
sent later in ClientConnect().

Reported by Pascal Brochart (pbrochart) as causing clients to be
kicked due to server command overflow if many bots join at the
same time.
2019-11-16 01:38:38 -06:00
Zack Middleton dc0c3e7bdf Fix team orders menu not listing clients with lower clientnums
If bots join before the local client (dedicated server) the bots would
not be listed in the Q3A team orders menu and so they could not be given
orders using the menu.

The Q3A team orders menu got local client's team while looping through
all clients. Ignoring any bots with clientnum lower than the local
client. Get local client's team before the loop so all bots are
listed.
2019-10-28 23:13:57 -05:00