]> git.rm.cloudns.org Git - xonotic/darkplaces.git/log
xonotic/darkplaces.git
5 weeks agoAdd FS_RenameOnClose, to be able to mark open files for renaming on closing.
Des [Fri, 9 Aug 2024 16:29:43 +0000 (13:29 -0300)]
Add FS_RenameOnClose, to be able to mark open files for renaming on closing.

8 weeks agoChange directory text colour in console from blue to light cyan (#197)
James O'Neill [Wed, 18 Sep 2024 15:05:51 +0000 (00:05 +0900)]
Change directory text colour in console from blue to light cyan (#197)

Updates the console text colour for directories from dark blue to light
cyan. Fixed #196

![colour-old](https://github.com/user-attachments/assets/1e850b31-39a5-48b6-8804-6dd679f2f0f0)

![colour-new](https://github.com/user-attachments/assets/74124d33-cd0c-4b14-bf21-c65f0709cfd3)

8 weeks agoMerge MR 'Improve cl_autodemo_delete description'
bones_was_here [Sun, 15 Sep 2024 06:09:53 +0000 (06:09 +0000)]
Merge MR 'Improve cl_autodemo_delete description'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/162

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
8 weeks agoFix scr_loadingscreen_maxfps, related polishing
bones_was_here [Sat, 14 Sep 2024 07:58:03 +0000 (17:58 +1000)]
Fix scr_loadingscreen_maxfps, related polishing

Since that cvar was implemented, unix time has grown too large to be
represented precisely by a float, causing FPS to be much lower than
configured. Should be using host.realtime (relative) here anyway.

Simplifies Curl_Select() and improves some debug messages.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
8 weeks agocon: implement 24-bit RGB terminal output
bones_was_here [Thu, 15 Aug 2024 14:11:22 +0000 (00:11 +1000)]
con: implement 24-bit RGB terminal output

Mode 2 behaves like the familiar mode 1 for best compatibility with
terminal themes and expectations.
Mode 3 behaves like the ingame console.

2 is now the default on Linux.

Moves the r_text* cvar change from
d987323e8a9bcc3102c96a237f74875d5b37c4e4 to a better place, and
documents it.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agogame: add "Coppertone Summer Jam 2"
bones_was_here [Sat, 7 Sep 2024 08:32:37 +0000 (18:32 +1000)]
game: add "Coppertone Summer Jam 2"

So we can work around its bug (race condition) that makes start.bsp
unplayble sometimes because apparently DP is faster at connecting the
local client than some other engines, and this mod relies on it taking
longer.

Updates some com_game comments for IDEs/Doxygen.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agohost: make some startup errors non-fatal, related polishing and cleanup
bones_was_here [Thu, 5 Sep 2024 20:05:07 +0000 (06:05 +1000)]
host: make some startup errors non-fatal, related polishing and cleanup

It's annoying to abort DP just because of a bad menu progs or demo,
especially on Windows where accessing stdout is difficult so console
access is more important.

Shows a correct fallback message when the menu progs crashes (it's not
because of missing files).
Makes the missing files message more concise.

Performs a full cleanup after any QC crash, most importantly
progs->loaded is now false until that VM is restarted successfully.

Prevents menu failure interfering with more important VMs.

Removes the weird "early frame abort" jump point which is redundant now
because Host_Error, now the only code that ever aborts a frame, calls
Sys_Error instead of Host_AbortCurrentFrame during init.

Changes the framecount of the first frame from 0 to 1 so that when it's
>0 that means frame abort is now possible and safe.

Removes an old FIXME that was addressed.

Adds names for the host states.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoGL: Remove some D3D cruft
bones_was_here [Fri, 30 Aug 2024 06:46:46 +0000 (16:46 +1000)]
GL: Remove some D3D cruft

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoGL: Use the render path switch properly in GL_ReadPixelsBGRA()
bones_was_here [Thu, 5 Sep 2024 18:47:46 +0000 (04:47 +1000)]
GL: Use the render path switch properly in GL_ReadPixelsBGRA()

This will be needed for screenshots to work with GLES when standard
builds support both GLES and GL.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoGL: improve debugging
bones_was_here [Sat, 31 Aug 2024 10:17:46 +0000 (20:17 +1000)]
GL: improve debugging

Makes gl_debug work in standard builds (it has no cost when disabled).

Removes registration of gl_printcheckerror in standard builds where it
does nothing (still declared because it might be set by -developer3).

Makes various GL errors red, warnings yellow.

GL_TABLE_TOO_LARGE was removed in GL 3, GLES doesn't have it either.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agocl_capturevideo: handle failure to open the video file
bones_was_here [Mon, 2 Sep 2024 16:49:25 +0000 (02:49 +1000)]
cl_capturevideo: handle failure to open the video file

Fixes https://gitlab.com/xonotic/darkplaces/-/issues/72

Shuts down when -capturedemo cmdline fails instead of leaving the demo
running.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agocl_capturevideo: accelerate scaling and transfer
bones_was_here [Thu, 29 Aug 2024 03:57:41 +0000 (13:57 +1000)]
cl_capturevideo: accelerate scaling and transfer

Improves cl_capturevideo_printfps.
Renames some func ptrs for clarity.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agocl_capturevideo: fix extremely slow demo capture perf
bones_was_here [Sun, 25 Aug 2024 16:20:45 +0000 (02:20 +1000)]
cl_capturevideo: fix extremely slow demo capture perf

If the recording started before the playdemo, or in the same command
string, most of the CPU time was spent sleeping.

Also fixes a stall when starting the recording.

Minor cleanup.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd_mutewhenidle: add only-when-minimised mode, fix cl_capturevideo compat, cleanup
bones_was_here [Sun, 25 Aug 2024 02:43:30 +0000 (12:43 +1000)]
snd_mutewhenidle: add only-when-minimised mode, fix cl_capturevideo compat, cleanup

Maybe snd_mutewhenidle 2 should be the default?

When inactive/minimised with snd_mutewhenidle enabled, the audio capture
was unreliable and sound was sometimes output when it should have been
muted.
Closes https://gitlab.com/xonotic/darkplaces/-/issues/92
(the video issue was already fixed).

Timedemos now share the same mute implementation as snd_mutewhenidle.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: make SDL buffer length configurable
bones_was_here [Wed, 4 Sep 2024 19:40:00 +0000 (05:40 +1000)]
snd: make SDL buffer length configurable

Makes it (approximately) independent of sample rate (snd_speed).

Changes the default (at 48khz) from 2048 to 1024, still not as
aggressive as some other engines.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: doxygen compat and related whitespace
bones_was_here [Wed, 4 Sep 2024 17:40:05 +0000 (03:40 +1000)]
snd: doxygen compat and related whitespace

IDEs also support these comment formats.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: header cleanup
bones_was_here [Mon, 9 Sep 2024 13:12:50 +0000 (23:12 +1000)]
snd: header cleanup

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: remove extra updates
bones_was_here [Wed, 4 Sep 2024 16:39:54 +0000 (02:39 +1000)]
snd: remove extra updates

These are redundant now that the only audio output is via the SDL
callback which performs additonal mixing as needed.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: remove unused OSS code
bones_was_here [Sun, 25 Aug 2024 15:41:46 +0000 (01:41 +1000)]
snd: remove unused OSS code

This backend is supported via SDL2.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosnd: don't lock the device while we already have the lock
bones_was_here [Sun, 25 Aug 2024 15:34:33 +0000 (01:34 +1000)]
snd: don't lock the device while we already have the lock

while also having a comment about how we don't need to do it...

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agonet_slist: timeout-related fixes
bones_was_here [Thu, 12 Sep 2024 11:52:43 +0000 (21:52 +1000)]
net_slist: timeout-related fixes

Ignores refresh requests while a refresh is in progress.
This prevents live servers getting timed out, which sometimes happened
when Xonotic menu QC responded to a server list mouseover event.

Fixes incorrect types in timeout check and ping comparison.

Adds some debug messages.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agonet_slist: update QW masters, improve net_slist_debug QW messages
bones_was_here [Thu, 5 Sep 2024 11:24:30 +0000 (21:24 +1000)]
net_slist: update QW masters, improve net_slist_debug QW messages

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agonet_slist: fix crash when there's no servers and net_slist_debug is enabled
bones_was_here [Wed, 4 Sep 2024 13:15:53 +0000 (23:15 +1000)]
net_slist: fix crash when there's no servers and net_slist_debug is enabled

The crash was introduced in 5772ed20c13d65ac46e4ba60d153287a8a631ec5.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoImprove cl_autodemo_delete description
terencehill [Thu, 29 Aug 2024 13:04:25 +0000 (15:04 +0200)]
Improve cl_autodemo_delete description

Signed-off-by: terencehill <piuntn@gmail.com>
2 months agoAdd a debug cvar that offsets entity numbers of human clients
terencehill [Tue, 27 Aug 2024 22:47:44 +0000 (00:47 +0200)]
Add a debug cvar that offsets entity numbers of human clients

Signed-off-by: terencehill <piuntn@gmail.com>
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoserver: fix the save command's checks for multiplayer/dedicated
bones_was_here [Sun, 25 Aug 2024 10:17:29 +0000 (20:17 +1000)]
server: fix the save command's checks for multiplayer/dedicated

Also makes the save and load messages nicer.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoserver: don't report lag during intermission
bones_was_here [Sun, 25 Aug 2024 07:18:17 +0000 (17:18 +1000)]
server: don't report lag during intermission

Some games do memory or cpu intensive things then.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agosys: make TimeString thread-safe
bones_was_here [Sat, 24 Aug 2024 18:22:08 +0000 (04:22 +1000)]
sys: make TimeString thread-safe

Also avoids copying to an intermediate buffer in the warmer paths.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agomathlib: rename some macro parameters for clarity
bones_was_here [Fri, 23 Aug 2024 11:00:16 +0000 (21:00 +1000)]
mathlib: rename some macro parameters for clarity

So I don't have to keep looking up which is which.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoPRVM: reset GETTIME_FRAMESTART at VM startup, improve documentation
bones_was_here [Fri, 23 Aug 2024 09:26:31 +0000 (19:26 +1000)]
PRVM: reset GETTIME_FRAMESTART at VM startup, improve documentation

Avoids precision issues on servers with long GETTIME_UPTIME.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoFix documentation in vid and PRVM headers
bones_was_here [Tue, 20 Aug 2024 19:34:15 +0000 (05:34 +1000)]
Fix documentation in vid and PRVM headers

Also fixes a trivial warning.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agobuild: set stack limit on Windows and Emscripten to match other platforms
bones_was_here [Sun, 18 Aug 2024 20:12:07 +0000 (06:12 +1000)]
build: set stack limit on Windows and Emscripten to match other platforms

Linux, FreeBSD, macOS all default to 8MB for the main thread. MSVC
defaulted to 1MB, MinGW GCC to 2MB.

Optimises Emscripten build slightly and replaces its deprecated
TOTAL_STACK setting.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoMerge PR 'Only use BoxTouchingVisibleLeafs when not using r_novis'
James O'Neill [Thu, 15 Aug 2024 14:09:14 +0000 (23:09 +0900)]
Merge PR 'Only use BoxTouchingVisibleLeafs when not using r_novis'

Updates the entity visibility check in `R_View_UpdateEntityVisible` so
that with `r_novis 1` entities are rendered when the player is outside
of the level.

Resolves https://github.com/DarkPlacesEngine/DarkPlaces/issues/188

See https://github.com/DarkPlacesEngine/DarkPlaces/pull/192

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
2 months agoFix some pedantic compiler stuff and a warning off-by-1
bones_was_here [Thu, 15 Aug 2024 14:01:51 +0000 (00:01 +1000)]
Fix some pedantic compiler stuff and a warning off-by-1

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge PR 'Added Webassembly support and fixed GLES2 (somewhat)'
Lockl00p [Sun, 11 Aug 2024 17:43:09 +0000 (12:43 -0500)]
Merge PR 'Added Webassembly support and fixed GLES2 (somewhat)'

Webassembly version doesn’t work online and screen flashes on GLES2 are
opaque.

See https://github.com/DarkPlacesEngine/DarkPlaces/pull/169

---------

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Co-authored-by: James O'Neill <hemebond@gmail.com>
Co-authored-by: bones_was_here <bones_was_here@xonotic.au>
3 months agonet_slist: improve warnings and debug messages
bones_was_here [Sun, 11 Aug 2024 13:46:50 +0000 (23:46 +1000)]
net_slist: improve warnings and debug messages

Detects out-of-order packets in dpmaster replies.
Hides IPv6 master timeouts by default.
Adds more info to some messages.
Uses consistent VM warnings for all the QC builtins.

Also some nitpicking.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge MR 'Reduce the amount of unnecessary messages shown in the game chat'
bones_was_here [Wed, 7 Aug 2024 17:33:15 +0000 (17:33 +0000)]
Merge MR 'Reduce the amount of unnecessary messages shown in the game chat'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/155

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoReduce the amount of unnecessary messages shown in the game chat
Mario [Wed, 7 Aug 2024 17:33:15 +0000 (17:33 +0000)]
Reduce the amount of unnecessary messages shown in the game chat

Some engine messages are being printed to chat in scenarios where they may obscure regular game chat.

To help with this, I've adjusted the visibility of them:
- "unconnected changed name to BOT" and "BOT left the game" showing in chat have been disabled by only allowing such messages to show for real clients
  Bots will still show that they've been dropped in the console and Xonotic still shows a (dis)connect message
- Verbose "Server lag report" messages (most commonly seen during map votes) have been moved to the console

3 months agoMerge MR 'Update AMD Windows black texture bug fix hack to work on newer GPUs'
bones_was_here [Wed, 7 Aug 2024 16:16:00 +0000 (16:16 +0000)]
Merge MR 'Update AMD Windows black texture bug fix hack to work on newer GPUs'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/157

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge MR 'sv_sendentities_csqc_randomize_order: send CSQC entities in somewhat random...
bones_was_here [Wed, 7 Aug 2024 15:50:46 +0000 (15:50 +0000)]
Merge MR 'sv_sendentities_csqc_randomize_order: send CSQC entities in somewhat randomized order.'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/151

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoUpdate AMD Windows black texture bug fix hack to work on newer GPUs
Mario [Wed, 7 Aug 2024 05:10:57 +0000 (15:10 +1000)]
Update AMD Windows black texture bug fix hack to work on newer GPUs

3 months agosv_sendentities_csqc_randomize_order: send entities in somewhat randomized order.
Rudolf Polzer [Tue, 25 Jun 2024 19:13:46 +0000 (15:13 -0400)]
sv_sendentities_csqc_randomize_order: send entities in somewhat randomized order.

Should improve CSQC networking at low rates or high byte rate sending
mods.

No impact if sv_sendentities_csqc_randomize_order is 0. No impact to
non-CSQC entities (these already have a superior priority system).

Enabled by default; let's see how well this works.

3 months agoCLVM: improve getstati() warning
bones_was_here [Tue, 6 Aug 2024 04:01:06 +0000 (14:01 +1000)]
CLVM: improve getstati() warning

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agonudgeoutofsolid: implement fallback for when cliphulls are in use
bones_was_here [Mon, 5 Aug 2024 15:50:34 +0000 (01:50 +1000)]
nudgeoutofsolid: implement fallback for when cliphulls are in use

Fixes sv_gameplayfix_droptofloorstartsolid_nudgetocorrect and
DP_QC_NUDGEOUTOFSOLID doing nothing on Q1BSP.

Fixes the Q1BSP condition in PHYS_NudgeOutOfSolid() to handle the exact
issue (so mod_q1bsp_polygoncollisions is properly supported).

Migrates unsticking code from server-specific to common.

Updates documentation.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoedict: fix escape parsing and make exceptions configurable
bones_was_here [Sun, 4 Aug 2024 10:49:40 +0000 (20:49 +1000)]
edict: fix escape parsing and make exceptions configurable

In 312123ecffc7e3dd892c7df754c911b47b9cdfaa a bug was introduced where
newlines were no longer supported in string fields.
This patch supports them again, which requires exceptions be
reintroduced to fully support some buggy maps, but this time there's a
cvar for documentation and adjustment.  The other notes and fixes in
https://github.com/DarkPlacesEngine/darkplaces/pull/185 still apply.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge MR 'Don't apply special default client cvar values in dedicated server'
bones_was_here [Mon, 5 Aug 2024 16:49:44 +0000 (16:49 +0000)]
Merge MR 'Don't apply special default client cvar values in dedicated server'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/156

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoDon't apply special default client cvar values in dedicated server, client cvars...
terencehill [Mon, 29 Jul 2024 21:37:04 +0000 (23:37 +0200)]
Don't apply special default client cvar values in dedicated server, client cvars don't exist

Signed-off-by: terencehill <piuntn@gmail.com>
3 months agocvar: remove remaining uses of legacy internal functions
bones_was_here [Thu, 1 Aug 2024 09:19:50 +0000 (19:19 +1000)]
cvar: remove remaining uses of legacy internal functions

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agocvar: add sv_dedicated for clean detection in scripts and SVQC
bones_was_here [Thu, 1 Aug 2024 06:14:35 +0000 (16:14 +1000)]
cvar: add sv_dedicated for clean detection in scripts and SVQC

To replace hacky methods like checking if the (QW-specific) qport cvar
is registered (which prints an error when it's not) in default.cfg.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agocl_net: fix two subtle flaws and simplify logic
bones_was_here [Fri, 26 Jul 2024 10:36:27 +0000 (20:36 +1000)]
cl_net: fix two subtle flaws and simplify logic

The code introduced in 42e86ab7892c3d8f5373402a714b73b2e040d81b had two
separate modes which was more complex than necessary and less robust in
high ping high jitter scenarios.

The 0ms packet check didn't work when the cause was aggressive time
synchronisation and a ping spike.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agophysics: fix a subtle prediction regression
bones_was_here [Wed, 31 Jul 2024 11:11:42 +0000 (21:11 +1000)]
physics: fix a subtle prediction regression

In 3d8f1ca7b142c0a9fd8c3b4a494b62dcce39ab71 a horizontal player speed
calculation was changed to include the vertical velocity and to no
longer be the speed, by use of the wrong macro.
This patch reverts those changes and adds a macro for this calculation.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoscr: update the centreprint buffer for the empty message
bones_was_here [Thu, 1 Aug 2024 12:17:14 +0000 (22:17 +1000)]
scr: update the centreprint buffer for the empty message

Fixes a bug introduced by me in
https://github.com/DarkPlacesEngine/darkplaces/pull/159 where a
`svc_finale` message with the empty string could cause a
previously displayed engine centreprint to appear again.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agofs: add `game` as alias of `gamedir` command
bones_was_here [Thu, 25 Jul 2024 11:26:26 +0000 (21:26 +1000)]
fs: add `game` as alias of `gamedir` command

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge MR 'Fix monsters that do not use MOVETYPE_STEP appearing choppy'
bones_was_here [Thu, 1 Aug 2024 17:52:36 +0000 (17:52 +0000)]
Merge MR 'Fix monsters that do not use MOVETYPE_STEP appearing choppy'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/154

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoFix monsters that do not use MOVETYPE_STEP appearing choppy
Mario [Thu, 1 Aug 2024 17:52:36 +0000 (17:52 +0000)]
Fix monsters that do not use MOVETYPE_STEP appearing choppy

Resolves https://github.com/DarkPlacesEngine/darkplaces/issues/82

Makes monster interpolation always apply to engine-networked entities with the FL_MONSTER flag.

3 months agocom: fix loop/crash in dpvsnprintf() error handling
bones_was_here [Tue, 23 Jul 2024 21:32:50 +0000 (07:32 +1000)]
com: fix loop/crash in dpvsnprintf() error handling

Somehow I didn't notice Sys_Printf() calls dpvsnprintf(), see
21fa9010ae6de8792f36cca08cb77aaa95d4b928.

Also fixes a minor bug where Sys_Print() could output more bytes than it
should, introduced in 01642af37128bffc1accbf2e92cb2428ea570720.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoPRVM: fix incorrect tempstring length in VM_tokenizebyseparator()
bones_was_here [Tue, 23 Jul 2024 15:35:18 +0000 (01:35 +1000)]
PRVM: fix incorrect tempstring length in VM_tokenizebyseparator()

This caused memcpy() in PRVM_SetTempString() to copy too many bytes,
when the source string had the maximum length it could read past the end
and trigger a segfault.
Bug was introduced in 26a665ff43052862131df3c63785f91861989fc8 and looks
to be specific to that builtin.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoVM_parseentitydata: parse backslash escapes
bones_was_here [Tue, 23 Jul 2024 05:49:36 +0000 (15:49 +1000)]
VM_parseentitydata: parse backslash escapes

Because VM_writetofile() will include them by calling the same code as
SV_Savegame_to().
Missed this in 312123ecffc7e3dd892c7df754c911b47b9cdfaa.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoPRVM: remove redundant VM name from some warnings
bones_was_here [Mon, 22 Jul 2024 06:07:16 +0000 (16:07 +1000)]
PRVM: remove redundant VM name from some warnings

Prolly should have included this in
17601b9cff2eea0e32d1520d9f69d02c1bb41d26.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoProperly unescape escaped characters in save file when loading (#185)
ITdevkc [Mon, 22 Jul 2024 20:27:37 +0000 (16:27 -0400)]
Properly unescape escaped characters in save file when loading (#185)

Modified PRVM_ED_ParseEdict to determine whether it is loading a save or
not, and unescape variables if loading a save.
Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/81

---------

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Co-authored-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoReduce stack usage by Con_CenterPrintf uis/centerprint
uis [Tue, 25 Jun 2024 20:44:53 +0000 (23:44 +0300)]
Reduce stack usage by Con_CenterPrintf

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMerge MR 'Reduce RAM usage in various structures'
bones_was_here [Sat, 20 Jul 2024 10:48:31 +0000 (20:48 +1000)]
Merge MR 'Reduce RAM usage in various structures'

As I understand in BIH_UNORDERED only children array is used, while front, back, min and max are never written. Opposite true for other node types.

On side note sizes should be explicitly added to ints.

See https://gitlab.com/xonotic/darkplaces/-/merge_requests/149

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agomodel_brush: slightly change bih math
uis [Mon, 13 May 2024 17:02:51 +0000 (20:02 +0300)]
model_brush: slightly change bih math

3 months agoSlightly improve branching performance for BIH collision
uis [Sat, 11 May 2024 02:16:42 +0000 (05:16 +0300)]
Slightly improve branching performance for BIH collision

3 months agoDo a little precalculation when traversing BIH
uis [Fri, 10 May 2024 22:32:57 +0000 (01:32 +0300)]
Do a little precalculation when traversing BIH

3 months agoUse lines instead of columns for some BIH tracing code
bones_was_here [Mon, 3 Jun 2024 15:19:22 +0000 (01:19 +1000)]
Use lines instead of columns for some BIH tracing code

See https://gitlab.com/xonotic/darkplaces/-/merge_requests/149 comments.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
3 months agoMove CRC tables to rodata section
uis [Sun, 21 Apr 2024 16:04:18 +0000 (19:04 +0300)]
Move CRC tables to rodata section

3 months agoReduce BIH node size by 32 bytes
uis [Sun, 21 Apr 2024 00:59:09 +0000 (03:59 +0300)]
Reduce BIH node size by 32 bytes

3 months agoMerge MR 'fix failure to load data from non-ASCII path on Windows'
bones_was_here [Sat, 20 Jul 2024 10:28:08 +0000 (20:28 +1000)]
Merge MR 'fix failure to load data from non-ASCII path on Windows'

See https://gitlab.com/xonotic/darkplaces/-/merge_requests/153

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
4 months agofix can't load data on windows if data is in non-ascii path (introduced by 1f4743e9...
NaitLee [Sat, 6 Jul 2024 19:00:14 +0000 (03:00 +0800)]
fix can't load data on windows if data is in non-ascii path (introduced by 1f4743e9), refactor windows unicode support

5 months agoCSQC: disable lighting in R_EndPolygon()
bones_was_here [Sun, 2 Jun 2024 13:23:17 +0000 (23:23 +1000)]
CSQC: disable lighting in R_EndPolygon()

It's not supported and causes visual problems.

Fixes https://gitlab.com/xonotic/darkplaces/-/issues/419

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
5 months agoImprove robustness of Con_CenterPrintf()
bones_was_here [Tue, 28 May 2024 20:19:11 +0000 (06:19 +1000)]
Improve robustness of Con_CenterPrintf()

This code was OK, but if someone were to change the buffer size(s) such
that line[] were smaller than msg[], or were to call Con_CenterPrintf()
with a maxLineLength > 40, then a buffer overflow would have become
possible.  This patch prevents it.

See https://github.com/DarkPlacesEngine/darkplaces/pull/159

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
5 months agocvar: misc description fixes, allow vsync to a fraction of refresh rate
bones_was_here [Fri, 10 May 2024 13:05:58 +0000 (23:05 +1000)]
cvar: misc description fixes, allow vsync to a fraction of refresh rate

Refresh rate fractions are supported by SDL2 for positive and negative
(adaptive) values, and by emscripten for positive values.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
5 months agoPrint centerprint messages to the console (#159)
James O'Neill [Tue, 28 May 2024 10:28:16 +0000 (19:28 +0900)]
Print centerprint messages to the console (#159)

Add new function `Con_CenterPrint` which can be used to print messages
to the console, without showing onscreen, and with a "horizontal rule"
above and below. Use `Con_CenterPrint` to log centerprint messages to
the console.

![image](https://github.com/DarkPlacesEngine/darkplaces/assets/424218/8ef0bdc4-7481-4f11-b0a3-d46e4d451c74)

Fixes #98

---------

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Co-authored-by: bones_was_here <bones_was_here@xonotic.au>
5 months agosys: work around incomplete POSIX support in MacOS
bones_was_here [Fri, 17 May 2024 08:47:33 +0000 (18:47 +1000)]
sys: work around incomplete POSIX support in MacOS

Closes https://gitlab.com/xonotic/darkplaces/-/issues/417

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoRefactor game/mod cvar defaults
bones_was_here [Wed, 8 May 2024 21:16:53 +0000 (07:16 +1000)]
Refactor game/mod cvar defaults

Adds gamegroup defaults.
This avoids the need to specify the same Quake defaults for every Quake
expansion/mod.
Fixes newly-added Quake mods (quake15, ad) having global defaults
instead of Quake defaults.

Moves comments in front of the cvars they refer to, some were unclear.

Removes redundant cvars, they're no longer needed because global
defaults and Quake defaults are correctly restored when switching
gamedirs, see 32c99c7b0a58545b273fa713d81d6bbfb3b8ebe6 and
205931f2f5b7333523ca4f6c3cae7974a8f516c8.

See also: 34e819a626f6a7ff2ad190a8e7d42e38ca8cef0e

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agosbar: add cvar scr_sbarscale for mod compatibility
bones_was_here [Tue, 7 May 2024 19:49:14 +0000 (05:49 +1000)]
sbar: add cvar scr_sbarscale for mod compatibility

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoparticles: fix bugs in cl_particles_quake
bones_was_here [Tue, 7 May 2024 16:30:09 +0000 (02:30 +1000)]
particles: fix bugs in cl_particles_quake

There was a segfault when CL_NewQuakeParticle->CL_NewParticle returned
NULL, and a missing break; in case pt_snow: in R_RenderParticles causing
fall-through to pt_explode.
Introduced in 58dc7879146968c2c07e1ffd2c521487a5e768d9, I missed them in
code review, oops.

Could have just added checks for NULL in CL_ParticleExplosion but these
kinds of exceptions can get messy if several accumulate so it seemed
better to merge them into the API which also made NULL checks redundant.

Changes the particle_t comments to doxygen comments.
Fixes indenting.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoRecognise mod Arcane Dimensions
bones_was_here [Tue, 7 May 2024 09:14:18 +0000 (19:14 +1000)]
Recognise mod Arcane Dimensions

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoCLVM: add cvar to support mods wanting low resolution 2D
bones_was_here [Tue, 7 May 2024 08:29:09 +0000 (18:29 +1000)]
CLVM: add cvar to support mods wanting low resolution 2D

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agomisc: engine version string polishing
bones_was_here [Tue, 7 May 2024 04:34:30 +0000 (14:34 +1000)]
misc: engine version string polishing

Updates engineversion when changing gamedirs, sets it earlier so it's
more likely to be included in crash logs.
Includes compiler in buildstring.

Makes sure the engine can always be identified as DarkPlaces (many
gamename values don't include it) by CSQC and in the console.

Logs which API is in use when loading a csprogs.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoPVS: dynamically allocate all FatPVS buffers
bones_was_here [Tue, 7 May 2024 01:23:16 +0000 (11:23 +1000)]
PVS: dynamically allocate all FatPVS buffers

Some were dynamic, others weren't...

Fixes invisible entities and monsters ignoring the player on big/complex
maps, and undefined behaviour (reading past the end of the buffer).
Fixes https://gitlab.com/xonotic/darkplaces/-/issues/322

Adds Mem_Size() for retrieving the size of an allocation.

Simplifies some checks (we can check the pointer now so we dont need to
store byte counts just to see if there's any data).

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agosprites: fix misaligned memory access while loading (v2)
bones_was_here [Mon, 6 May 2024 01:15:40 +0000 (11:15 +1000)]
sprites: fix misaligned memory access while loading (v2)

This reverts commit 0d5f8f0edd073d7ff233bde3995b529c0fcb67ff, that
approach didn't solve it for the other code path (used in mod "quake15")
so we need to memcpy each struct.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agonet: fix UB in VM_CL_getstati() and when sending the `items` stat
bones_was_here [Sun, 5 May 2024 19:13:34 +0000 (05:13 +1000)]
net: fix UB in VM_CL_getstati() and when sending the `items` stat

Simplifies the shifting in VM_CL_getstati() to avoid signed integer
overflow when the high bits are read with the arguments 23 and 9 (as
done in "quake15" and "ad" mods).

Refactors VM_CL_getstati() slightly, returns 0 when the index is out of
range (instead of whatever happened to be in that memory).

Masks off the bits that will overflow when packing the `items` stat for
sending (otherwise corruption of the low bits could occur on x86).

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoQ3BSP: fix UB when loading certain maps
bones_was_here [Sun, 5 May 2024 14:14:52 +0000 (00:14 +1000)]
Q3BSP: fix UB when loading certain maps

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agosys: fix "typo" in a3dac3bcfd962ee3b7ebcdb7afb777560679c29a
bones_was_here [Sun, 5 May 2024 04:09:01 +0000 (14:09 +1000)]
sys: fix "typo" in a3dac3bcfd962ee3b7ebcdb7afb777560679c29a

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoCONTRIBUTING: Fix typos
Cloudwalk [Sat, 4 May 2024 06:11:26 +0000 (02:11 -0400)]
CONTRIBUTING: Fix typos

6 months agomakefile: demote -Werror=c++-compat to a warning
Cloudwalk [Sat, 4 May 2024 05:54:37 +0000 (01:54 -0400)]
makefile: demote -Werror=c++-compat to a warning

Also edited CONTRIBUTING.md and a comment in common.h accordingly to reflect this change.

6 months agoconsole: improve default text legibility and background alpha behaviour
bones_was_here [Thu, 2 May 2024 21:59:11 +0000 (07:59 +1000)]
console: improve default text legibility and background alpha behaviour

With the Quake font and some mod fonts the text was too dim and hard to
read by default.

Makes the dropdown console always have the configured alpha (even at the
menu with no demos playing).

Uses a tiny bit of alpha by default.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoDisable mod_bsp_portalize by default
bones_was_here [Tue, 30 Apr 2024 14:08:33 +0000 (00:08 +1000)]
Disable mod_bsp_portalize by default

The cost is too high when loading fancy modern maps, and
r_useportalculling often doesn't improve perf (or even hurts it).

Closes https://gitlab.com/xonotic/darkplaces/-/issues/323

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agodemos: Add cvar cl_startdemos, allow longer startdemos arguments
bones_was_here [Tue, 30 Apr 2024 07:16:33 +0000 (17:16 +1000)]
demos: Add cvar cl_startdemos, allow longer startdemos arguments

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoRecognise mods Quake 1.5 and Quake Combat+
bones_was_here [Sun, 28 Apr 2024 00:17:22 +0000 (10:17 +1000)]
Recognise mods Quake 1.5 and Quake Combat+

Their instructions both say "-game quake15" so they're currently
indistinguishable, but currently both require the same workarounds.

Closes https://github.com/DarkPlacesEngine/darkplaces/issues/164

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agophysics: add a workaround cvar for mods relying on the id1 fiends bug
bones_was_here [Sat, 27 Apr 2024 23:23:56 +0000 (09:23 +1000)]
physics: add a workaround cvar for mods relying on the id1 fiends bug

Also checks for teleport by QC in both code paths (forgot to do that in
e62e6f563b475060fca315b875aa672c692ad052).

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoQ1BSP: add a workaround cvar for the Rogue lava men, use it when playing Rogue
bones_was_here [Sat, 27 Apr 2024 20:30:37 +0000 (06:30 +1000)]
Q1BSP: add a workaround cvar for the Rogue lava men, use it when playing Rogue

This doesn't fix them, it just changes the behaviour of the map bug so
that they're stuck like in the original Quake engine. Fixing them
properly requires moving them, a .ent file is convenient for that.

Closes https://github.com/DarkPlacesEngine/darkplaces/issues/109

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoMisc gamedir-related fixes
bones_was_here [Tue, 30 Apr 2024 10:19:59 +0000 (20:19 +1000)]
Misc gamedir-related fixes

Fixes two cvars being writable that shouldn't be.

Fixes MVM getgamedirinfo() builtin returning stale data (wasn't updated
by fs_rescan).

Fixes `startdemos` not working when changing to a mod that uses it,
after previously having had a map loaded.

Fixes `menu_main` being unavailable to quake.rc when changing to a mod
that uses it instead of `startdemos`.

Fixes `menu_restart` not performing the full MR_Init() (updates video
modes etc).

Fixes a race where it was possible to segfault by handling keyboard
events meant for MENU QC after MR_Shutdown() but before MR_Init() (by
calling directly instead of adding `menu_restart` to the cbuf).

Fixes an inconsistent extern declaration found by ubsan.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agofs: recognise mods by -game cmdline args, deduplicate gamedirs, refactoring
bones_was_here [Sun, 28 Apr 2024 03:03:12 +0000 (13:03 +1000)]
fs: recognise mods by -game cmdline args, deduplicate gamedirs, refactoring

Players often start mods using -game even when they have their own
cmdline option, and modders often provide scripts which use -game.

This was already implemented but only for the `gamedir` command.
Refactoring was required to avoid chicken vs egg problems when doing it
with cmdline gamedirs too.

Fixes a bug: the first gamedir (in the cmdline or `gamedir` args) was
used to identify the mod but it needs to be the last one that matches
because the last gamedir is the primary (first in the search path, and
where files are saved).

Includes supported game and mod directories in the main gamedir list for
interface consistency, less special cases, and to support deduplication.
Refactoring was required in the menu modlist where there was also an
opportunity to simplify.

Fixes inability to change from a supported mod (eg rogue) back to id1.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agophysics: fix and refactor unsticking
bones_was_here [Fri, 26 Apr 2024 03:05:42 +0000 (13:05 +1000)]
physics: fix and refactor unsticking

Closes https://github.com/DarkPlacesEngine/darkplaces/issues/165

Bugs came from 270f020888c5a03b98cc7752957243e6123c1132 trying to use
NudgeOutOfSolid on Q1BSP which currently isn't possible, combined with
a map bug on alk_caustic, and unsticking unfortunately being an
essential part of Q1BSP player physics.

Adjusts cvar defaults to match Quake behaviour.
Improves documentation.

Merges SV_UnstickEntity() and SV_CheckStuck().

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoMerge PR 'Use the text from modinfo.txt as the mod menu entry'
James O'Neill [Sun, 21 Apr 2024 17:25:00 +0000 (02:25 +0900)]
Merge PR 'Use the text from modinfo.txt as the mod menu entry'

Copies the text from the `modinfo.txt` into the name field for the mod
list entry. If there is no text the mod directory name is used as
before.

![image](https://github.com/DarkPlacesEngine/darkplaces/assets/424218/b6b5da57-7590-407e-920c-21bca23ef2bb)

Fixes Alkaline 1.2 failing to appear in the mod list (its dir is
`alk1.2`).

See https://github.com/DarkPlacesEngine/darkplaces/pull/168

---------

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
Co-authored-by: bones_was_here <bones_was_here@xonotic.au>
6 months agofs: use current working dir as basedir if not otherwise specified
bones_was_here [Sun, 21 Apr 2024 16:11:56 +0000 (02:11 +1000)]
fs: use current working dir as basedir if not otherwise specified

Fixes https://github.com/DarkPlacesEngine/darkplaces/issues/42

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
6 months agoAccept "ctrl" + "=" for increasing console text size (#167)
James O'Neill [Sun, 21 Apr 2024 15:28:29 +0000 (00:28 +0900)]
Accept "ctrl" + "=" for increasing console text size (#167)

Can't use the "=+" key to increase the console text size because the
code only wants "+"; ctrl+shift+= also does not work. Keypad + works.
This patch makes it accept the = key as well as +.

Fixes #110 .

See https://github.com/DarkPlacesEngine/darkplaces/pull/167

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>