This was the default until 2.0.12 and is what the expects. It changed
with 2.0.14, casing problems with window ordering under windows and
some X11 window managers like kwin.
Do it unconditionally. So we're shure that we're ending with a minimized
windows, no matter what SDL does.
Fixes part of #647.
One of the most common bug reports is, that the fullscreen mode doesn't
behave like users expect. This is caused by `vid_fullscreen 1` setting
desktop fullscreen mode (a fullscreen windows) and not the native
fullscreen mode. This commits switches the semantics:
* 1: Native fullscreen, like Vanilla Quake II.
* 2: Desktop fullscreen.
With this alt-tab reverts to native fullscreen. While at it improve the
documentation, suggest setting `r_mode -2` when using `vid_fullscreen
2`. Change the menu strings to make things clearer, set `r_mode -2` when
selecting 'fullscreen window' in the menu.
I pondered several other options:
* Introducing a second cvar for the desktop fullscreen, like we did in
dhewm3. This has the problem, that in Quake II vi_fullscreen is
special and used to communicate changed to the renderer configuration
between the client and renderer. A second fullscreen cvar would
complicate this already shaky mechanism even more.
* Setting `r_mode -2` when `vid_fullscreen 2`. This might not be what
the user wants and causes problems when we're unable to get the
desktop resolution.
Switching this back to Vanilla Q2 behavior fixes at least one lightning
problem in the space map in baseq2. It'll break the lighting in some
addon maps, but is more correct from a global standpoint. You can't
have everything...
Closes#677.
If an error is detected in vkAcquireNextImageKHR or vkQueuePresentKHR,
avoid restarting the whole video system and the game window. Instead,
shut down the Vulkan subsystem as gracefully as possible and restart it
without touching the window.
This fixes the problem with infinite video restarts under the Gnome
desktop environment.
1: The Vanilla Quake II behaviour, footsteps are generated when the
player is faster than 255.
0: Footstep sounds are never generated.
2: Footstep sounds are always generated.
Defaults to `1`, cheat protected to `1`.
Closes#666.
When windowed or in "switch resolution" mode, the viewport must be kept
in the top-left corner or it will appear cut while in fullscreen.
Also, make offset and width calculations safe from the point of view of
the swapchain extent, in case there's a mismatch.
Since we are now loading the world color buffer content before drawing
on them again, we need to make sure the attachment layout transition
from shader-read-optimal to color-attachment-optimal happens before
color attachment read operations.
The contents of the previous drawn frame, used to mask geometry glitches
due to geometry sometimes not being watertight, was not being correctly
loaded for MSAA cases.
When MSAA is not used, the single-sample attachment needs to be loaded
and stored. With MSAA enabled, it's the multisample attachment the one
needing to be loaded and stored.
The pipeline used to draw a texture quad was only created compatible
with the RP_UI render pass, which has a single-sample color attachment.
This made the pipeline work when MSAA was disabled, but it did not work
properly with it enabled.
To fix the issue, create a set of pipelines, instead of a single one,
with compatibility with the different types of render passes, as the
pipeline is used for both the scaled down view borders as well as UI
elements in the third render pass.
This was added in e3e5bd1 as a work around for some openal-soft bug.
When too many audio samples got played at the same time, the global
volume dropped. This was fixed in openal-soft 0.19.0, released more
than two years ago. We're keeping the work around, because some
distros may still ship with buggy openal-soft versions and some
players may like the changed behavior. It's disabled by default.
src/client/refresh/soft/sw_main.c:
1512 (style) Variable 'err' is assigned a value that is never used. [unreadVariable]
src/client/refresh/vk/vk_rmain.c:
1023 (style) Suspicious calculation. Please use parentheses to clarify the code. The code ''a&b?c:d'' should be written as either ''(a&b)?c:d'' or ''a&(b?c:d)''. [clarifyCalculation]
src/client/sound/ogg.c:
335 (style,inconclusive) Function 'OGG_PlayTrack' argument 1 names different: declaration 'track' definition 'trackNo'. [funcArgNamesDifferent]
212 (style) Local variable 'gogTrack' shadows outer variable [shadowVariable]
src/client/sound/sdl.c:
179 (style) The scope of the variable 'i' can be reduced.
180 (style) The scope of the variable 'lpos' can be reduced.
181 (style) The scope of the variable 'ls_paintedtime' can be reduced.
182 (style) The scope of the variable 'out_idx' can be reduced.
183 (style) The scope of the variable 'count' can be reduced.
185 (style) The scope of the variable 'p' can be reduced.
186 (style) The scope of the variable 'snd_linear_count' can be reduced.
187 (style) The scope of the variable 'step' can be reduced.
189 (style) The scope of the variable 'snd_out' can be reduced.
330 (style) The scope of the variable 'data' can be reduced.
368 (style) The scope of the variable 'data' can be reduced.
369 (style) The scope of the variable 'left' can be reduced.
369 (style) The scope of the variable 'right' can be reduced.
401 (style) The scope of the variable 'end' can be reduced.
529 (style) The scope of the variable 's' can be reduced.
799 (style) The scope of the variable 'i' can be reduced.
874 (style) The scope of the variable 'scale' can be reduced.
910 (style) The scope of the variable 'srcsample' can be reduced.
1093 (style) The scope of the variable 'total' can be reduced.
196 (style) Local variable 'i' shadows outer variable [shadowVariable]
197 (style) Local variable 'count' shadows outer variable [shadowVariable]
src/client/sound/sound.c:
450 (style) The scope of the variable 'maleFilename' can be reduced.
980 (style) The scope of the variable 'num' can be reduced.
1085 (style) The scope of the variable 'sfx' can be reduced.
423 (style,inconclusive) Function 'S_RegisterSound' argument 1 names different: declaration 'sample' definition 'name'. [funcArgNamesDifferent]
909 (style,inconclusive) Function 'S_StartLocalSound' argument 1 names different: declaration 's' definition 'sound'. [funcArgNamesDifferent]
1048 (style,inconclusive) Function 'S_Update' argument 2 names different: declaration 'v_forward' definition 'forward'. [funcArgNamesDifferent]
1048 (style,inconclusive) Function 'S_Update' argument 3 names different: declaration 'v_right' definition 'right'. [funcArgNamesDifferent]
1048 (style,inconclusive) Function 'S_Update' argument 4 names different: declaration 'v_up' definition 'up'. [funcArgNamesDifferent]
This commit removes the previous R_CleanupBorders hack and fixes
textured border drawing, so borders are correctly drawn in the right
place and are not taken into account when applying the underwater
effect.
This commit includes the following changes:
* When vid_fullscreen is 1, the game is now drawn centered in the
screen instead of the top left corner, by modifying the viewport and
scissor when drawing the world warp and UI render passes.
* When vid_fullscreen is 1, the world view no longer has an incorrect
size and/or aspect ratio. This was due to the world warp and UI
render passes sampling from the whole color buffer instead of the
restricted render area. To fix this, the postprocessing and world warp
shaders now use unnormalized coordinates, corrected with the frame
offset, and sample directly from the appropriate texels.
* The game no longer outputs pixels which have not been written to,
which are usually displayed black but may come out with undefined
colors. For this, some output color attachments are cleared before
drawing the final elements in the frame.
All renderers had the fix, but it was only optional in the GL renderers.
And there it was missimplemented, cvars must be defined in the renderers
main() function. Otherwise they aren't available at startup.
Rename gl_fixsurfsky to r_fixsurfsky, implement it for all renderers and
enable it by default.
Due to the skybox geometry not always being watertight, it's sometimes
possible to see instances of isolated black pixels flickering along
skybox edges. This happens when the sampling coordinates for the given
pixel fall outside any triangle in the skybox due to the previous
problem.
These pixels are usually visible when MSAA is not used and pixels are
big enough on the screen, like when using lower screen resolutions or
large vk_pixel_size values. If MSAA is used, normally only a few of the
samples fall outside any triangle and the problem is masked a bit, being
harder to spot.
Instead of fixing the skybox clipping routines, which may be
complicated, this commit simply preserves color buffer contents between
frames. If any pixel ends up without coverage, its color will be taken
from a previous draw a few frames before, depending on the swapchain
size. This is usually more than enough to completely mask the problem
visually.
Skybox edges are sometimes visible in Vulkan, specially in lower screen
resolutions or when vk_pixel_size is used to the same effect.
To avoid this problem, draw the skybox using CLAMP_TO_EDGE addressing
mode in samplers. In order to do that, the number of texture samplers is
doubled and a second set of samplers with the new addressing mode are
created, and used only when drawing the skybox.
In Vanilla Q2 (without any point releases) the hyperblaster projectiles
emitted white light. In the 3.21 sources it's yellow. It likely changed
in on of the (early) point releases. Change it to yellow, the code now
matches 3.21.
Since the first release Yamagi Quake II used the more fanzy R1Q2 colors
for some dynamic lights:
* In R1Q2 the rocket has orange light, matching the color of the fire
trail and the generic explosion. Vanilla Quake II had yellow light,
the same as the blaster and several muzzle flashs.
* In R1Q2 hyperblaster projectiles are emitting yellow light, like the
normal blaster. That matches the projectile colors, the muzzle flash
and the effect when hitting a wall. And it's more logical, since the
hyperblaster is just a blaster on steroids. Vanilla Quake II had white
/ uncolored lights.
Add an option to revert to Vanilla Quake II colors, leave the R1Q2
colors as default. Closes#640.