Commit Graph

2160 Commits

Author SHA1 Message Date
fabiensanglard 184ff91453 Added Unreal kernel filtering. 2018-05-20 13:55:04 +03:00
Denis Pauk 96a81f64f9 little speed up 2018-05-20 13:55:04 +03:00
Denis Pauk 56ea94978d [-pedantic] fix compilation waring about static array initialization
warning: string length ‘16384’ is greater than the length ‘4095’
ISO C99 compilers are required to support [-Woverlength-strings]
2018-05-20 13:55:04 +03:00
Denis Pauk f48e3e5b4d Use real height/width instead warp dimensions 2018-05-20 13:55:04 +03:00
Yamagi 3adb4a62d7
Merge pull request #294 from devnexen/addrinfo_leak_fix
- Fix addrinfo leaks.
2018-05-01 15:29:06 +02:00
David Carlier 2f0c2f8981 - Fix addrinfo leaks. 2018-05-01 10:17:20 +00:00
Daniel Gibson 1e3135d4fc r_gunfov shouldn't be CVAR_USERINFO, only CVAR_ARCHIVE
this happens when you just copypaste and adapt r_lefthand

also did some minor changes to R_AliasDrawModel in the soft renderer
to make sure alias[xy]scale is reset properly in the early out cases
2018-04-27 23:42:27 +02:00
Daniel Gibson 12a8da7180 r_gunfov for the software renderer 2018-04-21 21:35:13 +02:00
Daniel Gibson c59c1bfda1 Fix Rogue heatbeam rendering at high FOVs 2018-04-21 20:19:42 +02:00
Daniel Gibson a5e97682a3 Weapon field of view independent of 'fov': r_gunfov cvar
At high 'fov' values the weapon looked quite distorted.
Now it's rendered with an independent FOV, which looks better.
Note that the 'fov' cvar sets fov_x, while this is based on fov_y
(which is calculated from fov_x), so it's indeed different values:
r_gunfov seems to correspond to fov 90.
We use r_gunfov 80 as default, because it looks better.
2018-04-21 18:23:32 +02:00
Yamagi d4b6e936ef
Merge pull request #285 from 0lvin/particles_size
Fixes scale particles in soft render
2018-04-17 20:52:15 +02:00
Denis Pauk 189a34e707 Add custom particle shape by sw_custom_particles.
0 - use rectangle (default shape)
 1 - use hexagon
2018-04-13 23:29:56 +03:00
Denis Pauk 23d25db601 Little different shape of particle 2018-04-10 23:24:53 +03:00
Denis Pauk 14c934762d use one function for any mip levels 2018-04-10 23:13:38 +03:00
Denis Pauk cd6c686980 Use multiple for particle sizes 2018-04-10 23:09:36 +03:00
Denis Pauk 758ab07a38 look to height instead width 2018-04-10 23:06:54 +03:00
Denis Pauk 14af679b7e Add size checks for WAL load 2018-04-10 22:59:13 +03:00
Denis Pauk 511b73baf9 Particle fixes from q2dos and kmquake
Authors: maraakate <emoaddict15@gmail.com>
         Knightmare <knightmare66@yahoo.com>
2018-04-10 22:59:13 +03:00
Yamagi c97204e48d
Merge pull request #290 from ericwa/macos-cmake-fixes
Fix for vorbis/vorbisfile.h not found on macOS with CMake
2018-04-10 07:20:51 +02:00
Eric Wasylishen a8902a0d82 CMakeLists.txt: use VORBIS_INCLUDE_DIR instead of OGGVORBIS_INCLUDE_DIR,
which doesn't seem to be set in the FindOggVorbis.cmake
2018-04-07 13:44:12 -06:00
Yamagi 43f317d981
Merge pull request #289 from maxice8/fix-musl
fix compilation on musl libc.
2018-04-07 17:54:39 +02:00
maxice8 2365d4705f fix compilation on musl libc. 2018-03-29 10:29:30 -03:00
Yamagi Burmeister c11149730c Bump version number to 7.21pre. 2018-03-10 18:26:07 +01:00
Yamagi Burmeister c0291746b0 Bump version number to 7.20. 2018-03-10 18:24:21 +01:00
Daniel Gibson 3a641c8beb "/currentmap" command that prints the currently loaded map 2018-03-10 16:38:37 +01:00
Yamagi Burmeister 808a208de4 Disconnect when we're connected before starting an new game.
The old code was working only when the client was connected to a local
server. The 'newgame' executed by the menu expands to a 'map', loading
a map ends in SV_InitGame() which calls CL_Drop() on the local client.
That calls CL_Disconnect() and everything is okay.
When the client is already connected to a remote server and no local
server is running the 'map' command spawns a new local server. This
new server thinks "Hey, I'm a new local server and no one is connected
to me. Let's pull the client in!". So it pull the already connected
client onto a new server without disconnecting, smashing it's state.
And everything goes down in flames.

