Commit graph

3233 commits

Author SHA1 Message Date
Yamagi
0763dee264 Retire unmaintained CMakeLists.txt.
I added the CMakeLists.txt 6 or 7 years ago so I could load the code
into Jetbrains Clion. I have moved to another editor years ago and the
cmake stuff is effectively unmaintained since then. We kept it around
in case that we'll do a MSVC port, but that's unlikely at this point.
Since bugreport and problems with the CMakeLists.txt keep coming up,
finally retire them. They can be resurrected from the git history if
we'll ever need them again.

Part of #725.
2021-06-29 11:06:19 +02:00
Yamagi
376d97c54f Correct braino in LDFLAGS / LDLIBS, Windows build fix 2/2. 2021-06-29 09:01:13 +02:00
Yamagi
fb080fc32c Add missing semicolon, Windows build fix 1/2. 2021-06-29 08:58:40 +02:00
Yamagi
1c9a2d89d1 Fix explosive crate beeing cut of in base3.
This is a subtile map bug, one exploding crate in base3 is cut of and
hovering. Reported by @Shockblast and fixed by @ BjossiAlfreds. Closes
2021-06-26 16:53:17 +02:00
Yamagi
61c08eee13 Fix ASAN and UBSAN builds, enhance sanitizers a little bit.
At least for LLVM / Clang the -fsanitize= option must be passed to the
linker before any objects or libraries, otherwise the sanitizers will
either noch link or are disfunctional. Split LDFLAGS into LDFLAGS for
flags and LDLIBS for librariers, pass LDFLAGS before any objects and
LDLIBS after all objects. While at it set RTLD_NODELETE so that shared
libs opened by dlopen() are never deleted from memory when building
with sanitizers.
2021-06-26 16:28:08 +02:00
Denis Pauk
7f1fd069f4 use LittleShort in S_GetStatistics and S_GetVolume 2021-06-26 15:23:07 +03:00
Denis Pauk
c4526bac51 Sync haptic effect to sound track 2021-06-26 15:23:07 +03:00
Yamagi
d9d5552662
Merge pull request #717 from 0lvin/ogg_sound
Add ogg/vorbis sound for effects
2021-06-25 10:18:41 +02:00
Yamagi
c9f7faa7b1 Add logic to mark search path entries as required or optional.
Until 7.45 we supported adding non existent dirs to the search path,
8.00 bails out if it cannot at a dir. It turned out that some users
install the binary through their package management (SYSTEMWIDE is set),
but use local game data. This case was broken, because the SYSTEMDIR
doesn't exist. Fix this by marking the SYSTEMDIR as optional.

Closes #724.
2021-06-20 18:24:22 +02:00
Yamagi
21483dc1bd
Merge pull request #718 from Spirrwell/master
Fix some leaks
2021-06-19 08:48:54 +02:00
Yamagi
f64837868d Bump the CHANGELOG to 8.00. 2021-06-14 16:38:38 +02:00
Yamagi
61059f0b41 Spelling fixes for the CHANGELOG. 2021-06-14 16:17:28 +02:00
Yamagi
495f8be7dd
Merge pull request #721 from devnexen/solaris_build_fix
solairs/illumos build fix proposal.
2021-06-14 16:12:45 +02:00
Denis Pauk
408e7d9a99 Scale down model preview icon is too big 2021-06-13 15:52:48 +03:00
Denis Pauk
7be959894b fix line duplication 2021-06-13 15:46:16 +03:00
Denis Pauk
d554b89730 sound: cleanup ogg to wav code 2021-06-13 15:46:16 +03:00
Denis Pauk
fbde7b753f fclose is not required with close_on_free=true 2021-06-13 15:46:16 +03:00
Denis Pauk
bf286dc952 Add ogg/vorbis sound for effects 2021-06-13 15:46:16 +03:00
David Carlier
53c684525f solairs/illumos build fix proposal. 2021-06-13 08:25:56 +01:00
Yamagi
f4e7ee59c4 Bump version to 8.00rc1. 2021-06-07 10:10:16 +02:00
Yamagi
bb7bf8ef9e Disable floating-point expression contraction on gcc builds.
While this shouldn't be a problem with C code, better be safe than
sorry. @DanielGibson stumbled over this while debugging some strange
RB-Doom3 / dhewm3 issues with gcc. See this bug report for details:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100839
2021-06-06 18:48:38 +02:00
Yamagi
228c6060f3 Update the CHANGELOG for 8.00. 2021-06-06 17:46:41 +02:00
Daniel Gibson
7ae9655f3a Fix UBSan Warnings
- memcpy() shouldn't be called with NULL, even if length == 0
- In CMod_LoadBrushSides() j (from in->texinfo) could be -1,
  which of course is no valid array index
