Commit graph

2617 commits

Author SHA1 Message Date
Yamagi Burmeister
209bd9d529 Replace GetSystemTimeAsFileTime() with GetPerformanceCounter().
GetSystemTimeAsFileTime() is okay as long as the game runs fullscreen.
For some reasons it's resolution degraded to ~16ms as soon as the game
runs widowed... Better use GetPerformanceCounter(), its more reliable
and the recommended API for timecounters.
2019-04-08 13:56:56 +02:00
Yamagi Burmeister
f240799e6d Some clarifications and annotations to the file lists. 2019-04-08 13:56:19 +02:00
Yamagi Burmeister
5386e73af9 Add file listsings.
"What file goes were?" is an often asked question, so give a listing of
the complete kit. While at it provide checksums for the paks.
2019-04-03 21:17:13 +02:00
Yamagi Burmeister
9df2311df0 Bring the multiplayer docs inline with other docs.
* Break at 72 chars.
* It's Quake II and not quake2
* It's HTTP and not http
* Don't use german placeholders
2019-04-03 21:08:07 +02:00
Daniel Gibson
178fcff36e GL3: Fix missing dynamic lights on floor for grenades/rockets
Apparently the lightsource for exploding rockets/grenades is very close
to the surface, so the dot-Product between surface-normal and the
vector between the light and the pixel returns 0, basically disabling
the dynamic light for that surface.
As a workaround, move the lightposition (only for that dot product)
a bit above the surface, 32*surfaceNormal looks good.

fixes #386
2019-04-03 19:38:39 +02:00
Yamagi Burmeister
4f20ac97d1 Some clarifications, typo and grammar fixes to the documentation.
Make some things clearer and fix some small miss informations, overhaul
the timing guide. While at it fix typos and grammar mistakes.
2019-04-03 11:33:20 +02:00
David Carlier
65357c9ba5 hunk api mremap supported by NetBSD as well. 2019-03-29 17:24:07 +00:00
Denis Pauk
eea1cd30e8 Fix segfault in about menu 2019-03-23 23:23:54 +02:00
Denis Pauk
e568e3ff0e Save original window position before recreate 2019-03-22 23:29:17 +02:00
Denis Pauk
f0dc7bd6f9 Move GetDesktopMode to client/vid/vid.c 2019-03-21 21:32:34 +02:00
Denis Pauk
f105047540 make cppcheck little more happy 2019-03-20 22:01:14 +02:00
Denis Pauk
025764db79 make cppcheck little more happy 2019-03-20 21:56:28 +02:00
Denis Pauk
0f9e3cc69a Move patches authors to about menu
With whole respect to original authors
2019-03-20 21:28:42 +02:00
Denis Pauk
fbe42511c1 Add resolution autodetect 2019-03-20 20:59:34 +02:00
Denis Pauk
0ab41ee0df Use boolean for r_outof* 2019-03-20 20:45:15 +02:00
Denis Pauk
5e7082e72d Fix for light without current entity 2019-03-20 20:43:54 +02:00
Daniel Gibson
3b296c43a0 GL1, SW: Calculate needed hunk size in Mod_LoadBrushModel()
same as last commit but for the other renderers
2019-03-17 20:24:40 +01:00
Daniel Gibson
ec6d743d46 GL3: Calculate needed hunk size in Mod_LoadBrushModel()
The real needed size can't be derived from the .bsp file size, because
* many generated structs contain pointers
* there's lots of data generated per face..
* _especially_ for warped faces that are subdivided
2019-03-17 18:10:07 +01:00
Daniel Gibson
d2d87025fa Fix case of map savegames name (save/bla/MAPNAME.sav/sv2)
introduced FS_GetFilenameForHandle(fileHandle_t) for this

