From 96f7f5457d4db71385d11c5f84f45f7ad20462f8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 17 Dec 2023 17:43:18 +0300 Subject: [PATCH] engine: print all supported and enabled features --- engine/client/cl_parse.c | 2 +- engine/common/common.h | 2 +- engine/common/host.c | 33 +++++++++++++++++++-------------- engine/server/sv_phys.c | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index e41a6b07..a82ea741 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -907,7 +907,7 @@ void CL_ParseServerData( sizebuf_t *msg, qboolean legacy ) host.features &= legacy ? ENGINE_LEGACY_FEATURES_MASK : ENGINE_FEATURES_MASK; if( !Host_IsLocalGame( )) - Host_PrintEngineFeatures(); + Host_PrintEngineFeatures( host.features ); if( !legacy ) { diff --git a/engine/common/common.h b/engine/common/common.h index 5de2ab6f..c4d4c87c 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -552,7 +552,7 @@ qboolean Host_IsLocalGame( void ); qboolean Host_IsLocalClient( void ); void Host_ShutdownServer( void ); void Host_Error( const char *error, ... ) _format( 1 ); -void Host_PrintEngineFeatures( void ); +void Host_PrintEngineFeatures( int features ); void Host_Frame( float time ); void Host_InitDecals( void ); void Host_Credits( void ); diff --git a/engine/common/host.c b/engine/common/host.c index da19aee6..b31661d4 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -190,22 +190,27 @@ void Host_ShutdownServer( void ) Host_PrintEngineFeatures ================ */ -void Host_PrintEngineFeatures( void ) +void Host_PrintEngineFeatures( int features ) { - if( FBitSet( host.features, ENGINE_WRITE_LARGE_COORD )) - Con_Reportf( "^3EXT:^7 big world support enabled\n" ); - - if( FBitSet( host.features, ENGINE_LOAD_DELUXEDATA )) - Con_Reportf( "^3EXT:^7 deluxemap support enabled\n" ); - - if( FBitSet( host.features, ENGINE_PHYSICS_PUSHER_EXT )) - Con_Reportf( "^3EXT:^7 Improved MOVETYPE_PUSH is used\n" ); - - if( FBitSet( host.features, ENGINE_LARGE_LIGHTMAPS )) - Con_Reportf( "^3EXT:^7 Large lightmaps enabled\n" ); + const char *features_str[] = + { + "Big World Support", + "Quake Compatibility", + "Deluxemap Support", + "Improved MOVETYPE_PUSH", + "Large Lightmaps", + "Stupid Quake Bug Compensation", + "Improved Trace Line", + "Studio MOVETYPE_STEP Lerping", + "Linear Gamma Space" + }; + int i; - if( FBitSet( host.features, ENGINE_COMPENSATE_QUAKE_BUG )) - Con_Reportf( "^3EXT:^7 Compensate quake bug enabled\n" ); + for( i = 0; i < ARRAYSIZE( features_str ); i++ ) + { + if( FBitSet( features, BIT( i ))) + Con_Reportf( "^3EXT:^7 %s is enabled\n", features_str[i] ); + } } /* diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 51e7cfff..905d81b4 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -2140,7 +2140,7 @@ qboolean SV_InitPhysicsAPI( void ) { // grab common engine features (it will be shared across the network) host.features = svgame.physFuncs.SV_CheckFeatures() & ENGINE_FEATURES_MASK; - Host_PrintEngineFeatures (); + Host_PrintEngineFeatures( host.features ); } return true; }