1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 07:00:45 +00:00

Ports: Work around halflife formatting NaN values endlessly

This commit is contained in:
Tim Schumacher 2022-05-02 01:24:45 +02:00 committed by Linus Groh
parent 73e505fb77
commit be8a18b8d5
2 changed files with 29 additions and 0 deletions

View File

@ -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.

View File

@ -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();