Commit Graph

2832 Commits

Author SHA1 Message Date
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
Zack Middleton f717a8396e Fix lightning gun handling for corpses and single player podiums
The lightning trail is fired from the real non-predicted entity for
the local client so it can show the server location. The real client
entity was always used to check if a player entity is firing the
lighting gun. This potentially causes corpses and players on single
player podiums with lightning gun to render the lightning trail if
the real (living) client is firing the lightning gun.

I'm not aware of this causing any issues without modifying the game
logic. Corpses have no weapon and it's not possible to fire during
single player intermission.
2019-10-11 20:55:57 -05:00
Colton G. Rushton 9500f06b8f Minor typo correction to be_aas_file.c 2019-08-28 01:13:17 -03:00
Colton G. Rushton 793fe4e603 Fixed another minor typo or two 2019-08-28 01:13:17 -03:00
Bernhard M. Wiedemann a96f32eba2 q3rcc: Allow to override build date
Allow to override __DATE__ and __TIME__ with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

This behavior is what gcc already does.
2019-07-11 14:20:31 +01:00
Zack Middleton 350b8f9c7c Restore OpenGL 1.1 support (GL_CLAMP)
GL_CLAMP (clamp to border) was changed to GL_CLAMP_TO_EDGE in 2008
(f2baf359). In 2018 (ce1d5406) I made OpenGL 1.2 be required since
GL_CLAMP_TO_EDGE is used.

Restore support for GL_CLAMP in order to support OpenGL 1.1 like vanilla
Quake 3 does. This should allow using the default Microsoft Windows
GDI Generic OpenGL 1.1 driver (untested but it won't fail the version
check at least).

From gpuinfo.org, it looks like drivers stopped advertising support for
GL_SGIS_texture_edge_clamp so use a version check in addition to the
extension check.

r_allowExtensions 0 disables using GL_CLAMP_TO_EDGE in the opengl1
renderer. GL_CLAMP support wasn't added to the opengl2 renderer.
2019-05-28 22:44:57 -05:00
Zack Middleton 0fbde293db Remove erroneous newlines from Com_Error in sdl_glimp.c 2019-05-28 21:01:28 -05:00
Zack Middleton 2a2646fe43 Fix IQM quat normalize fail case
Should only happen with invalid models though.
2019-05-28 21:00:02 -05:00
Zack Middleton 95b9cab4d6 Fix warnings that IQM blendWeights may not be initialized 2019-04-29 15:01:47 -05:00
Zack Middleton d404519cce Fix rendering IQM models between model frames
For lerped frames (refEntity_t frame not equal oldframe) IQM joint
matrices may have incorrect axis scale. This can cause significant model
distortion. The matrix lerp is linear causing each vector to move in a
straight line between frames instead of arcing like a circle. Each joint
frame can have a different scale so can't just normalize the joint
matrix.

Store joints as quaternions and spherical lerp between them and then
convert to a matrix. For my test model, setting up the skeleton is four
times slower now but it still seems to be fast enough to be usable.
2019-04-29 15:01:47 -05:00
Zack Middleton d13d06424e OpenGL2: Disable r_cubeMapping if not OpenGL 3.0+
r_cubeMapping requires textureCubeLod() which is only in OpenGL 3.0
(GLSL 1.30) and later. It's not in OpenGL ES 3.0 / GLSL ES 3.00.
This needs to be checked before R_InitImages() so can't just check in
GLSL_InitGPUShaders().
2019-04-16 11:48:10 -05:00
Zack Middleton 9fcb2bb336 Override video mode list in Team Arena UI
Override the video mode list in the Team Arena data files with detected
modes from SDL like in ioquake3's Q3 UI. Add the aspect ratio to the
end of the video resolution (i.e., "640x480 (4:3)"). Add the current
(custom) video mode to the list.

Before when using a custom resolution in the menu you could not change
the video mode using the mouse because the resolution text was blank.
Now custom video resolution is displayed and can be clicked.
2019-04-16 00:02:27 -05:00
Zack Middleton c61417b8e2 Add current (custom) resolution to Q3 UI video mode list
Custom resolution is displayed when entering system options menu and
settings can be changed without being forced to change video resolution.
2019-04-15 23:50:46 -05:00
Zack Middleton 9b4dcc809e OpenGL2: Fix compiling lightall GLSL on OpenGL 2.1
textureCubeLod() requires OpenGL 3.0 / GLSL 1.30. Added in
2018-12-21 commit e5da13f146
"OpenGL2: r_cubemapping 2 for box cubemap parallax."