The correct way would be to execute a 'disconnect' right before the
'newgame'. But the 'disconnect' cmd calls CL_Disconnect_f that throws
an ERR_DROP. ERR_DROP is implememted through a longjump(), jumping
around puts the process internal state in ashes... So bite the bullet
and add another hack: Call CL_Disconnect() before executing 'newgame'.
2018-03-07 21:49:58 +01:00
Yamagi Burmeister ed54fe2364 Fix '/connect $server' while connected to a server. 2018-02-27 19:17:45 +01:00
Yamagi Burmeister 727249f625 Document vid_displayrefreshrate. 2018-02-26 19:15:46 +01:00
Yamagi Burmeister 8ff7109b9d Rename forgotten gl_modulate and gl_farsee cvars in the GL3 renderer. 2018-02-25 10:38:04 +01:00
Yamagi Burmeister 9e139a9be0 Update CHANGELOG for 7.20. 2018-02-25 10:36:50 +01:00
Yamagi Burmeister 7fc5810231 Remove TODO.txt, it was never ment to be commited. 2018-02-25 10:27:30 +01:00
Yamagi Burmeister 2db01319a1 Fix changing the game / mod through the 'game' console command.
The 'game' command was more or less functional after the last commit.
We just need to reset the initialGame (renamed to userGivenGame) so we
don't revert back to the old game at server disconnect.
2018-02-25 10:24:35 +01:00
Daniel Gibson f0e21e2ab4 Fix writing/loading configs when changing game/mod
When connecting to a multiplayer game that runs a different mod
("game" cvar) than you are, it didn't load the corresponging configs
from the mod, but saved your changes to the config to the mod's config.
Which is doubly useless.
Now when the "game" cvar is changed, the configs are reloaded (from
the right directories for the mod), and when disconnecting the configs
are written, so the changes you did for a mod while playing MP are saved
before game is reset to the game you started with.
2018-02-24 21:00:35 +01:00
Yamagi Burmeister d6f9cf64a4 Enforce 32 bit IO-API for minizip on !Linux and !Windows.
By default minizip uses fopen64(), fseek64() and so on. Those may not
be defined on all system, especially the BSDs. While FreeBSD already
has a special case, for example OpenBSD hasn't. Work around this by
forcing minizip to use fopen(), fseek() and so on everything that's not
Linux or Windows. This is not 100% correct, it may prevent the usage of
ZIPs lager than 2GB on Solaris and other rarely used systems. But I
doubt that anyone has such large ZIPs with assets, they would likely hit
other internal limits.

In the future Quake II should use off_t instead of int were applicable.
With that we could set -D_FILE_OFFSET_BITS=64.

This change is based upon a patch send by @devnexen in pr #279.
2018-02-20 09:43:13 +01:00
Yamagi c68aade396
Merge pull request #275 from 0lvin/3dhaptic
Use  SDL_HAPTIC_CARTESIAN as effect direction.
2018-02-15 07:35:58 +01:00
Daniel Gibson 3acf5f0cba VID_WriteScreenshot() PNG compression level must be < 10
10 is no valid zlib compression level, so make sure it's not used