2021-06-04 13:39:43 +02:00
Daniel Gibson
dc7ad65bb0 Fix crash in soft renderer
RE_Draw_StretchPicImplementation() would write up to
height+picupscale-1 lines.
That overflows the buffer so make sure it doesn't.
2021-06-04 13:38:14 +02:00
Yamagi
2861874da6 Small corrections to the documentation. 2021-06-03 07:24:42 +02:00
Spirrwell
b9129f2fa8 Fix some leaks
Most of these are probably "harmless", but I could definitely see the missing/improper SDL_Quit/SDL_QuitSubsystem causing headaches later.
2021-06-02 19:45:34 -04:00
Yamagi
c9913eb538 Detect if an autosave is loaded and advance world by 100 frames.
Autosaves are special. The are a byproduct of the level change process.
When loaded they aren't respawning the player at it's last position, the
player is relocated to func_playerstart. Since entities spawn at their
start position, the player may end up in the wrong spot.

One example is train.bsp -> base2.bsp. The platform spawns in upper
position, the player in lower position. The platform comes down and
crushes the player.

Most of these cases work by luck when the client isn't paused during
load, because the world advances a few frames before the player is
spawned. Implement a better fix: Detect if an autosave is loaded (name
is save0 or current) and treat it like a map change, advance the world
by 100 frames. We cant use the `autosave` boolean, because it's in the
game savefile.

Fix suggested by @BjossiAlfreds, closes #711.
2021-05-29 17:16:42 +02:00
Yamagi
8f6a085434 Remove ref_vk, the Vulkan renderer ported from vkQuake2.
While having a Vulkan renderer in Yamagi Quake II sounded like a good
idea, especially for cheap hardware with broken OpenGL drivers, the last
weeks showed that the code is not ready for primetime. Some examples
for critical problems:

 * Render glitches when using non-standard assets. Everything with more
   polygons and texture resultion than baseq2 seems to be broken.
 * The startup and shutdown code is a mess. While I fixes the most
   critical bug, there're a lot of cases left. Startup and shutdown
   mostly works by luck.
 * At least one memory leak in the model code.

And neither @DanielGibson nor myself have deeper knowledge about Vulkan.
We don't have the time and the motivation to learn it. While some
community members did excellent work on ref_vk (especially @0lvin and
@rg3), the community maintenance promised in the initial pull request
never really materialized. Therefor we risk ending up with a renderer
that we can't and won't maintain by ourself.

Vulkan is not gone. The code will be recommitted in a separate
repository at: https://github.com/yquake2/ref_vk

We're willing to give community members commit access to that
repository. Send a substantial pull request and ask for it.
2021-05-28 09:33:46 +02:00
Yamagi
76d61d9d8f Remove rev_vk from the client. 2021-05-28 09:33:44 +02:00
Yamagi
0838faf120 Remove ref_vk from the documentation. 2021-05-28 09:32:42 +02:00
Yamagi
ce10213d91 Remove rev_vk from the Makefile. 2021-05-28 09:32:42 +02:00
Yamagi
8c297a003f Remove rev_vk from the CmakeLists.txt. 2021-05-28 09:32:42 +02:00
Yamagi
84312ae8b7 Check if renderer lib exists before loading it.
This is a noop change, we're just bailing out somewhat earlier.
2021-05-28 09:32:42 +02:00
Yamagi
496985eb90 'Unknown renderer' as upper entry point to the fallback magic.
This is next to no functional change, the only difference to before is,
that the Vulkan renderer is treated as an unknown renderer. gl3 is the
first regular fallback.
2021-05-28 09:32:42 +02:00
Yamagi
ffddd0f7c9 Unify renderer lib path generation.
This makes sure that all users of the renderer lib have the same world
view.
2021-05-28 09:32:42 +02:00
Yamagi
6822da851e Move renderer availability check into vid.c, rename to VID_HasRenderer. 2021-05-28 09:32:42 +02:00
Yamagi
ddce6691e2 Let the video menu skip over non existent renderer libs.
Unitl now the video menu showed all known renderer libs (gl1, gl3, vk
and soft), regardless if the lib was available or not. Rework the
renderer selection logic to skip over non existent renderer libs:
Generate an array combining the menu string and cvar string of all
available renderer libs, use this array instead of the hardcoded array.
While at it simplify the code a little bit.
2021-05-28 09:32:42 +02:00
Yamagi
e66fd250c2 It's vk, not vulkan. 2021-05-25 11:54:38 +02:00
Yamagi
968cd4248d Bump max number of OGG/Vorbis files to 128.
Requested in #714, closes #714.
2021-05-12 18:11:26 +02:00
Daniel Gibson
002498c33d framerate-independent turning of player-model in multiplayer menu
fixes #701
2021-05-08 18:59:52 +02:00
Daniel Gibson
ea51d5f924 Add r_listmodes, change one comment and a message
r_listmodes does the same as vid_listmodes, but is more consistent with
r_mode

