]> de.git.xonotic.org Git - xonotic/darkplaces.git/log
xonotic/darkplaces.git
4 years agoImplement cvar callback functionality
cloudwalk [Wed, 3 Jun 2020 15:28:17 +0000 (15:28 +0000)]
Implement cvar callback functionality

With these, cvars can run arbitrary functions to bounds-check themselves or
perform some other task such as cleanup. Use the function Cvar_RegisterCallback.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12629 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix crash when using +map on cmdline by starting video before parsing configs
cloudwalk [Wed, 3 Jun 2020 15:28:17 +0000 (15:28 +0000)]
Fix crash when using +map on cmdline by starting video before parsing configs

Also removed redundant loading screen call, to avoid resolution weirdness

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12628 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix gamedir command by removing the forced video subsystem shutdown, it was trying...
havoc [Wed, 3 Jun 2020 02:26:30 +0000 (02:26 +0000)]
Fix gamedir command by removing the forced video subsystem shutdown, it was trying to load the loading screen without a running video subsystem and erroring out on the texturearray having mempool == NULL.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12627 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd missing server commands to cmd_client so a listen server can use them
cloudwalk [Tue, 2 Jun 2020 14:08:51 +0000 (14:08 +0000)]
Add missing server commands to cmd_client so a listen server can use them

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12626 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoIn findfloat and findchainfloat, use prvm_vec_t like the rest of the VM
cloudwalk [Tue, 2 Jun 2020 14:03:07 +0000 (14:03 +0000)]
In findfloat and findchainfloat, use prvm_vec_t like the rest of the VM

This caused Xonotic vehicles to delete every CSQC entity on the map due
to a bad comparison between a double and a float.

Big, big thanks to Mario for finding this, yet again.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12625 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd missed check for prvm_garbagecollection_enable in LOAD_S opcode
cloudwalk [Tue, 2 Jun 2020 14:03:06 +0000 (14:03 +0000)]
Add missed check for prvm_garbagecollection_enable in LOAD_S opcode

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12624 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix compiler warning
cloudwalk [Tue, 2 Jun 2020 14:03:06 +0000 (14:03 +0000)]
Fix compiler warning

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12623 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd hook.[ch] to VS2017 project.
havoc [Mon, 1 Jun 2020 08:40:05 +0000 (08:40 +0000)]
Add hook.[ch] to VS2017 project.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12622 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRefactor external texture loading for Q1BSP to set the texture dimensions correctly...
havoc [Mon, 1 Jun 2020 07:12:22 +0000 (07:12 +0000)]
Refactor external texture loading for Q1BSP to set the texture dimensions correctly and also remove some dead code.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12621 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix a bug with r_batch_debugdynamicvertexpath in R_DrawTextureSurfaceList_Sky where...
havoc [Mon, 1 Jun 2020 03:02:26 +0000 (03:02 +0000)]
Fix a bug with r_batch_debugdynamicvertexpath in R_DrawTextureSurfaceList_Sky where it was trying to use the surface->num_firstvertex rather than the batch info.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12620 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoTry to load the uppercase variants of various image files as well
cloudwalk [Sun, 31 May 2020 23:39:30 +0000 (23:39 +0000)]
Try to load the uppercase variants of various image files as well

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12619 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoWarn if texture is missing in Mod_Mesh_GetTexture
cloudwalk [Sun, 31 May 2020 23:39:29 +0000 (23:39 +0000)]
Warn if texture is missing in Mod_Mesh_GetTexture

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12618 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoDon't let envmap run if we're not in-game. Fixes crash
cloudwalk [Sun, 31 May 2020 22:26:33 +0000 (22:26 +0000)]
Don't let envmap run if we're not in-game. Fixes crash

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12617 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix broken scissoring with the skybox when r_viewscale > 2
cloudwalk [Sun, 31 May 2020 22:09:46 +0000 (22:09 +0000)]
Fix broken scissoring with the skybox when r_viewscale > 2

Adjusted to the correct resolutions. This happened when deferred shadows
and shadowmapping were both turned off.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12616 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix multiple bugs with r_viewscale in r_shadow_deferred and r_bloom - they were relyi...
havoc [Sun, 31 May 2020 05:41:15 +0000 (05:41 +0000)]
Fix multiple bugs with r_viewscale in r_shadow_deferred and r_bloom - they were relying on vid.width/vid.height rather than r_fb.screentexturewidth/r_fb.screentextureheight.