Thanks to @maraakate for pointing this out!
2018-02-15 00:39:43 +01:00
Denis Pauk 80616a418e Reuse SWimp_Init from refresh.c 2018-02-14 23:07:20 +02:00
Denis Pauk b376c7e0d2 correctly exit if have not found console fonts 2018-02-14 23:07:20 +02:00
Denis Pauk 24b7cb3529 Remove unused K_WORLD_* from Q_KEYS 2018-02-14 23:07:20 +02:00
Denis Pauk c68fd0be5b Add 3d haptic/SDL_HAPTIC_CARTESIAN with distance and orientation 2018-02-14 23:07:20 +02:00
Yamagi Burmeister ec1733fb97 Rename 'intensity' to 'gl1_intensity', 2018-02-14 09:35:54 +01:00
Yamagi Burmeister fe6e147c2b Update cvar documentation.
* Explain command line arguments.
* Document busywait and datadir.
* Distinguish between all renderers and all GL renders.
2018-02-14 09:11:51 +01:00
Yamagi Burmeister 278ff83ad4 Always initialize the busywait cvar. 2018-02-13 21:37:50 +01:00
Yamagi Burmeister dd43f88450 Take time used to process render and packetframes into account.
Until now we did an easy calculation to determine the frame timing:
1000000 microseconds (== 1 second) / targetframerate == delay between
frames. This works if the CPU and GPU are fast enough since the time
process to process the frame is negligible. But if one of them is too
slow or the GPU driver takes too long (see issue #277 for an example)
we render too few frames.

Work around this by calculating the average time used to process the
last 60 render oder packet frames and take that into account when
determining the delay between the frames. With this change even my
rotten AMD Radeon and it's broken Windows GL driver is able to hold
the displays famerate (enforced by vsync) just fine.

While here add a 5% security margin to our target packet frame rate if
the vsync is enabled. Just to be sure that we never process more render
than packet frames.
2018-02-13 17:36:15 +01:00
Yamagi Burmeister b80ff7f40c Implement a 'busywait' cvar to force the client and server to busy wait.
Sleeping with Sys_Nanosleep() is fair enough but has the problem that we
may get scheduled away and the hosts power management inteferes with our
interal timings. While this wasn't a big issue on FreeBSD and Linux it
let to serious timing issues in Windows.

There're several reports in the net, apperently everything below 5ms is
very inaccurate on Windows:
* https://stackoverflow.com/questions/7827062/ \
   is-there-a-windows-equivalent-of-nanosleep/7827446#7827446
* https://lists.gnu.org/archive/html/bug-gnulib/2010-04/msg00045.html
2018-02-13 17:36:15 +01:00
Yamagi Burmeister 832f3f6497 Implement vid_displayrefreshrate to override the displays refresh rate.
Modern LCD displays often haven't itegral refresh rates like 60hz but
fractional ones  like 59.95hz. SDL communicates the refresh rate as
integer. On X11 the rate is rounded up or down with round(), but on
Windows it's (at least on my system with an AMD Radeon) truncated...
So on an 59.95hz display it's just 59hz, Quake II renders 0.95 frames
too few and the user sees microstutters.

And return the actual / requested display frame rate increased by one
to work around inaccuracies in Quake IIs internal timing. It should be
a problem if we're running a little bit too fast.

This is belived to fix at least a part of issue #277.

Refreshrate 2
2018-02-13 17:36:15 +01:00
Yamagi f0240af308
Merge pull request #278 from DanielGibson/remember-addressbook
Don't forget entries of Multiplayer "Address Book"
2018-02-13 17:35:59 +01:00
Daniel Gibson c2061e8c83 Use const char* instead of char* in NET_StringToAdr() 2018-02-12 13:37:58 +01:00
Daniel Gibson 1c7b02cc85 Make sure Q2 doesn't "forget" contents of server "address book"
The problem was that the cvars were only initialized (with CVar_Get())
if you opened the address book menu.
So if you start (and possibly run) and quit the game /without/ opening
that menu (or at least the "join network server" menu), the game will
not save those cvars to the config when it next writes it.

To prevent this, *always* initialize the cvars in M_Init().
2018-02-12 01:03:06 +01:00
Yamagi Burmeister a1aac4e56d Fix stupid bug in e30f824. :(
It's VectorCopy(src, dest) and not the other way round. Clion noticed
that, but neither clang nor gcc complained that tmp was used
unitialized.
2018-02-07 19:02:13 +01:00