From a6dcd5555e7ed3a1861ba93af843b01a7236c0fd Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 5 Dec 2018 11:43:33 -0500 Subject: [PATCH 1/5] Add various flags to version string --- src/d_netcmd.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 290183e2..736e10f3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3421,10 +3421,70 @@ static void Command_ListWADS_f(void) static void Command_Version_f(void) { #ifdef DEVELOP - CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime); + CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s) ", compbranch, comprevision, compdate, comptime); #else - CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision); + CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s) ", VERSIONSTRING, compdate, comptime, comprevision); #endif + + // Base library +#ifdef HAVE_SDL + CONS_Printf("SDL "); +#else +#ifdef _WIN32 + CONS_Printf("DD "); +#endif +#endif + + // OS + // Would be nice to use SDL_GetPlatform for this +#ifdef _WIN32 + CONS_Printf("Windows "); +#else +#ifdef LINUX + CONS_Printf("Linux "); +#else +#ifdef MACOSX + CONS_Printf("macOS" ); +#else +#ifdef UNIXCOMMON + CONS_Printf("Unix (Common) "); +#else + CONS_Printf("Other OS "); +#endif +#endif +#endif +#endif + + // Bitness +#ifdef _WIN64 + CONS_Printf("x64 "); +#else +#ifdef _WIN32 + CONS_Printf("x86 "); +#else +#ifdef NONX86 + CONS_Printf("Non-x86 "); +#else +#ifdef LINUX + CONS_Printf("x86 "); +#else + CONS_Printf("Bits Unknown "); +#endif +#endif +#endif +#endif + + // No ASM? +#ifdef NOASM + CONS_Printf("\205NOASM \200"); +#endif + + // Debug build +#ifdef _DEBUG + CONS_Printf("\205DEBUG \200"); +#endif + + CONS_Printf("\n"); } #ifdef UPDATE_ALERT From 389c2d4ea165335d191c1642e7b38826fc0bf244 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 5 Dec 2018 12:55:05 -0500 Subject: [PATCH 2/5] _WINDOWS instead of _WIN32 for DD --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 736e10f3..a3604ac9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3430,7 +3430,7 @@ static void Command_Version_f(void) #ifdef HAVE_SDL CONS_Printf("SDL "); #else -#ifdef _WIN32 +#ifdef _WINDOWS CONS_Printf("DD "); #endif #endif From 1ea2fa447acb0e723bd202219b5b5b9a9db3d29a Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 5 Dec 2018 13:00:42 -0500 Subject: [PATCH 3/5] Make the ifdefs cleaner --- src/d_netcmd.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a3604ac9..2e5db3ea 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3427,51 +3427,37 @@ static void Command_Version_f(void) #endif // Base library -#ifdef HAVE_SDL +#if defined( HAVE_SDL) CONS_Printf("SDL "); -#else -#ifdef _WINDOWS +#elif defined(_WINDOWS) CONS_Printf("DD "); -#endif #endif // OS // Would be nice to use SDL_GetPlatform for this -#ifdef _WIN32 +#if defined(_WIN32) CONS_Printf("Windows "); -#else -#ifdef LINUX +#elif defined(LINUX) CONS_Printf("Linux "); -#else -#ifdef MACOSX +#elif defined(MACOSX) CONS_Printf("macOS" ); -#else -#ifdef UNIXCOMMON +#elif defined(UNIXCOMMON) CONS_Printf("Unix (Common) "); #else CONS_Printf("Other OS "); -#endif -#endif -#endif #endif // Bitness -#ifdef _WIN64 +#if defined(_WIN64) CONS_Printf("x64 "); -#else -#ifdef _WIN32 +#elif defined(_WIN32) CONS_Printf("x86 "); -#else -#ifdef NONX86 +#elif defined(NONX86) CONS_Printf("Non-x86 "); -#else -#ifdef LINUX +#elif defined(LINUX) CONS_Printf("x86 "); #else CONS_Printf("Bits Unknown "); -#endif -#endif -#endif #endif // No ASM? From c5b349ddc43ac43db29e7f70db492b5234c39088 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 5 Dec 2018 13:06:56 -0500 Subject: [PATCH 4/5] More concise bitness check --- src/d_netcmd.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2e5db3ea..95195931 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3448,17 +3448,12 @@ static void Command_Version_f(void) #endif // Bitness -#if defined(_WIN64) - CONS_Printf("x64 "); -#elif defined(_WIN32) - CONS_Printf("x86 "); -#elif defined(NONX86) - CONS_Printf("Non-x86 "); -#elif defined(LINUX) - CONS_Printf("x86 "); -#else - CONS_Printf("Bits Unknown "); -#endif + if (sizeof(void*) == 4) + CONS_Printf("32-bit "); + else if (sizeof(void*) == 8) + CONS_Printf("64-bit "); + else // 16-bit? 128-bit? + CONS_Printf("Bits Unknown "); // No ASM? #ifdef NOASM From 9055c9aeab6148ce25aac85495286f36e03dd0a8 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 5 Dec 2018 13:08:25 -0500 Subject: [PATCH 5/5] Hex instead of octal colors --- src/d_netcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 95195931..385cde3b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3457,12 +3457,12 @@ static void Command_Version_f(void) // No ASM? #ifdef NOASM - CONS_Printf("\205NOASM \200"); + CONS_Printf("\x85" "NOASM " "\x80"); #endif // Debug build #ifdef _DEBUG - CONS_Printf("\205DEBUG \200"); + CONS_Printf("\x85" "DEBUG " "\x80"); #endif CONS_Printf("\n");