Thanks to Cloudwalk for debugging this a fair bit already.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12615 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd hook.[ch] to vs2019 project.
havoc [Sun, 31 May 2020 04:43:42 +0000 (04:43 +0000)]
Add hook.[ch] to vs2019 project.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12614 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd Cvar_PrintHelp to unify cvar info printing and reduce code duplication
cloudwalk [Sat, 30 May 2020 19:59:12 +0000 (19:59 +0000)]
Add Cvar_PrintHelp to unify cvar info printing and reduce code duplication

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12613 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoClean up Host_Init a bit by moving other client init routines to CL_Init
cloudwalk [Sat, 30 May 2020 19:59:12 +0000 (19:59 +0000)]
Clean up Host_Init a bit by moving other client init routines to CL_Init

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12612 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix compile warning.
cloudwalk [Sat, 30 May 2020 19:59:11 +0000 (19:59 +0000)]
Fix compile warning.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12611 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoStart video _during_ initialization, rather than when finding a model
cloudwalk [Sat, 30 May 2020 19:59:11 +0000 (19:59 +0000)]
Start video _during_ initialization, rather than when finding a model

Fixes Steel Storm: Burning Retribution crashing on start due to a NULL
array that isn't initialized before MQC draws their intro video.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12610 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix compile warning with bitwise operation
cloudwalk [Sat, 30 May 2020 19:59:10 +0000 (19:59 +0000)]
Fix compile warning with bitwise operation

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12609 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoChange taskqueue_minthreads to 0, resulting in considerable performance increase
cloudwalk [Fri, 29 May 2020 22:39:43 +0000 (22:39 +0000)]
Change taskqueue_minthreads to 0, resulting in considerable performance increase

Nothing needs 4 threads just sitting there spinning at the moment.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12608 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix long standing compile warning that might bite later
cloudwalk [Fri, 29 May 2020 22:37:16 +0000 (22:37 +0000)]
Fix long standing compile warning that might bite later

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12607 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix incorrect variables in THREADDEBUG prints causing compile errors
cloudwalk [Fri, 29 May 2020 22:37:16 +0000 (22:37 +0000)]
Fix incorrect variables in THREADDEBUG prints causing compile errors

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12606 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoPass an offset of data_element3i rather than data_element3i itself
cloudwalk [Fri, 29 May 2020 03:35:36 +0000 (03:35 +0000)]
Pass an offset of data_element3i rather than data_element3i itself

Second part of the previous commit that was missed.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12605 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoPass num_triangles per surface rather than for the entire surfmesh
cloudwalk [Fri, 29 May 2020 02:35:18 +0000 (02:35 +0000)]
Pass num_triangles per surface rather than for the entire surfmesh

Committing on behalf of havoc. Fixes potential bugs on multi-texture
model formats and makes hitmodel traces faster.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12604 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoImplement experimental hook-like system, with working example.
cloudwalk [Thu, 28 May 2020 13:53:30 +0000 (13:53 +0000)]
Implement experimental hook-like system, with working example.

This system allows you to call functions that may or may not exist at runtime
and compile-time. You create hook_t pointers and register them during
initialization, and point them to a function. If they're not registered,
no problem. This could potentially allow different subsystems to function
independently of each other, such as the client and server.

It's using a union to allow functions to have any return type they want.
However, for obvious reasons, functions cannot have any parameters they want
and must accept a pointer to the union type where the actual args are stored.

This is experimental and there may be bugs, but the current working example
should be stable.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12603 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix defer command. Maintain separate oldrealtime(s) per interpreter
cloudwalk [Wed, 27 May 2020 19:16:31 +0000 (19:16 +0000)]
Fix defer command. Maintain separate oldrealtime(s) per interpreter

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12602 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix incorrect types causing fp precision errors with movable brush entities, etc
cloudwalk [Wed, 27 May 2020 16:12:30 +0000 (16:12 +0000)]
Fix incorrect types causing fp precision errors with movable brush entities, etc

