Commit graph

2609 commits

Author SHA1 Message Date
Edward Betts
fe42b8653d Correct spelling mistakes. 2017-11-22 01:40:20 -06:00
Zack Middleton
3e1599ac4b Fix my previous commit about -1 ammo 2017-11-10 21:09:23 -06:00
Zack Middleton
4af2c91fbf Fix -1 (unlimited) ammo decreasing ammo time remaining
Gauntlet and Grappling Hook use -1 ammo. Gauntlet is excluded from
the check ammo loop but Grappling Hook causes ammo time remaining
to decrease 200 milliseconds.

The out of ammo check tests time remaining is equal to zero. This
means carrying Grappling Hook and out of ammo will have negative
time remaining which results in the low ammo message being displayed
instead of out of ammo.
2017-11-10 20:33:07 -06:00
Zack Middleton
471ea9e564 Fix Team Arena server refresh time format
Make minute less than 10 have a leading 0. Change '7:1' to '7:01'.
2017-11-10 20:06:04 -06:00
Zack Middleton
e8450cae33 OpenGL2: Use ri.Error instead of Com_Error in tr_vbo.c
Com_Error is a wrapper for ri.Error. Use it directly.
2017-11-05 20:58:57 -06:00
Zack Middleton
690c5a4dac Don't send team overlay info to bots 2017-10-09 02:34:22 -05:00
Zack Middleton
b4a4fe98d4 Fix reading crash log when log wraps around buffer 2017-10-08 07:19:07 -05:00
Zack Middleton
9e502bda4d Only draw cm_patch/bot debug polygons in world scenes
Fixes debug polygons appearing in HUD head model scene.
2017-10-08 07:18:40 -05:00
Zack Middleton
e46e9846fc Fix memory leak in (unused) AAS_FloodAreas() 2017-10-07 08:02:24 -05:00
Zack Middleton
815c898bf5 Don't redefine MAX_PATH in bot code 2017-10-04 22:13:50 -05:00
Thomas Köppe
39b0702550 [botlib/be_aas_def.h] Change array size from MAX_PATH to MAX_QPATH
The array is part of a structure and should have a fixed size that does
not depend on inclusion order.
2017-10-04 21:41:41 -05:00
Zack Middleton
d824cfa5a2 OpenGL2: Fix MD3 surface with zero shaders dividing by zero
Reported by @DescX.
2017-10-04 21:00:04 -05:00
Zack Middleton
ac4802af8d OpenGL2: Fix brightness when r_autoExposure is disabled
The game world is too dark when r_autoExposure is disabled. It can be
fixed by setting (cheat) r_cameraExposure to 1 but then the game is
too bright when r_autoExposure is enabled. So default r_cameraExposure
to 1 and make auto exposure subtract 1 from r_cameraExposure value.
2017-10-02 20:46:36 -05:00
Thomas Köppe
b3223dcfcb [qcommon] Use unsigned types where wrapping arithmetic is intended
The use of signed types in these expressions lead to overflow, hence undefined behaviour. The "sum" aggregator in Com_TouchMemory isn't even used (and presumbably just exists to inhibit optimizations from removing the memory access).
2017-10-02 19:46:37 -05:00
Zack Middleton
a83ae01d93 Load OpenGL ES 1.1 function procs 2017-10-02 04:48:07 -05:00
Zack Middleton
da07a6dbd9 Support parsing OpenGL ES version strings
The renderers don't support OpenGL ES though.
2017-10-01 23:09:20 -05:00
Zack Middleton
c9d12aa3f3 Add common OpenGL version parsing + OpenGL 3 fixes
- Parse OpenGL version in sdl_glimp.c to share with both renderers.
- Add GL_VERSION_ATLEAST(major, minor) macro.
- Get address of glGetStringi if using OpenGL 3.
- Fix glConfig.extensions_string when using GL3 core context in
opengl2 renderer.
- Make opengl1 renderer's gfxinfo support qglGetStringi too.
2017-10-01 23:09:20 -05:00
Zack Middleton
20573bce43 Don't link to libGL at compile time
Get all OpenGL functions using SDL_GL_GetProcAddress(). This makes it
easier to cross-arch compile on Linux and add support for OpenGL ES
in the future.

Users still have to supply their own libSDL2 for cross-arch compiling
on Linux. But now the user does not have to re-install libgl1-mesa-dev
package for i386 or amd64 on Debian when switching between compiling
ioquake3 for x86 and x86_64.
2017-10-01 23:07:33 -05:00
Zack Middleton
51e9aa2df0 Fix hit accuracy stats for lightning gun and shotgun kills
If a lightning bolt killed a player or the first shotgun pellet that
hit a player killed them, the shot was not counted as accurate.