Report by brugal and Simon McVittie.

Bug-Debian: https://bugs.debian.org/923226
2019-04-15 23:40:32 -05: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
James Canete d068e1dce1 Add r_parallaxMapShadows. 2019-02-06 01:10:42 -08:00
James Canete e5da13f146 OpenGL2: r_cubemapping 2 for box cubemap parallax. 2018-12-21 19:53:18 -08:00
kungfooman a6df505d59 Prevent Q_IsColorString from asserting on negative ascii chars 2018-12-14 10:00:24 +00:00
Zack Middleton 09166ba05e Make Team Arena prevTeamMember command loop around player list
Team Arena HUD's team member info box can be cycled through using
nextTeamMember and prevTeamMember commands. nextTeamMember command loops
around when end of list is reached but prevTeamMember command got stuck
at last entry in list (team overview).
2018-10-17 13:32:53 -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 93dd14c9fb Disable pulseaudio capture regardless of SDL version
SDL changed version to 2.0.9 but the pulseaudio capture bug isn't fixed
yet. Remove my version check.
2018-09-30 14:53:18 -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 33a899d6dd Fix predicting entity origin on rotating mover
Based on G_TryPushingEntity() in code/game/g_mover.c.
2018-09-15 12:06:34 -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
Zack Middleton e4208cf5a7 Improve finding obelisk entitynum for bot AI
BotSetEntityNumForGoal() was checking all entities that are not
team_redobelisk (which is the obelisk visual entity) to find the
untitled obelisk collision entity. This may fail in rare cases where
there is an another entity within 10 units of the obelisk origin.
Failing to find the correct entity may cause bots to not attack the
obelisk.

Instead add BotSetEntityNumForGoalWithActivator() for looking for the
obelisk collision entity by activator classname (team_redobelisk) which
should be less likely to find the wrong entity.

This doesn't affect official Team Arena maps (unknown if it affects any
others).

Reversed strcmp check was reported by Thomas Köppe.
2018-09-12 16:26:39 -05:00
Zack Middleton 29db64070a Fix loading favorites as initial source in server browser
When I added UIAS_GLOBAL0 in 2017 I missed changing ui_browserMaster
range clamp from 6 to 7.

Reported by cdev-tux.
2018-08-28 21:35:06 -05:00
Zack Middleton c7ebe82131 Calculate bounds for unanimated IQM models
Bounds are optional for animated IQM models but are not possible to
include with unanimated models (seems intended for use with separate
model containing animations and bounds). Calculating bounds for
unanimated IQM models fixes culling and head model on HUD which
calculates position from model bounds.
2018-08-02 18:20:18 -05:00
Zack Middleton 1994801e1c Fix axis returned by IQM's LerpTag
The axis returned for IQM tag was the animation's joint rotation without
the base frame joint rotation. It only worked correct for models that
did not rotate the base frame joints.
2018-07-31 13:59:56 -05:00
Zack Middleton 11337c9fa2 OpenGL2: Add GPU vertex skinning for IQM models
Using GPU vertex skinning is significantly faster than CPU vertex
skinning. Especially since OpenGL2 has to run R_VaoPackNormal() and
R_VaoPackTangent() each vertex each frame which causes CPU vertex
skinning to be significantly slower than OpenGL1 renderer.
2018-07-27 17:40:25 -05:00
Zack Middleton cccd283be8 Improve IQM CPU vertex skinning performance
Only calculate vertex blend matrix for each unique bone indexes/weights
combination once per-surface instead of recalculating for each vertex.
For best performance the model surfaces needs to use few vertex bone
indexes and weights combinations.

Unroll loops so GCC better optimizes them.

In my tests drawing animated IQM may take 50% as long in opengl1 and
70% as long in opengl2. It will vary by model though and might not
help much at all.