float -> double. This fixes an odd bug where some func_buttons would get stuck
after blocking them long enough.

Thanks to Mario (Xonotic) for finding this.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12601 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFormatting fix
cloudwalk [Wed, 27 May 2020 15:18:20 +0000 (15:18 +0000)]
Formatting fix

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12600 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd .vscode to .gitignore
cloudwalk [Wed, 27 May 2020 13:10:56 +0000 (13:10 +0000)]
Add .vscode to .gitignore

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12599 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRemove the deprecatedq3* fields finally after so many years, this removes the mod_col...
havoc [Wed, 27 May 2020 04:32:57 +0000 (04:32 +0000)]
Remove the deprecatedq3* fields finally after so many years, this removes the mod_collision_bih cvar as it is always using BIH implementations now.

Also move the texture_t.name field to the start of the struct to make debugging more pleasant.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12598 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix a warning and remove an unused prototype.
havoc [Wed, 27 May 2020 04:30:40 +0000 (04:30 +0000)]
Fix a warning and remove an unused prototype.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12597 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRemove dp_model_t.brushq2 field because it's never been used (q2bsp is loaded into...
havoc [Wed, 27 May 2020 03:53:16 +0000 (03:53 +0000)]
Remove dp_model_t.brushq2 field because it's never been used (q2bsp is loaded into the brushq1 struct due to how similar it is).

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12596 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix major regression preventing connect to any server using curl for custom CSQC
cloudwalk [Wed, 27 May 2020 01:07:28 +0000 (01:07 +0000)]
Fix major regression preventing connect to any server using curl for custom CSQC

The command interpreters must be executed in sequence with clientfromserver
being the first, otherwise curl won't get a chance to run before the client
continues connecting. A few more commands were also missing from the
interpreter and were added.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12595 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAllocate Q3BSP texturepool earlier in the loading process
cloudwalk [Tue, 26 May 2020 18:04:54 +0000 (18:04 +0000)]
Allocate Q3BSP texturepool earlier in the loading process

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12594 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix crash when building Q3BSP lightgrid. Added missing R_AllocTexturePool call.
cloudwalk [Tue, 26 May 2020 17:48:44 +0000 (17:48 +0000)]
Fix crash when building Q3BSP lightgrid. Added missing R_AllocTexturePool call.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12593 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix most compiler warnings.
cloudwalk [Tue, 26 May 2020 16:41:59 +0000 (16:41 +0000)]
Fix most compiler warnings.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12592 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix compiler warning in custom stat clearing
cloudwalk [Tue, 26 May 2020 16:41:58 +0000 (16:41 +0000)]
Fix compiler warning in custom stat clearing

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12591 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoClean up qtypes.h. Use stdbool.h on non-MSVC. Replace allcaps with lowercase
cloudwalk [Tue, 26 May 2020 16:41:57 +0000 (16:41 +0000)]
Clean up qtypes.h. Use stdbool.h on non-MSVC. Replace allcaps with lowercase

Last I checked, stdbool.h is only unavailable on Windows MSVC, so we'll define
bool ourselves in that case.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12590 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoOops.
cloudwalk [Tue, 26 May 2020 15:05:09 +0000 (15:05 +0000)]
Oops.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12589 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoShow SDL message box on Sys_Error for SDL target. Removed Windows message box
cloudwalk [Tue, 26 May 2020 14:40:35 +0000 (14:40 +0000)]
Show SDL message box on Sys_Error for SDL target. Removed Windows message box

Added a new command-line option "-nocrashdialog" to disable, if needed.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12588 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix getting exe name on FreeBSD, which hasn't used /proc for quite a while now
cloudwalk [Tue, 26 May 2020 14:17:44 +0000 (14:17 +0000)]
Fix getting exe name on FreeBSD, which hasn't used /proc for quite a while now

From https://gitlab.com/xonotic/darkplaces/-/merge_requests/54

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12587 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix pure data entities being linked into the area grid, causing performance hit
cloudwalk [Tue, 26 May 2020 13:59:03 +0000 (13:59 +0000)]
Fix pure data entities being linked into the area grid, causing performance hit