Check if shot player is alive for hit accuracy before dealing damage.
2017-09-29 18:54:57 -05:00
Zack Middleton
45de6be4c2 Fix listen server sending snapshots each client frame
Running a server using the client engine would send server snapshots
to loopback and LAN clients each client frame (com_maxfps).

This causes excessive network traffic and likely does not provide new
information to the clients because SV_Frame() won't have run between
the extra snapshots.

This commit restores the original behavior of respecting local/LAN
client's snaps userinfo and sv_fps. The issue was introduced by the
following commit:

    Commit ac30d86db0
    From: Thilo Schulz
    Date: Wed, 13 Jul 2011 17:11:30 +0000
    Subject: - Improve snapshot rate and data rate control

Reported by Eugene C.
2017-09-15 19:31:00 -05:00
Zack Middleton
11b3bca555 Update UI player animation handling to match CGame
Fix "Error parsing animation file" messages in UI. Caused by fixing the
handling of missing tokens in animation.cfg parser in a past commit.
Fix new Team Arena torso animation frame numbers in UI.
Add support for fixedtorso and fixedlegs keywords.
Add support for reversed animations (negative numframes).
2017-09-10 20:20:30 -05:00
Zack Middleton
098d97bdb0 Fix in_nograb not releasing the mouse cursor
Disable SDL relative mouse mode when in_nograb is enabled. Relative
mouse mode hides the cursor and it cannot exit the window regardless
of the window's grab state.

This wasn't always the case. SDL before 2.0.4 on GNU/Linux released
the mouse cursor in relative mode. However, SDL 2.0.3/4 on Windows
does not. (I did not test other Windows versions.) So I think SDL
2.0.4 made GNU/Linux X11 behavior consistent with other platforms.

This fixes mouse input being unusable when debuging client crashes
in gdb.
2017-09-10 19:11:36 -05:00
Zack Middleton
a48dcdf224 Fix crash when out of memory in Team Arena's String_Alloc 2017-09-10 19:11:35 -05:00
Zack Middleton
dcf5707493 Don't reload arenas.txt/*.arena files in Team Arena UI
Entering Team Arena's start server or in-game callvote menu causes
arenas to be reloaded. The existing memory is not freed so after
a entering the menus a few times the UI runs out of memory and
crashes.

Just load arenas once when the UI loads like in q3_ui.
2017-09-10 19:11:35 -05:00
Eugene Molotov
e0a367451f ignore window resize event on fullscreen 2017-09-10 14:31:51 +05:00
Zack Middleton
5f743bdb22 Disable DPI scaling on Windows
Windows DPI scaling prevents using full monitor resolution in
fullscreen mode.
2017-09-07 21:17:44 -05:00
Zack Middleton
aeaecb4ae5 Add Windows application manifest
- Use common controls 6 so error dialogs use correct visuals on
Windows XP or later!
- Specify running as invoker so Windows doesn't guess if it should
prompt for admin permission on Vista or later.
- Specify compatible with Vista through Windows 10. Tells Windows
not to emulate Vista behavior, not sure if it affects anything.

Makefile automatically runs windres when manifest changes.
2017-09-07 21:04:52 -05:00
Zack Middleton
6f0736ce9a Fix loading renderer DLLs on Windows x86
After 'Fix floating point precision loss in renderer', Windows x86
client won't load the renderer DLLs. The problem is a 64 bit modulus.
I couldn't find any reports of this online. However, client with
built-in renderer worked with the 64 bit modulus.

Only tested with mingw-w64.
2017-09-07 20:42:31 -05:00
Zack Middleton
c2ce1c2f51 Make client for Windows x86_64 use OpenAL64.dll by default
ioquake3.x86_64.exe can't load x86 OpenAL32.dll. Using separate
library names allows shipping OpenAL for both architectures.

Though since the dll name is saved in the config file, using both
clients on the same computer will cause one client arch to always
try to load the wrong OpenAL dll and then fallback to the correct
default OpenAL dll. I guess it could be fixed by using separate
cvar names for s_alDriver.
2017-09-04 20:34:55 -05:00
Zack Middleton
8192f66b39 Don't draw crosshair 0 in Team Arena setup menu
Don't draw crosshair 0 in Team Arena setup menu. It isn't drawn
in CGame. Wrap cg_drawCrosshair in missionpack menu like CGame
instead of treating as index 0 which is no longer drawn.
2017-09-02 18:19:08 -05:00
Zack Middleton
e152761c28 Fix team chat box for spectators
Make spectators use green background for team chat box when following
players. The team chat messages are from spectators not the team of
the followed player.