Made unanimated IQM models skip matrix math altogether.
2018-07-27 17:40:21 -05:00
Zack Middleton fdc08e860e Improve IQM loading
- Only allocate memory for vertex arrays that are present in the IQM
file and are actually used (may not have colors or blend index/weights,
don't load tangents in opengl1). (Colors is fixed to next commit.)
- Explicitly handle loading IQM files without meshes (bones only).
- Better IQM validation. Header data offset 0 mean data is not present
in file. Check if required vertex arrays are present.

This involved a lot of white space changes and moving code around.
2018-07-27 17:40:16 -05:00
Zack Middleton 6c3d92133d Fix IQM root joint backlerp when joint number is more than 0
Backlerp for root joint (joint with no parent) was always applied to
joint 0. This is an issue when a model has multiple root joints.
2018-07-27 17:40:09 -05:00
Zack Middleton 39e2113c73 OpenGL2: Misc fixes and cleanup
Fix two constants in GLSL shaders. Remove f suffix from float and fix
int to float assignment. They were causing shader compile errors in
OpenGL ES 2 context.

Remove disabling clip plane. Clip plane is unused and never enabled in
the opengl2 renderer. Remove disabling it to avoid causing a GL error
when using OpenGL 3.2 core profile or OpenGL ES.

Make VAO cache vertex stride be size of srfVert_t since that is what
is uploaded to the GPU. No behavior change. There is a disabled debug
id in srfVert_t though which if enabled changes srfVert_t size.
2018-07-20 23:40:35 -05:00
Zack Middleton 14cc4cc6cb OpenGL2: Fix world VAO cache drawing when glIndex_t is unsigned short
OpenGL ES is only required to support unsigned short for element buffer
values.

R_DrawElements() firstIndex argument was glIndex_t which caused element
indexes to wrap around to 0 when glIndex_t is an unsigned short.
(glIndex_t is an index into the vertexes buffer, not element buffer.)
Change it to 'int' like tess.firstIndex which is passed to
R_DrawElements().

World VAO cache buffer size allowed storing more vertexes than unsigned
short glIndex_t could reference. This resulted in the vertex indexes in
the element buffer wrapping around to 0.
2018-07-20 23:40:31 -05:00
Zack Middleton 658165cfbb Don't check fixed function GL extensions when using shader pipeline
GL_TEXTURE_UNITS_ARB is not part of OpenGL ES 2 API and sets GL error.
It's not part of OpenGL 3.2 core profile either.
2018-07-20 23:40:26 -05:00
Zack Middleton d861a4f427 Load OpenGL ES 2.0 function procs
Load functions procs supported by OpenGL ES 2.0, though there is not a
compatible renderer yet. Change argument for GLimp_Init from coreContext
to fixedFunction.
2018-07-20 23:40:21 -05:00
Zack Middleton 7391215bd4 Don't load non-core GL functions for OpenGL 3.2 core context
Also declare the GL functions in tr_local.h so there is compile error
for non-core GL functions instead of SEGFAULT from dereferencing a NULL
pointer.

Disable the non-functional stencil shadow code that hasn't been updated
to use OpenGL 3.2 core compatible drawing.
2018-07-20 23:40:17 -05:00
Zack Middleton 255c33b367 OpenGL1: Use RE_UploadCinematic() instead of duplicate code
Already done in opengl2 renderer.
2018-07-20 23:40:12 -05:00
Zack Middleton 476134f5a6 Don't upload 8 bit grayscale images as 16 bit luminance
Using more color bits than the source image provides shouldn't improve
the quality.
2018-07-20 23:40:07 -05:00
Zack Middleton bead4aa8c7 Fix renderer not clearing some GL extension variables at vid_restart
If renderer is compiled into client (USE_RENDERER_DLOPEN=0) and after
start up set r_allowExtension to 0 and run vid_restart, some extension
were still used.
2018-07-20 23:40:02 -05:00
Zack Middleton c74b9a4452 Remove unused renderer_buffer variable 2018-07-20 23:39:54 -05:00
Zack Middleton 809a7765b2 Make testgun command without argument disable test gun model 2018-06-24 22:22:25 -05:00
Zack Middleton 38a2f4d938 Fix in_restart causing fatal error while video is shutdown
Connecting to a server running a different fs_game and using a
autoexec.cfg containing in_restart would hit a fatal error in IN_Init().

    IN_Init called before SDL_Init( SDL_INIT_VIDEO )

Reported by smokey2k on the ioquake3 forum.
2018-06-10 15:13:10 -05:00
Zack Middleton ce1d5406d5 Require OpenGL 1.2 for GL_CLAMP_TO_EDGE 2018-05-28 17:20:27 -05:00
Zack Middleton 77de5019b9 Don't create multiple windows when GL context creation fails 2018-05-28 17:07:38 -05:00
Zack Middleton 4fa93fbfd4 Fix client kicked as unpure when missing the latest cgame/ui pk3s
In 2013 ioquake3 stopped referencing the pk3 file that qagame.qvm was
loaded from. This had the unintended side affect of causing
non-dedicated pure servers to no longer reference a pk3 that only
contains the three QVM files.

Non-dedicated pure servers did not reference the pk3 containing the
latest cgame.qvm so if client did not have the pk3 file they were kicked
as unpure instead of the client trying to download the pk3 file.

Also make server touch ui.qvm since it's required to pass pure check and
may be separate from cgame.qvm.
2018-05-22 14:43:11 -05:00
SmileTheory c0c45d325d OpenGL2: Readd r_deluxeSpecular.
https://github.com/ioquake/ioq3/issues/369
2018-05-14 18:30:59 -07:00
Zack Middleton 60a3112e45 Fix console offset while Team Arena voiceMenu is open
Fix console text being on top of the Tema Arena voice chat head in
screen resolutions higher than 640x480.
2018-05-14 00:22:58 -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 2326a060b9 Don't allow SDL audio capture using pulseaudio
When you start recording using SDL pulseaudio driver the client sends
all audio captured while not recording. 240 milliseconds of audio is
sent each frame until the capture buffer is empty. This is a problem for
privacy and causes confusing to debug VoIP playback issues on other
clients connected to server and when playing back demos.
2018-05-12 04:20:58 -05:00
Zack Middleton 42d2fb908c OpenGL2: Fix parsing specularScale in shaders
Fix specularScale <metallic> <smoothness> with r_pbr 1 which has been
broken since r_pbr was implemented in 2016.

Fix specularScale <r> <g> <b> <gloss> setting b to gloss and leaving
gloss as 0 since it was implemented in 2014.
2018-05-11 23:18:39 -05:00
Zack Middleton 10abac8fa0 Fix duplicate bots displayed in Team Arena ingame add bot menu
The key handler allowed going 2 beyond the end of the bot list and the
display function clamped to 0 causing the first bot to be shown 3 times.

Attempting to add the bot in gametypes < GT_TEAM would fallback to
Sarge in UI_GetBotNameByNumber() (who isn't the first bot) and gametypes
>= GT_TEAM would access characterList past known values (typically NULL
but if teaminfo.txt contained 63 characters it would access out of
bounds memory).
2018-05-06 01:47:49 -05:00
Zack Middleton da861ff3a2 Fix not closing description.txt and fix path seperator
0 length description.txt files were not closed.
2018-05-03 16:13:19 -05:00
Zack Middleton 51743bbb01 Improvements for dedicated camera followers (team follow1/2)
Switching to dedicated camera follower with no possible players to
follow would spawn at the intermission point and display "connection
interrupted" HUD message. Pmove() was not run for the client so
ps.commandTime was too far behind. I made it so that dedicated camera
followers and scoreboard run Pmove() but cannot move (PM_FREEZE).

When all players possible to follow leave, the dedicated camera follower
would continue to display the old player state of the player they were
following (along with "connection interrupted" HUD message). Unlike the
regular case of a spectator following a specific player, dedicated
camera followers did not reset their player state to the intermission
point after the followed player was no longer valid.

Now a client can be set as 'team follow1' to automatically switch
between displaying the intermission point and following a player when
possible.
2018-05-01 21:25:14 -05: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
Zack Middleton 45f8512f8e Fix clearing keys for control in Team Arena UI
When a control is selected for binding a key, pressing backspace would
clear the displayed keys in the menu but not actually unbind the keys.
2018-04-26 11:47:11 -05:00
IR4T4 9b2df26024 Fix array index in CanDamage() function - discovered by MARTY
The wrong array element was accessed. However the correct element is the
same value so fixing it does not affect gameplay.
2018-04-26 11:31:07 -05:00
Zack Middleton 7ad05ccf2d Make UI_DrawProportionalString handle NULL string
This makes the function consistent with UI_DrawString.
2018-04-26 11:22:55 -05:00