From Mario (Xonotic).

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12586 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoImplement clipgroup extension from DarkplacesRM
cloudwalk [Tue, 26 May 2020 13:38:28 +0000 (13:38 +0000)]
Implement clipgroup extension from DarkplacesRM

This allows magical things to happen, such as disabling teammate collision
in Xonotic.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12585 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdded lightgrid texture based lighting in q3bsp maps by uploading it as a 3D texture...
havoc [Tue, 26 May 2020 08:34:12 +0000 (08:34 +0000)]
Added lightgrid texture based lighting in q3bsp maps by uploading it as a 3D texture, to make more accurate and continuous model lighting throughout a scene.  Can be disabled via the mod_q3bsp_lightgrid_texture cvar.

The lightgrid texture based lighting can also be enabled on world surfaces if one desires (mod_q3bsp_lightgrid_world_surfaces cvar) which gives levels a dream-like quality that is globally consistent, can also be enabled for bsp models that are not the world (mod_q3bsp_lightgrid_bsp_surfaces cvar) which may be more useful for ammo pickup models that are bsp or similar.

This frobs the shader glsl crc so expect to update any modified combined*.glsl files as per usual with updates to the embedded shader code.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12584 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoChange the ping calculation back. It wasn't necessary to change it.
cloudwalk [Tue, 26 May 2020 04:04:05 +0000 (04:04 +0000)]
Change the ping calculation back. It wasn't necessary to change it.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12583 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRevert "Fix visual regression where parts of the Xonotic menu lacked transparency."
cloudwalk [Mon, 25 May 2020 23:19:39 +0000 (23:19 +0000)]
Revert "Fix visual regression where parts of the Xonotic menu lacked transparency."

This reverts commit b64a47fd50ff44fcbd04b6a4288eba135177081a.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12582 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoDon't query the master server when the menu isn't shown
cloudwalk [Mon, 25 May 2020 23:19:38 +0000 (23:19 +0000)]
Don't query the master server when the menu isn't shown

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12581 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoCalculate ping in the server list better.
cloudwalk [Mon, 25 May 2020 23:19:38 +0000 (23:19 +0000)]
Calculate ping in the server list better.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12580 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoWith MATERIALFLAG_ALPHAGEN_VERTEX we should basically always use MATERIALFLAG_ALPHA...
havoc [Mon, 25 May 2020 22:46:47 +0000 (22:46 +0000)]
With MATERIALFLAG_ALPHAGEN_VERTEX we should basically always use MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW - this should fix UI rendering issues with alpha being ignored on DrawQ_Pic et al.

Minor shuffling of flag order in lightning beam texture loading to be consistent with the other uses - no behavior changes.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12579 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoMake sv_cheats instant. No need to restart the map anymore.
cloudwalk [Mon, 25 May 2020 15:59:14 +0000 (15:59 +0000)]
Make sv_cheats instant. No need to restart the map anymore.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12578 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoMake sv_cheats CVAR_NOTIFY
cloudwalk [Mon, 25 May 2020 15:59:14 +0000 (15:59 +0000)]
Make sv_cheats CVAR_NOTIFY

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12577 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoChange default value of sv_disablenotify to 0. Print to chat.
cloudwalk [Mon, 25 May 2020 15:59:13 +0000 (15:59 +0000)]
Change default value of sv_disablenotify to 0. Print to chat.

Also tweaked message to be a tad clearer of what changed.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12576 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoImplement Con_Error(f) and Con_Warn(f), error and warning, for prettier colors
cloudwalk [Mon, 25 May 2020 15:59:13 +0000 (15:59 +0000)]
Implement Con_Error(f) and Con_Warn(f), error and warning, for prettier colors

Replace Con_Print(f) for most of the obvious cases.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12575 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoDon't continue loading image if we already have it cached. Fix mapshot caching
cloudwalk [Mon, 25 May 2020 13:59:09 +0000 (13:59 +0000)]
Don't continue loading image if we already have it cached.  Fix mapshot caching

From Slava: "Previously engine wasn't using cached mapshots, so it was reloading
mapshot everytime."

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12574 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix most Q3 & QL glow maps
cloudwalk [Mon, 25 May 2020 13:51:59 +0000 (13:51 +0000)]
Fix most Q3 & QL glow maps

