1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-30 03:37:36 +00:00

Ports: Split up the halflife port into engine and game

This commit is contained in:
Tim Schumacher 2022-06-09 15:21:27 +02:00 committed by Linus Groh
parent 23fa6b1f7b
commit 817c79431d
9 changed files with 99 additions and 91 deletions

View file

@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jesse Buhagiar <jooster669@gmail.com>
Date: Sun, 2 Jan 2022 00:39:02 +1100
Subject: [PATCH] Build: Add SerenityOS to list of compatible systems
This is required by the build system to spit out a library with
the correct name/platform.
---
engine/common/build.c | 2 ++
public/build.h | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/engine/common/build.c b/engine/common/build.c
index c4ddaee..42ba572 100644
--- a/engine/common/build.c
+++ b/engine/common/build.c
@@ -95,6 +95,8 @@ const char *Q_buildos( void )
osname = "DOS4GW";
#elif XASH_HAIKU
osname = "haiku";
+#elif XASH_SERENITY
+ osname = "serenityos";
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif
diff --git a/public/build.h b/public/build.h
index 6e1f326..57a7735 100644
--- a/public/build.h
+++ b/public/build.h
@@ -74,6 +74,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_RISCV_DOUBLEFP
#undef XASH_RISCV_SINGLEFP
#undef XASH_RISCV_SOFTFP
+#undef XASH_SERENITY
#undef XASH_WIN32
#undef XASH_WIN64
#undef XASH_X86
@@ -125,6 +126,9 @@ For more information, please refer to <http://unlicense.org/>
#elif defined __HAIKU__
#define XASH_HAIKU 1
#define XASH_POSIX 1
+#elif defined __serenity__
+ #define XASH_SERENITY 1
+ #define XASH_POSIX 1
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

View file

@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 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.
---
engine/common/net_ws.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c
index ef403b3..8b491ba 100644
--- a/engine/common/net_ws.c
+++ b/engine/common/net_ws.c
@@ -2280,7 +2280,7 @@ void HTTP_Run( void )
}
// update progress
- if( !Host_IsDedicated() )
+ if( !Host_IsDedicated() && iProgressCount != 0 )
Cvar_SetValue( "scr_download", flProgress/iProgressCount * 100 );
HTTP_AutoClean();

View file

@ -0,0 +1,17 @@
# Patches for xash3d-fwgs on SerenityOS
## `0001-Build-Add-SerenityOS-to-list-of-compatible-systems.patch`
Build: Add SerenityOS to list of compatible systems
This is required by the build system to spit out a library with
the correct name/platform.
## `0002-Engine-Keep-HTTP-from-endlessly-formatting-NaN-value.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.