the rest is cosmetical
2021-05-08 18:58:24 +02:00
Yamagi
2e8e6088b3 Add logic to prevent Vulkan restart loops.
So far I haven't seen a restart loop, but at least in theory they'e
possible. Because its hard to break out of such loop, especially on
Windows were interaction with the taskmanager is required, play save
and restart max. 3 times in a row.
2021-04-30 13:14:29 +02:00
Yamagi
950ec0d67e Lower vkAcquireNextImageKHR() timeout to 500 milliseconds.
The timeout specifies how long Vulkan waits for the next frame becoming
available. On the one hand we need to take the vsync or the possibility
that we get scheduled away for longer times into account. On the other
hand we don't want to wait for too long, the game may run into the
timeout after its windows was minimized, etc. 500 milliseconds sounds
like a good compromise.
2021-04-30 13:14:29 +02:00
Yamagi
7ea425ee25 Handle VK_TIMEOUT, may lead to restart loops. 2021-04-30 13:14:29 +02:00
Yamagi
c543d3cc05 Work around maximal extent size of 0x0 when the game is minimized.
Some GPU drivers set a maximal extent size of 0x0 when the window gets
minimized. One example is Intel on Windows. A swapchain with extent
size of 0x0 is invalid, so we cannot reinitialize the renderer... Work
around that by postponing the restart as long as the maxmimal extent
size stays 0x0.

This could should be done in the client (don't call into th renderer
when the window is minimized), but it would need a lot of changes
to the client <-> renderer interactions. So take the easy route.
2021-04-30 13:14:29 +02:00
Yamagi
dd80702913 Add a function QVk_CheckExtent() to query the extent state.
This will be used to detect if we've got an extent size of 0x0 because
the window has been maximized.
2021-04-30 13:14:29 +02:00
Yamagi
0ccf1e8ef8 Make current frame as not started after vk init / shutdown.
The client might call into the renderer after it was shut down by
`VID_ShutdownRenderer()` or initialized `VID_LoadRenderer()`. This
is arguably a client bug, but hard to fix on client side and not
a problem for all other renderers. Work around it by marking the
current frame as 'not started' at Vulkan shutdown and init.
2021-04-30 13:14:29 +02:00
Yamagi
a38084c621 Move QVk_Postinit() from render init to context init.
This is more in line with the rest of the code. Reinitializing the
internal state when building a new context is saver than relying on
Vulkan telling us that something is wrong an reacting to that.
2021-04-30 13:14:29 +02:00
Yamagi
1f4082c419 Call QVk_WaitAndShutdownAll() on context shutdown.
Just calling `QVk_Shutdown()` is wrong. It doesn't wait for Vulkan to
finish, which can cause crashes. And it leaks some ressources which
makes the GPU driver unhappy.
2021-04-30 13:14:29 +02:00
Yamagi
3cf786e158 Ensure that the vk renderer isn't init or shutdown twice.
The ref_vk renderer was written for vkQ2 which has differend renderer
<-> client semantics. In YQ2 we can end up initializing or shutting the
renderer down several times. Not by the client, but by the client not
knowing of the renderer has already initialized / shutdown it's internal
state. This is fatal, leading to ressource leaks, crashes and other fun.

Introduce a new global variable `vk_initialize` and use it to track if
we're initialized or not.
2021-04-30 13:14:29 +02:00