From bones_was_here: "Very few glow maps work in unmodified Q3 maps as they do not use the _glow darkplaces convention, instead Q3 shaders specify the file name to use which is not currently supported.
Fortunately there is a naming convention started in id software's pak0 and continued in QL and most 3rd party maps.  It uses these forms: foo_texture.blend.ext and bar_texture_blend.ext
It's not possible to fix 100% of glow maps without parsing Q3 shaders and using the specified file name, but this is a big improvement.
This also fixes a few glow maps in nexcompat, which are originally Q3 textures that were not renamed to _glow."

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12573 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix visual regression where parts of the Xonotic menu lacked transparency.
cloudwalk [Mon, 25 May 2020 12:51:08 +0000 (12:51 +0000)]
Fix visual regression where parts of the Xonotic menu lacked transparency.

Set ent->render.alpha to its old value of 0.999999f. This doesn't seem to break
anything else, or anything that was recently fixed. There's probably a better
fix, but this is simple and seems to work for now.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12572 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoForcibly disable the alphatocoverage feature because we don't currently use MSAA...
havoc [Mon, 25 May 2020 08:13:16 +0000 (08:13 +0000)]
Forcibly disable the alphatocoverage feature because we don't currently use MSAA antialiasing and it only works for that, resulting in broken rendering.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12571 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAllow r_viewscale to be set to values higher than 1 for super-sample antialiasing...
havoc [Mon, 25 May 2020 08:11:22 +0000 (08:11 +0000)]
Allow r_viewscale to be set to values higher than 1 for super-sample antialiasing, also integrate vid_samples into this calculation to restore old behavior somewhat (super-sampling is more expensive than multisampling, so this isn't a great solution yet, but it brings back the quality).  Still need to implement a better SSAA filter for when the antialiasing is in effect.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12570 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd csqc_polygons_defaultmaterial_nocullface cvar which defaults to 1 in nexuiz and...
havoc [Mon, 25 May 2020 08:10:04 +0000 (08:10 +0000)]
Add csqc_polygons_defaultmaterial_nocullface cvar which defaults to 1 in nexuiz and xonotic derived games, this restores the compatible behavior with older versions of the engine.  It defaults to 0 in other games (and would be recommended to set to 0 in those games when they make a new release) as it seems like that would be the better default for efficiency (and matches FTEQW engine).

Fixed a bug in CL_MeshEntities_FinalizeRenderEntity where it skipped finalize when the entity has no surfaces, but since it is still included in the render entities list it was rendering garbage when unused.

Use the "$whiteimage" texture for CSQC/UI polygons (VM_CL_R_PolygonBegin) that specify texture "", to be compatible with older versions.

Clarify the name of a parameter on Mod_Mesh_GetTexture prototype to match the implementation as it was misleading otherwise.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12569 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd support for textures named "*white" and "$whiteimage" in the embedded image loade...
havoc [Mon, 25 May 2020 07:17:51 +0000 (07:17 +0000)]
Add support for textures named "*white" and "$whiteimage" in the embedded image loader, for better Q3 shader compatibility.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12568 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoReworked VM_CL_PolygonBegin/Vertex/End functions to do the commit to the mesh in...
havoc [Mon, 25 May 2020 04:18:02 +0000 (04:18 +0000)]
Reworked VM_CL_PolygonBegin/Vertex/End functions to do the commit to the mesh in PolygonEnd, this allows it to examine if alpha is used on vertices and request different variants of a material according to such discoveries.

Refactored CL_MeshEntities_AddToScene and CL_MeshEntities_Reset to be the more distinct stages of CL_MeshEntities_Scene_Clear (which is called in VM_CL_R_ClearScene), CL_MeshEntities_Scene_AddRenderEntity (which is called during VM_CL_R_AddEntities), and CL_MeshEntities_Scene_FinalizeRenderEntity (which is called during VM_CL_R_RenderScene) - this fixes issues with CSQC predraw functions adding polygons which were not subject to Finalize and thus not rendered.

Fixed Mod_LoadTextureFromQ3Shader handling of texture name "" to properly set basematerialflags, this fixes invisible polygons in some games such as Xonotic.

Refactored CL_Mesh_CSQC and CL_Mesh_Debug into CL_Mesh_Scene - not really a need for more than one mesh to overlay on the world.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12567 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRefactored VM_SV_AddStat to allow overrides of all stats (0..255) in a more consisten...
havoc [Mon, 25 May 2020 04:10:27 +0000 (04:10 +0000)]
Refactored VM_SV_AddStat to allow overrides of all stats (0..255) in a more consistent way, added warnings if overriding engine stats.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12566 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd MSVS2019 project and solution files.
havoc [Sun, 24 May 2020 17:43:08 +0000 (17:43 +0000)]
Add MSVS2019 project and solution files.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12565 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix FS_Seek for compressed file from PK3
cloudwalk [Sun, 24 May 2020 14:18:15 +0000 (14:18 +0000)]
Fix FS_Seek for compressed file from PK3

From Slava: "Currently FS_Seek works incorrectly with compressed files from PK3 but this issue isn't noticed because in most cases engine is using FS_LoadFile which reads file sequentially without seeking."

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12564 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRevert "Don't try to spawn if the worldmodel is missing. No way it's playable w/o it"
cloudwalk [Sun, 24 May 2020 13:31:40 +0000 (13:31 +0000)]
Revert "Don't try to spawn if the worldmodel is missing. No way it's playable w/o it"

This reverts commit 621bfbef71c6a151a6191ddbc0fabd0629e830ac.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12563 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRework r_shadow_shadowmode to be more maintainable and understandable - it now caches...
havoc [Sun, 24 May 2020 07:06:25 +0000 (07:06 +0000)]
Rework r_shadow_shadowmode to be more maintainable and understandable - it now caches the values of r_shadow_shadowmapping and r_shadow_deferred, and is now updated when those change, rather than just at startup, and changing those now also causes a recompile of world lights (which always had different bounds when shadowing was on/off, toggling shadows had weird behavior as a result, so this is a bugfix).

This fixes a massive fps drain with settings that disabled shadows entirely by disabling shadowmapping (where r_shadow_shadowmapping 0 and r_shadow_deferred 0 together caused it to reallocate the shadowmap texture every frame and do other bad stuff)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12562 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix r_celoutlines description to not mention OpenGL 2.x as that's no longer relevant.
havoc [Sun, 24 May 2020 07:04:05 +0000 (07:04 +0000)]
Fix r_celoutlines description to not mention OpenGL 2.x as that's no longer relevant.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12561 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix a size_t comparison warning by doing the math better.
havoc [Sun, 24 May 2020 07:03:22 +0000 (07:03 +0000)]
Fix a size_t comparison warning by doing the math better.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12560 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd curl to clientfromserver interpreter.
cloudwalk [Sun, 24 May 2020 03:42:43 +0000 (03:42 +0000)]
Add curl to clientfromserver interpreter.

Custom maps should now download on Xonotic.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12559 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix Windows-specific use-after-free causing crash after disconnecting
cloudwalk [Sat, 23 May 2020 22:22:30 +0000 (22:22 +0000)]
Fix Windows-specific use-after-free causing crash after disconnecting

This explicitly deregisters CSQC commands every time CSQC shuts down. This patch
also avoids Z_Malloc'ing the cmd names for each CSQC command and avoids forcing
a Cmd_AddCommand if the command exists.

CSQC was force-adding a command even if it already existed, and when it did,
it would pass a pointer from a mempool that would later get freed when
CSQC shuts down, and Windows' strcasecmp doesn't like dangling pointers.
The Z_Malloc wasn't much better because it could have caused a memory leak.
So the best solution was to only pass the pointer but make sure the commands
are freed when CSQC shuts down.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12558 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoPrint "Disconnected" only if actually disconnecting from a server
cloudwalk [Sat, 23 May 2020 06:29:34 +0000 (06:29 +0000)]
Print "Disconnected" only if actually disconnecting from a server

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12557 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoSlight refactor of loading screen. Starting a local server is now flicker-free
cloudwalk [Sat, 23 May 2020 06:29:33 +0000 (06:29 +0000)]
Slight refactor of loading screen. Starting a local server is now flicker-free

Added SCR_EndLoadingPlaque and added a variable to avoid drawing other 2D
elements while the loading screen is active.

Removed unused parameter in SCR_DrawLoadingScreen

This is a bit of a hacky solution but works for now, pending a bigger refactor.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12556 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoPrint when disconnected
cloudwalk [Sat, 23 May 2020 06:29:33 +0000 (06:29 +0000)]
Print when disconnected

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12555 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRemove duplicate function call. CL_Disconnect already does this.
cloudwalk [Sat, 23 May 2020 06:29:33 +0000 (06:29 +0000)]
Remove duplicate function call. CL_Disconnect already does this.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12554 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix regression causing loading screen to flicker while in game
cloudwalk [Fri, 22 May 2020 01:54:30 +0000 (01:54 +0000)]
Fix regression causing loading screen to flicker while in game

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12553 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix missing loading screen text. A redraw must always occur when pushing.
cloudwalk [Thu, 21 May 2020 18:57:50 +0000 (18:57 +0000)]
Fix missing loading screen text. A redraw must always occur when pushing.

A DrawQ_Finish call is also required. For loading text to work early in startup, Mod_Mesh_Create must be called early as well.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12552 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoMake Sys_Error message more generic. Quake -> Engine
cloudwalk [Thu, 21 May 2020 15:02:54 +0000 (15:02 +0000)]
Make Sys_Error message more generic. Quake -> Engine

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12551 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoNew prvm_stringdebug cvar to print string-related warnings. Off by default.
cloudwalk [Wed, 20 May 2020 22:48:07 +0000 (22:48 +0000)]
New prvm_stringdebug cvar to print string-related warnings. Off by default.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12550 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRevert "Set prvm_garbagecollection_enable to 0 by default."
cloudwalk [Wed, 20 May 2020 22:38:23 +0000 (22:38 +0000)]
Revert "Set prvm_garbagecollection_enable to 0 by default."

This reverts commit 138f6e1360565ecd406cb5777ac4c7d2c1c9bb62.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12549 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd a few commands to clientfromserver interpreter. Needed for QW connections
cloudwalk [Wed, 20 May 2020 15:22:08 +0000 (15:22 +0000)]
Add a few commands to clientfromserver interpreter. Needed for QW connections

With that, Quakeworld connections should work again.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12548 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoRemove signon check for QW reconnect. Client now follows server into next map
cloudwalk [Wed, 20 May 2020 15:22:07 +0000 (15:22 +0000)]
Remove signon check for QW reconnect. Client now follows server into next map

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12547 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoPrint different message for invalid sv->cl cmd. Improve consistency overall
cloudwalk [Wed, 20 May 2020 15:22:07 +0000 (15:22 +0000)]
Print different message for invalid sv->cl cmd. Improve consistency overall

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12546 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoMake sure the server<->client interpreters run.
cloudwalk [Wed, 20 May 2020 15:22:06 +0000 (15:22 +0000)]
Make sure the server<->client interpreters run.

This will help fix QW connections but a few more fixes will be needed.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12545 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoMake connections atomic. Disconnect before trying to connect.
cloudwalk [Wed, 20 May 2020 15:22:06 +0000 (15:22 +0000)]
Make connections atomic. Disconnect before trying to connect.

Fixes an issue where a demo freezes in place if you try to connect while one is
running. This also has the side effect of eliminating a duplicate call to
CL_StopPlayback, which is called by both CL_EstablishConnection and
CL_Disconnect (which is itself called by NetConn_ConnectionEstablished).

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12544 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoDon't try to spawn if the worldmodel is missing. No way it's playable w/o it
cloudwalk [Wed, 20 May 2020 15:22:05 +0000 (15:22 +0000)]
Don't try to spawn if the worldmodel is missing. No way it's playable w/o it

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12543 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoSet prvm_garbagecollection_enable to 0 by default.
cloudwalk [Wed, 20 May 2020 15:22:05 +0000 (15:22 +0000)]
Set prvm_garbagecollection_enable to 0 by default.

Also made it CVAR_SAVE for convenience when testing, so one doesn't have to
remember to enable it every time. This is temporary.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12542 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoReset r_shadow_occlusion_buf on vid_restart. Fixes query buffer dangling pointer
cloudwalk [Tue, 19 May 2020 18:52:55 +0000 (18:52 +0000)]
Reset r_shadow_occlusion_buf on vid_restart. Fixes query buffer dangling pointer

Basically, when coronas appear when r_coronas_occlusionquery is 1, the engine
binds to a query buffer and stores a pointer to it in r_shadow_occlusion_buf.
Upon vid_restart, somewhere along the way, the buffer is cleared but the
original pointer is kept, resulting in a crash next time a corona appears.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12541 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoTemporary workaround for tempstring offset console spam in Xonotic.
cloudwalk [Tue, 19 May 2020 14:06:35 +0000 (14:06 +0000)]
Temporary workaround for tempstring offset console spam in Xonotic.

Check if garbage collection is enabled before calling PRVM_GetString when handling OP_STORE_S or OP_STOREP_S

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12540 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoAdd gameversion_[min,max] to CVAR_SERVER.
cloudwalk [Mon, 18 May 2020 15:48:39 +0000 (15:48 +0000)]
Add gameversion_[min,max] to CVAR_SERVER.

Fixes broken version check that prevents the player from spawning in Xonotic.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12539 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoImplement chromatic aberration, configurable with r_colorfringe cvar.
cloudwalk [Mon, 18 May 2020 15:48:37 +0000 (15:48 +0000)]
Implement chromatic aberration, configurable with r_colorfringe cvar.
Do note that it is disabled by default and values higher than 0.025 will distort the image.

Taken from a merge request by cjayho.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12538 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix a few compile warnings. Remove unused locals.
cloudwalk [Mon, 18 May 2020 15:05:42 +0000 (15:05 +0000)]
Fix a few compile warnings. Remove unused locals.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12537 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix duplicate Cmd_AddCommand(s). Their funcs already forward to server.
cloudwalk [Mon, 18 May 2020 15:05:41 +0000 (15:05 +0000)]
Fix duplicate Cmd_AddCommand(s). Their funcs already forward to server.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12536 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix invalid offset spam when r_showbboxes_client is > 0
cloudwalk [Mon, 18 May 2020 14:26:20 +0000 (14:26 +0000)]
Fix invalid offset spam when r_showbboxes_client is > 0
This checks for server progs before touching viewmodelforclient as it's apparently not a client field.

From Mario (Xonotic)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12535 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix r_water_lowquality description
cloudwalk [Mon, 18 May 2020 14:22:16 +0000 (14:22 +0000)]
Fix r_water_lowquality description
From terencehill (Xonotic)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12534 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoDon't print warning when QC simply checks if a cachepic exists.
cloudwalk [Mon, 18 May 2020 14:09:42 +0000 (14:09 +0000)]
Don't print warning when QC simply checks if a cachepic exists.
From Mario (Xonotic).

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12533 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoFix a few bugs detected by Cppcheck
cloudwalk [Mon, 18 May 2020 03:10:15 +0000 (03:10 +0000)]
Fix a few bugs detected by Cppcheck
(warning) Logical conjunction always evaluates to false: matchrule < 0 && matchrule > 5.
(style) Condition 'k<16' is always true
(style) Variable 'settings->bounceminimumintensity2' is reassigned a value before the old one has been used.

From terencehill

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12532 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoSilence some noisy font-related prints. Make them debug prints.
cloudwalk [Sun, 17 May 2020 21:02:20 +0000 (21:02 +0000)]
Silence some noisy font-related prints. Make them debug prints.
From Mario.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12531 d7cf8633-e32d-0410-b094-e92efae38249

4 years agoUse SDL_GameController instead of SDL_Joystick where possible
cloudwalk [Sun, 17 May 2020 20:53:49 +0000 (20:53 +0000)]
Use SDL_GameController instead of SDL_Joystick where possible

SDL_GameController provides mappings between axis and button indices and a
general layout that is similar to a XBox 360 controller. Since this layout is
common, these changes allow creating proper controller mappings for a large
variety of gamepad/OS combinations out of the box.

Change initially provided by EACFreddy. Fixed multiple crashes due to a stale
pointer. Also made a Con_Printf a DPrintf and removed ifdefs for SDL2 since
master doesn't support SDL1 anymore.

There's a strange stick drift problem. It might be my controller but
it'll have to be investigated further.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12530 d7cf8633-e32d-0410-b094-e92efae38249