After migrating to SDL2 interfaces there is noise during startup fix
this by initializng buffer as specification requires.
Per SDL_AudioCallback spec:
The callback must completely initialize the buffer; as of SDL 2.0, this buffer is not initialized before the callback is called. If there is nothing to play, the callback should fill the buffer with silence.
Make the semantics of CL_VM_UpdateView more clear - if CSQC is loaded, it is required to provide the CSQC_UpdateView function, and won't render a view if it does not call that, so we don't need to check its return value.
New alternative to fullbright: r_fullbright_directed.
Set this to 1, and anything EF_FULLBRIGHT or fullbright due to
r_fullbright or unlit map (but specifically not sprites and surfaces
with surfaceparm nolightmap) will have a directional effect applied to
them.
This mode is intended for testing maps in early development, and should
not be used for normal gameplay (although it should be rather harmless
there).
Manage resetting the key event state on video reinitialization centrally.
Fixes:
- No key state clear when SDL gets restarted.
- Key state clear was the wrong action - it allows all keys to get pressed
again, but does not actually release anything in cl_input.c, so e.g. +jump
binds stay pressed on vid_restart.
Only vid_wgl.c retains some vid-specific handling (reset of key state when
alt-tabbing out and back in) - there's a chance that we may need similar logic
in the other vid drivers; if so, it may be possible to do this in a shared
place too by watching for changes to vid_activewindow.
havoc [Sun, 25 Mar 2018 20:04:14 +0000 (20:04 +0000)]
Rewrote most of r_lightning.c, it now uses CL_MeshEntities in MESH_PARTICLES rather than its own rendering code.
Changed the texture generation so it is in the same orientation as the external texture to reduce some code duplication, and changed the look of it to more closely mimic the model-based lightning.
havoc [Sun, 25 Mar 2018 19:58:39 +0000 (19:58 +0000)]
Add CL_MeshEntities_*, every frame in the client all MESH_ entities are added to the frame if they have any surfaces - surfaces can be created with Mod_Mesh_AddSurface and friends. These entities have full material rendering support, which should allow reducing the number of special case renderable objects in the scene in future.
Add Mod_Mesh functions - these allow creation of dynamic mesh models.
Add Mod_LoadCustomMaterial which initializes a texture_t using a skinframe and some parameters, useful with Mod_Mesh and CL_MeshEntities.
havoc [Sat, 24 Mar 2018 21:35:50 +0000 (21:35 +0000)]
Change r_showbboxes to have outlined edges of the box, and the box is now rendered as doublesided which feels more consistent when moving in/out of large trigger boxes and similar.
Added r_showbboxes_client which shows bboxes of clientside qc entities.
havoc [Sat, 24 Mar 2018 21:34:21 +0000 (21:34 +0000)]
Add entity number to showtex overlay.
Add clientside qc entity support to showtex - trace is performed on client and server and the shorter one will be shown.
havoc [Sat, 24 Mar 2018 17:47:32 +0000 (17:47 +0000)]
Add skipmaterialflagsmask feature to TraceLine and friends - this allows more sensible skipping of non-occluders by material (MATERIALFLAGMASK_TRANSLUCENT is now useful).
Recreated TracePoint code from TraceLine code to make it set depth variables properly.
havoc [Sat, 17 Mar 2018 07:35:38 +0000 (07:35 +0000)]
Fix a bug with PRVM_64 where CSQC float stats were sent by aliasing to int64 and returning as int32, now correctly converts to float and then uses a union to get the int32 representation.
havoc [Sun, 11 Mar 2018 19:24:42 +0000 (19:24 +0000)]
Rework R_CanSeeBox a bit to support an eyejitter feature, and make it available throughout the renderer.
Make TraceLineOfSight check if the trace endpos is within a box, not just if fraction is 1 - this makes it much more likely to say an object is visible when the object overlaps walls and other obstacles as the rays only need to reach the box, it doesn't matter much where it goes inside the box.
havoc [Sun, 11 Mar 2018 19:08:41 +0000 (19:08 +0000)]
Change shadowless rtlights so that they are not occluded by anything - no pvs checks or portal culling.
This makes r_shadow_deferred 0 look the same as r_shadow_deferred 1 - lights fill their whole area if there are no shadows to block them.
This also fixes a popping issue with r_shadow_deferred 1 where the eye was not in a leaf the light considered to be visible, and thus the light was not drawn (which made quite a difference when you move back and forth between leafs that were and were not lit), since when it was drawn it lit everything in the area.
havoc [Sun, 11 Mar 2018 19:04:22 +0000 (19:04 +0000)]
Don't set MATERIALFLAG_NOSHADOW on SKY materials. They need to cast shadows to prevent issues in e1m7 and other cases where sky occludes light bleed into other areas.
But when loading Q1BSP, set MATERIALFLAG_NOSHADOW on SKY if it has non-SOLID contents behind it, this supports the e1m5 logo shadow trick.
havoc [Wed, 30 Aug 2017 04:29:14 +0000 (04:29 +0000)]
Fix GLSL shader to only specify invariant gl_Position on the vertex shader, not the fragment shader - woops, this is what I get for not testing that change.
havoc [Sun, 6 Aug 2017 15:33:55 +0000 (15:33 +0000)]
Use the invariant keyword on gl_Position on GLSL 1.20 or higher and GLSL ES
1.00 or higher, this should resolve zfighting between light polygons and
base surfaces.
A long long time ago this was using ftransform() which ensured invariance but use of the invariant keyword was not added when we switched away from that.
Thanks for the bug report:
https://www.reddit.com/r/quake/comments/6rwwm5/need_some_help_getting_quake_running_with/
SDL2: combine SDL_KEYDOWN events directly with following SDL_TEXTINPUT events when possible.
This solves ` keypresses that open/close the console also typing in a character
"once and for all". The ability to type the ` character into the console is not
impaired by this as con_closeontoggleconsole's logic to by default ignore the
toggleconsole key when in the console but not at the beginning of the line
still applies.
rcon server: add an explicit check against empty password, instead of assuming the calling code is correct.
This logic had a bug in the past that had been introduced by r8886 and
accidentally fixed when introducing multi-account support in r9420. The bug was
that rcon_password being empty led to the empty password being accepted in some
cases, as there was never any explicit logic to handle that in rcon - it was
more "accidentally" rejected by a packet formatting check which does not apply
to srcon as the empty password wouldn't be empty over the wire.
In other words: DP builds from [r8886, r9419] had a serious vulnerability and
the only workaround is to always have rcon_password set.
The check added here will complain and reject in case the calling code for some
reason no longer prevents empty passwords from being accepted.
Also adding comments to the new logic explaining how it prevents the empty
password from being accepted.
Fix a bug in collisions between brushes and brushes when the plane is rotating - this case is never used currently but it's definitely a bug worth fixing.
Fix bugs in ModList_RebuildList such that it no longer lists files in the quake directory as gamedirs.
These bugs were previously hidden by a different behavior in FS_CheckNastyPath until 20140716 where directories with a period in their name were skipped, but that was not a complete solution.
havoc [Sat, 14 Jan 2017 19:33:33 +0000 (19:33 +0000)]
added separate cl_nopred cvar to use when playing on qw servers since
players expect prediction in quakeworld, now cl_movement is only used on
dp6/dp7 servers.
havoc [Sat, 14 Jan 2017 19:33:33 +0000 (19:33 +0000)]
added separate cl_nopred cvar to use when playing on qw servers since
players expect prediction in quakeworld, now cl_movement is only used on
dp6/dp7 servers.
divverent [Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)]
Travis changes for Xonotic:
- Do not require root any more.
- Change the i386 build to build on Ubuntu directly, not in a chroot created using debootstrap.
- Remove the -isysroot option for OS X as the path broke after some Travis change.
divverent [Wed, 11 Jan 2017 21:50:45 +0000 (21:50 +0000)]
Travis changes for Xonotic:
- Do not require root any more.
- Change the i386 build to build on Ubuntu directly, not in a chroot created using debootstrap.
- Remove the -isysroot option for OS X as the path broke after some Travis change.
havoc [Tue, 3 Jan 2017 03:25:39 +0000 (03:25 +0000)]
Fix some crashes affecting dedicated quake servers where texture->materialshaderpass is NULL. A few other tweaks to ca_dedicated checks that were redundant.
havoc [Mon, 2 Jan 2017 01:12:46 +0000 (01:12 +0000)]
Fix rogue mission pack (Dissolution of Eternity) plasma launcher which
uses velocity so small initially that SV_CheckVelocity was zeroing it in
the denormal check - the threshold has been lowered by 3 digits since
this was really only meant to detect denormals, not mess with real
numbers
havoc [Mon, 2 Jan 2017 00:26:06 +0000 (00:26 +0000)]
change shadowmapping atlas from 4096x4096 to 8192x8192 because it looks
bad when it has to degrade shadowmap resolution to fit into 4096x4096
some of the time in start.bsp
this texture size is 256MB and should fit on most video cards...
havoc [Sat, 10 Dec 2016 19:50:51 +0000 (19:50 +0000)]
Fix bug in loading additional skins after the ones that exist in the model in mdl loader, which resulted in the missing texture being shown because the skin referenced a texture beyond num_textures.
vic [Fri, 2 Dec 2016 20:19:47 +0000 (20:19 +0000)]
Use tighter bounds for bouncegrid texture
Calculate bounds enclosing all lights instead of using the world bounds.
Maps with unlit monster containers such as e1m7 benefit from reduced RAM usage.
havoc [Sun, 27 Nov 2016 21:29:12 +0000 (21:29 +0000)]
Add skipsupercontentsmask parameter to all the collision implementations, this allows you to ignore brushes/surfaces matching the specified contents flags, the primary use is ignoring q1bsp sky surfaces which are SUPERCONTENTS_SKY and SUPERCONTENTS_SOLID, since SUPERCONTENTS_SOLID is in the hitsupercontentsmask it will normally block on sky surfaces, but this way it will not if they also have SUPERCONTENTS_SKY set.
Use the new skipsupercontentsmask feature for bouncegrid traces and certain other light traces.
havoc [Tue, 11 Oct 2016 01:05:53 +0000 (01:05 +0000)]
Added cl_bob_limit cvar which limits the maximum rage of view bobbing in a smooth way (rather than limiting the velocity and cl_bob independently, it limits the strength of the bob before the sinewave is applied). By default this is 7 (inspired by the quake limit of +4 to -7 range).
Added cl_bob_limit_heightcheck cvar (off by default) which uses tracelines to limit the maximum value of cl_bob_limit based on the ceiling and floor height.
Added cl_bob_velocity_limit cvar which replaces the hard-coded 400 in a few places for xyspeed purposes.
Fix Q2BSP texture loading, Q2BSP contents issues, and add support for SURF_ALPHATEST for any maps that might use it, force fullbright rendering on SURF_TRANS33/SURF_TRANS66/SURF_WARP textures which fixes the rain in 3v3gloom3.bsp and chainlink fence textures on tkse.bsp and glass transparency on gloom1se.bsp among others. Also fix the SURF_FLOWING scroll rate when combined with SURF_WARP.
Also fixed the collision issues caused by stomping over Q1BSP data which caused traceline to break on Q1BSP after loading a Q2BSP map, thanks Supa for that bug report and finding other Q2BSP issues.
havoc [Sun, 28 Aug 2016 05:29:09 +0000 (05:29 +0000)]
Added r_shadow_bouncegrid_lightpathsize which is an alternative to blur
- but in practice this is just slower at a value of 3 than 1 is with
blur, so blur remains the default approach.
Implemented r_shadow_bouncegrid_floatcolors cvar which uses fp16 and
fp32 float formats to increase dynamic range.
Overhauled the default values of the bouncegrid cvars to look better.
havoc [Sat, 27 Aug 2016 22:28:59 +0000 (22:28 +0000)]
implemented r_shadow_bouncegrid_blur, this tremendously improves
quality at a cost of processing time, eliminating many rounding error
problems in all levels.
renamed several r_shadow_bouncegrid_* cvars to have a dynamic prefix,
and split spacing so that it can also be different between
static/dynamic modes (static now uses 32).
havoc [Sat, 27 Aug 2016 19:34:06 +0000 (19:34 +0000)]
Refactored r_shadow_bouncegrid light splatting code, it now makes an
array of light paths and then performs their splatting in a separate
step with an optional sort.
Implemented culling of out-of-view light paths in dynamic mode.
havoc [Sat, 27 Aug 2016 18:00:00 +0000 (18:00 +0000)]
Refactored r_shadow_bouncegrid code into several functions, changed
photon distribution math to make the photons more stable from frame to
frame (in dynamic mode), the number of photons fired is now based on
r_shadow_bouncegrid_intensityperphoton rather than always going for
maximum photons (accordingly r_shadow_bouncegrid_photons has been
renamed maxphotons and will still apply the old logic if it must).
havoc [Sat, 27 Aug 2016 03:17:49 +0000 (03:17 +0000)]
Fix a serious bug with r_shadow_bouncegrid_static where it used
R_CullBox and other view-dependent performance optimizations when
compiling the static texture - thanks to Vic for finding this bug!
The input destination is toggled on the first event, and the console then would
receive the charcode events. Binds work differently though - their action is
queued into the console buffer, and executed at the end of the frame!