this helps if a map has been started with "wrong" case, which doesn't
immediately fail if it has been loaded from a pack, but will result
in invalid savegame names that (with case-sensitive FSs) will fail to
load (when going back to a formerly played level)
2019-02-17 18:46:57 +01:00
Yamagi Burmeister
3296b7a1a2 Add back pak prioritization to HTTP download code.
The r1q2 code prioritized pak files over all other files, e.g. as soon
as a pak file was requested no more file were added to the download
queue until it finished downloading. That way one could be sure that
assets included in the pak file weren't downloaded in parallel as single
files.

This is a better, bugfixed and more robust implementation of the same
logic. With this back in place we can switch back to parallel downloads
which gives a nice speedup on Windows. Maybe, just maybe some day
Microsoft will fix Windows crappy I/O...
2019-02-17 10:03:17 +01:00
Yamagi Burmeister
f96a82010e Combine all HTTP download quirks into a strict dlquirks_t.
Working with getter and setters was a good idea as long as we had one or
two quirks. Now we're at three with maybe more to come so it's easier to
use a struct to communicate quirks between the precacher and the HTTP
download code.
2019-02-17 09:38:11 +01:00
Yamagi Burmeister
b1629fb768 Prevent buffer overflows console if vertical resolution > 2048.
The stores it's text in the key_lines array which is NUM_KEY_LINES *
MAXCMDLINE chars long. The code never checked for overflows, it just
assumed that a line will never be longer then 256 chars * 8 = 2048
pixel. With modern displays we can have higher vertical resolutions,
so the array will overflow sooner or later.

Fix it by clamping the maximum line width to MAXCMDLINE - 2 chars (1
for the prompt and 1 for the terminating \0). While at it increase
MAXCMDLINE to 1024 chars * 8 = 8192 pixel, which is more then 8k
resolution and should be enough for the years to come.

This is belived tot fix at least a part of issue #368.
2019-02-16 08:57:44 +01:00
Yamagi Burmeister
b49f2bda6d Reconnect entity states of clients >1 when running in coop mode.
While loading a savegame the global edict arrays is free()ed and newly
malloc()ed to reset all entity states. When the game puts the first
client into the server it sends it's entity state to us, so as long as
there's only one client everything's okay. But when there're more
clients the entity states if all clients >1 are dangeling. Hack around
that by reconnecting the clients >1 entity states "manually".
2019-02-15 19:50:56 +01:00
Yamagi Burmeister
8c60939bd5 Use correct path to filelists when downloading for a mod.
I'm not 100% sure if this is okay for q2pro, but at least in my simple
tests r1q2, q2pro and now yq2 generate the same URL. Nevertheless it's
somewhat inconssistent to search generic files at /moddir/... and the
filelist at /moddir.filelist

This closes issue #370.
2019-02-11 19:27:34 +01:00
Yamagi Burmeister
32d9119cff CL_HTTP_EnableGenericFilelist() needs curl/download.c linked in.
Reported by @LoneFox78 in issue #369.
2019-02-11 19:20:55 +01:00
Yamagi Burmeister
e049717ac3 Bump version to 7.41pre. 2019-02-07 17:27:09 +01:00
Yamagi Burmeister
25bf4d3e02 Bump version to 7.40. 2019-02-07 17:25:36 +01:00
Yamagi Burmeister
86d438708e Not all libc support the %z format modifier added in C99... 2019-02-05 17:18:01 +01:00
Yamagi Burmeister
f7706b2c06 Fix indention after b44fd32. 2019-02-05 09:15:11 +01:00
Yamagi Burmeister
95bdec447d Include wchar.h, required by wmemset(). 2019-02-04 17:10:28 +01:00
Yamagi Burmeister
0318fb59c7 Update the CHANGELOG. 2019-02-04 14:20:16 +01:00
Yamagi Burmeister
e4665547a8 Try to fix gun fov calculations in the softrenderer.
Until now the softrenderer calculated the fov relative to a hard coded
aspect of 4/3. That's wrong, because we're supporting arbitrary aspects
and we aren't calculating a fov but just a scaling factor to the global
fov which takes the aspect into the account.

