Commit graph

2912 commits

Author SHA1 Message Date
Zachary J. Slater
bf3c88dcc1 Merge pull request #227 from smcv/old-style-declaration
Don't use mostly obsolete 'register' keyword (Merge or get off the pot.)
2017-01-24 19:17:40 -10:00
SmileTheory
0238810f34 OpenGL2: Render dlights only when r_lightmap is 0.
https://github.com/ioquake/ioq3/issues/246
2017-01-24 20:17:06 -08:00
SmileTheory
294109628d OpenGL2: Fix bug in generating normal maps for non-square textures. 2016-12-12 15:33:54 -08:00
SmileTheory
06b47ad2a9 GLimp_HaveExtension() -> SDL_GL_ExtensionSupported() 2016-12-10 00:35:17 -08:00
SmileTheory
0672905ef1 OpenGL2: Detect Intel graphics and avoid/use certain operations there.
Also use qglCopyTextureSubImage2DEXT instead of qglCopyTextureImage2DEXT.
2016-12-07 22:30:55 -08:00
SmileTheory
730207817e OpenGL2: Don't bind null framebuffers when not using framebuffers. 2016-12-07 14:13:29 -08:00
Zack Middleton
c68e471430 Don't have clients use private slots when sv_privatePassword is unset 2016-12-05 12:40:00 -06:00
SmileTheory
ab8bcf5c5b OpenGL2: glGetIntegerv -> qglGetIntegerv
Thanks Cyrax for pointing this out.
2016-11-25 02:13:03 -08:00
SmileTheory
93066d2e05 OpenGL2: Don't draw viewmodels in portal views.
Thanks Cyrax for pointing out, should fix https://bugzilla.icculus.org/show_bug.cgi?id=6363.
2016-11-25 01:30:21 -08:00
SmileTheory
2349ef038e OpenGL2: Don't interleave texCoords and lightCoords in tess. 2016-11-25 01:17:46 -08:00
Zack Middleton
1c1e1f61f1 Allow overriding platform in NSIS installer
MSYS2 and some mingw builds use mingw64 instead of mingw32. If you run
`make installer` from the top-level, PLATFORM should be set correctly
when building the installer.
2016-11-01 17:53:25 -05:00
Zack Middleton
7a73646157 Prefer mingw-w64 for cross-compiling 2016-11-01 17:44:40 -05:00
Simon McVittie
2ab109b772 Avoid 'register' declarations
gcc 6 with -Wall -Wextra warns:

code/botlib/l_precomp.c: In function ‘PC_NameHash’:
code/botlib/l_precomp.c:551:2: warning: ‘register’ is not at beginning of declaration [-Wold-style-declaration]
  int register hash, i;
  ^~~

Modern compilers either ignore the register storage class when
generating code, or generate better code without it, so just remove
most of them.

The remaining uses are in third-party bundled libraries (libjpeg, zlib),
and in a PowerPC-specific inline function consisting of inline
assembler (because I'm not 100% confident that it doesn't have
some practical use there).
2016-11-01 16:37:38 +00:00
Zack Middleton
10f33b892b Fix removing/creating PID file for base game when switching to/from mods 2016-10-27 22:54:33 -05:00
SmileTheory
f7711a8119 OpenGL2: Add more ambient to lightmapped materials. 2016-10-27 02:12:32 -07:00
SmileTheory
8955752457 OpenGL2: Prioritize loading .png images over all others besides .dds. 2016-10-27 02:11:29 -07:00
SmileTheory
ffcec94f50 OpenGL2: Load images with "_nh" suffix as parallax normalmaps. 2016-10-27 02:10:40 -07:00
SmileTheory
89701a1a45 OpenGL2: Faster mipmap generation. 2016-10-21 19:48:02 -07:00
SmileTheory
ba59df8c8c OpenGL2: Remove check for GL_ARB_texture_non_power_of_two.
Core in OpenGL 2.0.
2016-10-21 16:58:42 -07:00
SmileTheory
41ae7815c9 OpenGL2: Remove half float support.
Not enough accuracy for textures larger than 1024x1024, such as merged lightmaps.
2016-10-20 20:09:12 -07:00
SmileTheory
863adfcfc2 OpenGL2: Fix fog color. 2016-10-12 23:17:19 -07:00
SmileTheory
ad819edcc4 OpenGL2: Workaround for multiple deforms on MD3 mesh.
https://github.com/ioquake/ioq3/issues/122
2016-10-11 04:18:41 -07:00
SmileTheory
aa79738c50 OpenGL2: Store vertex colors and hdr lightmaps/lightgrid as RGBA16. 2016-10-11 03:28:20 -07:00
SmileTheory
239f539702 OpenGL2: Non-square merged lightmaps. 2016-10-10 03:06:03 -07:00
Zack Middleton
c80f341711 Handle ERR_DROP during Com_GameRestart
If ERR_DROP during Com_GameRestart after shutting down client, Com_Error
needs to restart the client otherwise there is just a black window. Also,
clear the game restarting flag in Com_Error otherwise it's not possible to
run Com_GameRestart again later.

