diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-05-02 01:24:45 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-03 22:16:14 +0200 |
commit | be8a18b8d5c6bc61e0be78b64d5a2270ca6ce9f0 (patch) | |
tree | d95bae9b6affa32b8cbf12134ff901cfc9384add /Ports | |
parent | 73e505fb77b5e0b7ad750d453e41ab4236ffef51 (diff) | |
download | serenity-be8a18b8d5c6bc61e0be78b64d5a2270ca6ce9f0.zip |
Ports: Work around `halflife` formatting NaN values endlessly
Diffstat (limited to 'Ports')
-rw-r--r-- | Ports/halflife/patches/ReadMe.md | 5 | ||||
-rw-r--r-- | Ports/halflife/patches/fwgs-dont-format-nan-loop.patch | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/Ports/halflife/patches/ReadMe.md b/Ports/halflife/patches/ReadMe.md index 6443812e34..155a564b30 100644 --- a/Ports/halflife/patches/ReadMe.md +++ b/Ports/halflife/patches/ReadMe.md @@ -4,6 +4,11 @@ Add SerenityOS to the supported architectures of FWGS. +## `fwgs-dont-format-nan-loop.patch` + +This keeps FWGS from formatting a NaN value multiple times each frame, +which would otherwise result in a big performance hit. + ## `hlsdk-add-serenity.patch` Add SerenityOS to the supported architectures of hlsdk. diff --git a/Ports/halflife/patches/fwgs-dont-format-nan-loop.patch b/Ports/halflife/patches/fwgs-dont-format-nan-loop.patch new file mode 100644 index 0000000000..1db752911f --- /dev/null +++ b/Ports/halflife/patches/fwgs-dont-format-nan-loop.patch @@ -0,0 +1,24 @@ +From 1bc4a88e6a34b89538f07916479228758dd13155 Mon Sep 17 00:00:00 2001 +From: Tim Schumacher <timschumi@gmx.de> +Date: Mon, 2 May 2022 01:22:35 +0200 +Subject: [PATCH] Engine: Keep HTTP from endlessly formatting NaN values + +For whatever reason, our progress count for HTTP downloads stays at 0. +This results in the engine calculating a NaN progress value many times +each frame, which results in a significant performance hit. +--- + xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c +--- a/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c ++++ b/xash3d-fwgs-5402e1a2597c40c603bd0f2b1a9cd6a16506ec84/engine/common/net_ws.c +@@ -2280,7 +2280,7 @@ + } + + // update progress +- if( !Host_IsDedicated() ) ++ if( !Host_IsDedicated() && iProgressCount != 0 ) + Cvar_SetValue( "scr_download", flProgress/iProgressCount * 100 ); + + HTTP_AutoClean(); |