From 53b99a05bf87372971e95a7707862a9c83ed8c1b Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Wed, 28 Dec 2022 17:10:41 +0300 Subject: [PATCH 1/4] Print compiled features in developer mode. --- src/common/common.c | 3 ++ src/common/features.h | 116 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 src/common/features.h diff --git a/src/common/common.c b/src/common/common.c index c85e42ee8..28a381e17 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -51,6 +51,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "system/system.h" #include "system/hunk.h" +#include "features.h" + #include #ifdef _WIN32 @@ -974,6 +976,7 @@ void Qcommon_Init(int argc, char **argv) // Print the engine version early so that it's definitely included in the console log. // The log file is opened during the execution of one of the config files above. Com_LPrintf(PRINT_NOTICE, "\nEngine version: " APPLICATION " " LONG_VERSION_STRING ", built on " __DATE__ "\n\n"); + Com_DPrintf("Compiled features: %s\n", Com_GetFeatures()); Netchan_Init(); NET_Init(); diff --git a/src/common/features.h b/src/common/features.h new file mode 100644 index 000000000..e3e196ea2 --- /dev/null +++ b/src/common/features.h @@ -0,0 +1,116 @@ +/* +Copyright (C) 2022 Andrey Nazarov + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +static const char *Com_GetFeatures(void) +{ + return +#if USE_AC_SERVER + "anticheat-server " +#endif +#if USE_AUTOREPLY + "auto-reply " +#endif +#if USE_CLIENT_GTV + "client-gtv " +#endif +#if USE_UI + "client-ui " +#endif +#if USE_DEBUG + "debug " +#endif +#if USE_DLIGHTS + "dynamic-lights " +#endif +#if USE_GAME_ABI_HACK + "game-abi-hack " +#endif +#if USE_ICMP + "icmp-errors " +#endif +#if USE_CURL + "libcurl " +#endif +#if USE_JPG + "libjpeg " +#endif +#if USE_PNG + "libpng " +#endif +#if USE_MAPCHECKSUM + "map-checksum " +#endif +#if USE_MD3 + "md3 " +#endif +#if USE_MVD_CLIENT + "mvd-client " +#endif +#if USE_MVD_SERVER + "mvd-server " +#endif +#if USE_OGG + "ogg " +#endif +#if USE_OPENAL + "openal " +#endif +#if USE_PACKETDUP + "packetdup-hack " +#endif +#if USE_SAVEGAMES + "save-games " +#endif +#if USE_SDL + "sdl2 " +#endif +#if USE_SNDDMA + "software-sound " +#endif +#if USE_SYSCON + "system-console " +#endif +#if USE_TESTS + "tests " +#endif +#if USE_TGA + "tga " +#endif +#if USE_FPS + "variable-fps " +#endif +#if USE_WAYLAND + "wayland " +#endif +#if USE_DBGHELP + "windows-crash-dumps " +#endif +#if USE_WIN32EGL + "windows-egl " +#endif +#if USE_WINSVC + "windows-service " +#endif +#if USE_X11 + "x11 " +#endif +#if USE_ZLIB + "zlib " +#endif + ; +} From 08f7a0109dd0dd3efada4bcaa89cc13730017ffd Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 12 Jan 2023 13:21:06 +0300 Subject: [PATCH 2/4] Make dynamic lights always compiled in. --- inc/common/bsp.h | 1 - src/common/features.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/inc/common/bsp.h b/inc/common/bsp.h index 3775a33a3..5bba37470 100644 --- a/inc/common/bsp.h +++ b/inc/common/bsp.h @@ -111,7 +111,6 @@ typedef struct mface_s { int firstbasis; unsigned drawframe; - unsigned dlightframe; unsigned dlightbits; diff --git a/src/common/features.h b/src/common/features.h index e3e196ea2..2856c7fb6 100644 --- a/src/common/features.h +++ b/src/common/features.h @@ -34,9 +34,6 @@ static const char *Com_GetFeatures(void) #if USE_DEBUG "debug " #endif -#if USE_DLIGHTS - "dynamic-lights " -#endif #if USE_GAME_ABI_HACK "game-abi-hack " #endif From 55e07b27f4ac877b3480e07c3b76adfaac0f1302 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 12 Jan 2023 13:39:56 +0300 Subject: [PATCH 3/4] Make map checksum always compiled in. --- src/common/features.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common/features.h b/src/common/features.h index 2856c7fb6..5086eed02 100644 --- a/src/common/features.h +++ b/src/common/features.h @@ -49,9 +49,6 @@ static const char *Com_GetFeatures(void) #if USE_PNG "libpng " #endif -#if USE_MAPCHECKSUM - "map-checksum " -#endif #if USE_MD3 "md3 " #endif From fe8e71bddf6342ebfbb10732d2b7076506df5414 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sun, 2 Apr 2023 22:53:00 +0300 Subject: [PATCH 4/4] Fix warning when building without USE_DEBUG. --- src/common/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/common.c b/src/common/common.c index 28a381e17..9612c7b2f 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -51,7 +51,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "system/system.h" #include "system/hunk.h" +#if USE_DEBUG #include "features.h" +#endif #include