Make spectators draw team chat box even when not following a player.
2017-09-02 17:57:26 -05:00
Zack Middleton
5d88c6fdee Limit ui_smallFont/ui_bigFont/cg_noTaunt cvars to missionpack
ui_smallFont and ui_bigFont are for missionpack HUD font size
selection. cg_noTaunt disables missionpack taunt voice chats.
2017-09-02 17:40:16 -05:00
Zack Middleton
2c22ead078 Make map names in q3_ui map select menu be uppercase
Makes map names match on both pages of start server menu.
2017-09-02 17:35:19 -05:00
Zack Middleton
f4d68590c2 Fix going to previous browser source in q3_ui
It wasn't possible to go to previous source from favorites if
sv_master5 cvar wasn't set.
2017-09-02 17:31:04 -05:00
Zack Middleton
c3e64d3806 Make bots only use q3tourney6 crusher to kill their enemy
Only use the crusher for killing the bot's enemy. This doesn't
affect 1v1 very much but prevents the whole team of bots in CTF
from suddenly shooting at the crusher button. Entering the crusher
bounds was basically instant death.
2017-08-28 21:46:58 -05:00
Zack Middleton
ad1d0e616e Make bots use crusher on other q3tourney6 maps
Make bots activate crusher on q3tourney6_ctf and mpq3tourney6.

Check if player is inside the crush bounds instead of below the
crusher. There is a jumppad the goes under it in mpq3tourney6.
2017-08-28 21:46:57 -05:00
Zack Middleton
63e07afae9 Make input events use earliest possible time
SDL doesn't provide exact the exact time that input events happen
so use the earliest possible time that an event could happen.

This make sub-frame input actions such as walking take affect
immediately instead of in the next frame.

Based on patch by Alexander "wareya" Nadeau.
2017-08-21 22:43:33 -05:00
Zack Middleton
5993c63c4e Removing input functions from sys_local.h for last commit
It helps to actually save files before making commits.
2017-08-21 22:27:09 -05:00
Zack Middleton
ead54782d0 Improve client input responsiveness
Move sampling input to the other side of framerate limiter.

Thanks to Alexander "wareya" Nadeau and Juraj "youurayy" Vitko for
pointing this out.
2017-08-21 21:40:54 -05:00
Zack Middleton
34d0b78754 Improve keys using international key layouts
Always map number row to number keys for AZERTY.
Map Unicode character keys to world keys using scan code.

Based on patches by @mickael9.
2017-08-21 20:21:18 -05:00
Zack Middleton
be1c71d363 Combine mouse movement events in event queue
Fixes 'Com_QueueEvent: overflow' spam after hitch / map load.

Based on patch by @ec-.
2017-08-21 20:12:26 -05:00
Zack Middleton
e793c0c37c Fix crash when pmove_msec is 0
When pmove_fixed is set to 1, setting pmove_msec to 0 would crash.
2017-08-19 01:42:38 -05:00
Mickaël Thomas
bae86208f9 Only allow safe protocols for cURL downloads
A malicious server could abuse dangerous protocols such as gopher:// to,
for instance, send mail via SMTP.
2017-08-15 21:47:27 -05:00
Zack Middleton
9736e7ff91 Fix compiling Cmd_CallTeamVote_f 2017-08-09 19:19:59 -05:00
Zack Middleton
3f267728c3 Remove newlines from chat messages in Game VM
This has no affect due to ioquake3 engine already removing command
separators (which includes newlines) in Cmd_Args_Sanitize().
2017-08-09 18:41:26 -05:00
Zack Middleton
f0b74a27c9 Check for all command separators in callTeamVote
Make callTeamVote check for all command separators like in callVote.
It's not exploitable as the only vote option (leader) always uses an
integer argument.

Also the ioquake3 engine remove command separators from client game
commands in Cmd_Args_Sanitize().
2017-08-09 18:37:18 -05:00
Zack Middleton
0bce5463f7 Add spawnflags to QUAKED for trigger_multiple 2017-08-09 17:47:33 -05:00
SmileTheory
9d1c6748f5 OpenGL2: Force VAO usage on OpenGL 3.0+ 2017-08-08 20:20:11 -07:00
SmileTheory
3f415abe61 OpenGL2: Use extension functions with OpenGL versions before 3.0. 2017-08-07 18:00:00 -07:00
SmileTheory
2955f8dadb Reject OpenGL contexts w/ software renderer when core context requested. 2017-08-03 14:20:33 -07:00