Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Q2pro: Print compiled features in developer mode #422

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion inc/common/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ typedef struct mface_s {
int firstbasis;

unsigned drawframe;

unsigned dlightframe;
unsigned dlightbits;

Expand Down
5 changes: 5 additions & 0 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ 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 <setjmp.h>

#ifdef _WIN32
Expand Down Expand Up @@ -974,6 +978,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();
Expand Down
110 changes: 110 additions & 0 deletions src/common/features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
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_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_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
;
}
Loading