Fix this by not taking any aspect calculations into account. BUT: While
this renders the gun with a correct perspective it's positioned much
nearer to the camera / player then in the GL renderers. The GL renderers
work around that problem by enforcing a minimal Z distance of 4 units,
which can't do because we're just calculating a scaling factor...
2019-02-04 13:43:34 +01:00
Yamagi
9c549f1cd2
Merge pull request #363 from 0lvin/image_resize
Soft Render: Image resize
2019-02-04 13:41:54 +01:00
Daniel Gibson
04a33c9837 Fix loading Coop savegames without starting server first 2019-02-03 19:35:38 +01:00
Daniel Gibson
b44fd32572 Save gclient_t::resp.coop_respawn.*weapon to fix coop savegames
This fixed bug #357 - the problem was that
client->resp.coop_respawn.weapon and .lastweapon (pointers to gitem)
were not properly initialized when loading a savegame.
Now those fields are saved (=> we had to bump the savegame version)
and for old savegames client->resp.coop_rewspawn is initialized
from client->pers, as a hack for backwards-compatibility.
2019-02-03 19:01:03 +01:00
Denis Pauk
2a19bfe6cd make variables local 2019-01-31 22:40:16 +02:00
Denis Pauk
3a85943118 Show func in .Sys_Error and .R_Printf 2019-01-31 22:09:33 +02:00
Denis Pauk
b7cac7f8aa Use INT_MIN instead -999999 2019-01-30 23:27:59 +02:00
Denis Pauk
c80820500b Fast lights clean 2019-01-30 23:22:00 +02:00
Denis Pauk
e43859de4a Fast lights clean 2019-01-30 23:19:10 +02:00
Denis Pauk
dcc2892de0 Use resize stb image 2019-01-30 23:06:25 +02:00
Denis Pauk
1dfb54bf38 Add code for retore mips 2019-01-30 23:03:38 +02:00
Denis Pauk
203bc4b202 Update stb_image and add stb_image_resize code 2019-01-30 22:43:54 +02:00
Denis Pauk
07c472cfd2 Remove adivtab 2019-01-30 22:42:21 +02:00
Yamagi Burmeister
29bb6e5c6c Fix last commit, pack can be NULL. 2019-01-30 17:14:14 +01:00
Yamagi Burmeister
5ddab0e4bf Allow UDP download from paks that are not numbered.
Until now the UDP download code prohibited downloading of maps from all
pak files. That was some kind of copy protection, without the limitation
demo users could download assets from the full version. Don't apply that
protection for all paks, but only for numbered .pak files.

This could be enhanced by limiting the protection to pak0 to pak2 for
baseq2 and pak0 for both xatrix and rogue.
2019-01-30 17:14:14 +01:00
Yamagi Burmeister
900d35ef27 Hack in support for q2pro filelists.
r1q2 places the global filelist at /.filelist, q2pro at
/gamedir/.filelist...

Now I'm feeling even more dirty.
2019-01-30 17:14:13 +01:00
Yamagi Burmeister
67b1a8fd95 Implement q2pro URL scheme.
The r1q2 URL generator was, like everything in this game, buggy. It took
cl.gamedir into account when generating the URLs, but overlooked that it
is only set when 'gamedir != BASEDIR'. So baseq2 assets ended up with
/maps/foo.bsp and mod assets with /mod/maps/foo.bsp. q2pro fixed that
to always include the gamedir...

Work around this by refactoring the HTTP -> UDP fallback logic to be
more generic: Count the number of iterations and depending on the
iteration set the gamedir to be used by the URL generator or force
UDP downloads.
2019-01-30 17:14:13 +01:00
Yamagi Burmeister
c06af7de57 Reset error state when getting a new download server. 2019-01-30 17:14:13 +01:00
Yamagi Burmeister
1d9acffe0b Ensure that internal pathes are always starting with a /.
Otherwise the URL generator might generate invalid URLs...
2019-01-30 17:14:13 +01:00