I don't know of a way to trigger ERR_DROP, in FS_Restart for instance,
without engine changes however.
2016-10-09 19:17:58 -05:00
Zack Middleton
978afd7590 Avoid shuting down opus voip codec multiple times 2016-10-09 18:30:19 -05:00
Zack Middleton
755b2f38f0 Offer post-crash safe settings on a per-mod basis
Offer to restore settings when loading a mod that crashed, not the first
mod that gets loaded after a crash. Before the first mod loaded (usually
baseq3) would get the option even if missionpack or some other mod crashed.

- Make pid files separate for each fs_game.
- Remove/write pid every time switching fs_game.
- Create path before writing pid file otherwise it fails on first run.
- Show mod description.txt or fs_game instead of engine name in abnormal
  exit message.
- Check com_fullyInitialized in Com_Error before removing PID,
  otherwise "ioquake3 --version" segfaults when accessing fs_gamevar->string
  (plus not fully initialized isn't really a normal shutdown).
2016-10-09 18:18:08 -05:00
SmileTheory
1246d16834 Default cl_renderer to opengl2. 2016-10-02 20:00:59 -07:00
Tim Angus
f71fe6b613 Merge pull request #226 from smcv/underflow
Fix array underflow compiler warnings
2016-09-27 21:07:05 +01:00
Tim Angus
cce24668f7 Merge pull request #225 from smcv/reproducible-date
Pick up date from SOURCE_DATE_EPOCH, for reproducible builds
2016-09-27 21:05:24 +01:00
Tim Angus
5a33abe90c Merge pull request #224 from smcv/notshlib
Introduce NOTSHLIBLDFLAGS, used to link executables only
2016-09-27 21:03:45 +01:00
Tim Angus
3bd30f1f4f Merge pull request #223 from smcv/seperating
Fix mis-spellings of "separating" as "seperating"
2016-09-27 21:03:00 +01:00
Simon McVittie
f1a133acf1 UI_BuildFindPlayerList: make a sizeof() more obviously correct
As with the other branch of the if/else, each element of
foundPlayerServerNames is in fact the same size as each element of
foundPlayerServerAddresses, so it was fine; but it's better to make
it obvious that we are using the right array sizes.
2016-09-25 17:13:50 +01:00
Simon McVittie
01bfb1540f UI_BuildFindPlayerList: avoid array underflow
This function is used in the Team Arena menus

I don't think it's actually possible to reach this line with
foundPlayerServerNames < 1, because by the time we get here we have
set it to 1 + the actual number of servers; but if we did, it would
clearly underflow into foundPlayerServerNames[-1], which would be
undefined behaviour. gcc 6 diagnoses this with a warning:

code/ui/ui_main.c: In function ‘UI_BuildFindPlayerList’:
code/ui/ui_main.c:4138:16: warning: array subscript is below array bounds [-Warray-bounds]

Also correct the sizeof() invocation to make it more obviously
correct (in fact the buffers for names and addresses happen to both
be of size MAX_ADDRESSLENGTH, so it was fine, but it's good to be
obvious).
2016-09-25 17:13:47 +01:00
Simon McVittie
c5b6bb0d4b snd_wavelet: avoid undefined pointer below array bounds
Given an array b[] of length n, pointers to &b[0]..&b[n] are defined
(where only &b[0]..&b[n-1] can be validly dereferenced). &b[-1], or
equivalently b-1, is not something we can use in valid Standard C.

gcc 6 diagnoses this as:

code/client/snd_wavelet.c:33:9: warning: array subscript is below array bounds [-Warray-bounds]

and might take this undefined behaviour as permission to emit
"more efficient" object code that is not what the author expected,
for example nothing at all. Use a macro to fake a 1-based array instead.
2016-09-25 17:13:40 +01:00
SmileTheory
1cfa16674c OpenGL2: Some tr_image refactoring/cleanup. 2016-09-22 23:04:13 -07:00
Simon McVittie
9c76b546e3 Pick up date from SOURCE_DATE_EPOCH, for reproducible builds
The goal of reproducible builds is that a rebuild of the same source
code with the same compiler, libraries, etc. should result in the same
binaries. SOURCE_DATE_EPOCH provides a standard way for build systems
to fill in the date of the latest source change, typically from a git
commit or from metadata like the debian/changelog in Debian packages.

This does not change anything if SOURCE_DATE_EPOCH is not defined;
the intention is that a larger build system like a Debian package
will define it.

Please see https://reproducible-builds.org/ for more information about
reproducible builds.
2016-09-22 09:02:20 +01:00
Simon McVittie
cab94d0559 Introduce NOTSHLIBLDFLAGS, used to link executables only
This can be used for LDFLAGS that would be inappropriate for shared
libraries, such as the "-fPIE -pie" used to link position-independent
executables. PIEs make it more difficult to exploit various classes
of security vulnerability.
2016-09-22 08:58:18 +01:00
Simon McVittie
7d4f9525df Fix mis-spellings of "separating" as "seperating"
Found by Debian's Lintian tool.
2016-09-22 08:56:30 +01:00
SmileTheory
8417c184b4 OpenGL2: Clamp entity lighting to more resemble OpenGL1. 2016-09-14 04:19:46 -07:00
SmileTheory
8749d62bbd OpenGL2: Remove per fragment tangent space calculation code. 2016-09-14 03:57:51 -07:00
SmileTheory
4faf1008a0 OpenGL2: Remove map color scaling and r_forceSunMapLightScale.
Also simplify overbright code in ComputeShaderColors().
2016-09-14 02:59:54 -07:00
Tim Angus
4c169ab574 Merge pull request #221 from tkoeppe/strncpy
[code/botlib/l_precomp.c] Fix string buffer overflow
2016-09-13 13:55:08 +01:00
Thomas Köppe
90f2f02c55 [code/botlib/l_precomp.c] Fix string buffer overflow 2016-09-13 13:37:19 +01:00
Tim Angus
bd062f713a Merge pull request #216 from tkoeppe/abs
[renderergl2/tr_main.c] Use floating-point fabsf() for floating-point values
2016-09-13 10:34:48 +01:00
SmileTheory
bbc9e263f0 OpenGL2: Fix more reversed VectorCopy4() usage. 2016-09-13 01:41:46 -07:00
Tim Angus
7d063ba81d Merge pull request #220 from tkoeppe/shift
[qcommon/msg.c] Remove dead code
2016-09-12 18:00:21 +01:00
Thomas Köppe
fe111df610 [qcommon/msg.c] Remove dead code (which had undefined behaviour) 2016-09-12 13:32:59 +01:00
SmileTheory
ec3779988c OpenGL2: Fix reversed VectorCopy4() usage. 2016-09-11 16:08:18 -07:00
SmileTheory
497a74f22a Fix undefined behavior when shifting left by 32.
https://bugzilla.icculus.org/show_bug.cgi?id=6432
2016-09-07 16:56:23 -07:00