mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Merge branch 'cmake-build-type-titlescreen' into 'master'
Show CMAKE_BUILD_TYPE on title screen See merge request KartKrew/Kart!849
This commit is contained in:
commit
3f6cc8a183
9 changed files with 76 additions and 46 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
||||||
|
|
||||||
set(CMAKE_BINARY_DIR "${BINARY_DIR}")
|
set(CMAKE_BINARY_DIR "${BINARY_DIR}")
|
||||||
set(CMAKE_CURRENT_BINARY_DIR "${BINARY_DIR}")
|
set(CMAKE_CURRENT_BINARY_DIR "${BINARY_DIR}")
|
||||||
|
|
||||||
|
|
@ -10,4 +12,18 @@ git_current_branch(SRB2_COMP_BRANCH)
|
||||||
git_summary(SRB2_COMP_REVISION)
|
git_summary(SRB2_COMP_REVISION)
|
||||||
git_working_tree_dirty(SRB2_COMP_UNCOMMITTED)
|
git_working_tree_dirty(SRB2_COMP_UNCOMMITTED)
|
||||||
|
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||||
|
set(CMAKE_BUILD_TYPE None)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# These build types enable optimizations of some kind by default.
|
||||||
|
set(optimized_build_types "MINSIZEREL;RELEASE;RELWITHDEBINFO")
|
||||||
|
|
||||||
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
|
||||||
|
if("${build_type}" IN_LIST optimized_build_types)
|
||||||
|
set(SRB2_COMP_OPTIMIZED TRUE)
|
||||||
|
else()
|
||||||
|
set(SRB2_COMP_OPTIMIZED FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/src/config.h")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/src/config.h")
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ add_custom_command(
|
||||||
# build time for accurate git information and before anything
|
# build time for accurate git information and before anything
|
||||||
# that needs it, obviously.
|
# that needs it, obviously.
|
||||||
add_custom_target(_SRB2_reconf ALL
|
add_custom_target(_SRB2_reconf ALL
|
||||||
COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/.. -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Comptime.cmake
|
COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/.. -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Comptime.cmake
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.."
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.."
|
||||||
)
|
)
|
||||||
add_dependencies(SRB2SDL2 _SRB2_reconf)
|
add_dependencies(SRB2SDL2 _SRB2_reconf)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
const char *compbranch = SRB2_COMP_BRANCH;
|
const char *compbranch = SRB2_COMP_BRANCH;
|
||||||
const char *comprevision = SRB2_COMP_REVISION;
|
const char *comprevision = SRB2_COMP_REVISION;
|
||||||
|
const char *comptype = CMAKE_BUILD_TYPE;
|
||||||
|
const int compoptimized = SRB2_COMP_OPTIMIZED;
|
||||||
|
|
||||||
#elif (defined(COMPVERSION))
|
#elif (defined(COMPVERSION))
|
||||||
#include "comptime.h"
|
#include "comptime.h"
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
#define COMPVERSION_UNCOMMITTED
|
#define COMPVERSION_UNCOMMITTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||||
|
#cmakedefine01 SRB2_COMP_OPTIMIZED
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Manually defined asset hashes for non-CMake builds
|
/* Manually defined asset hashes for non-CMake builds
|
||||||
|
|
|
||||||
|
|
@ -4774,16 +4774,13 @@ static void Command_Version_f(void)
|
||||||
else // 16-bit? 128-bit?
|
else // 16-bit? 128-bit?
|
||||||
CONS_Printf("Bits Unknown ");
|
CONS_Printf("Bits Unknown ");
|
||||||
|
|
||||||
|
CONS_Printf("%s ", comptype);
|
||||||
|
|
||||||
// No ASM?
|
// No ASM?
|
||||||
#ifdef NOASM
|
#ifdef NOASM
|
||||||
CONS_Printf("\x85" "NOASM " "\x80");
|
CONS_Printf("\x85" "NOASM " "\x80");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Debug build
|
|
||||||
#ifdef _DEBUG
|
|
||||||
CONS_Printf("\x85" "DEBUG " "\x80");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// DEVELOP build
|
// DEVELOP build
|
||||||
#if defined(TESTERS)
|
#if defined(TESTERS)
|
||||||
CONS_Printf("\x88" "TESTERS " "\x80");
|
CONS_Printf("\x88" "TESTERS " "\x80");
|
||||||
|
|
|
||||||
|
|
@ -664,7 +664,8 @@ UINT32 quickncasehash (const char *p, size_t n)
|
||||||
|
|
||||||
// Compile date and time and revision.
|
// Compile date and time and revision.
|
||||||
extern const char *compdate, *comptime, *comprevision, *compbranch;
|
extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
extern int compuncommitted;
|
extern int compuncommitted, compoptimized;
|
||||||
|
extern const char *comptype;
|
||||||
|
|
||||||
// Disabled code and code under testing
|
// Disabled code and code under testing
|
||||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||||
|
|
|
||||||
|
|
@ -1889,6 +1889,52 @@ void F_StartTitleScreen(void)
|
||||||
F_CacheTitleScreen();
|
F_CacheTitleScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void F_VersionDrawer(void)
|
||||||
|
{
|
||||||
|
// An adapted thing from old menus - most games have version info on the title screen now...
|
||||||
|
INT32 texty = vid.height - 10*vid.dupy;
|
||||||
|
|
||||||
|
#define addtext(f, str) {\
|
||||||
|
V_DrawThinString(vid.dupx, texty, V_NOSCALESTART|f, str);\
|
||||||
|
texty -= 10*vid.dupy;\
|
||||||
|
}
|
||||||
|
if (customversionstring[0] != '\0')
|
||||||
|
{
|
||||||
|
addtext(V_ALLOWLOWERCASE, customversionstring);
|
||||||
|
addtext(0, "Mod version:");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Development -- show revision / branch info
|
||||||
|
#if defined(TESTERS)
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_SKYMAP, "Tester client");
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate));
|
||||||
|
#elif defined(HOSTTESTERS)
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_REDMAP, "Netgame host for testers");
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate));
|
||||||
|
#elif defined(DEVELOP)
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, comprevision);
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, compbranch);
|
||||||
|
#else // Regular build
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING));
|
||||||
|
#endif
|
||||||
|
if (compoptimized)
|
||||||
|
{
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s build", comptype));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addtext(V_ALLOWLOWERCASE|V_ORANGEMAP, va("%s build (no optimizations)", comptype));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (compuncommitted)
|
||||||
|
{
|
||||||
|
addtext(V_REDMAP|V_STRINGDANCE, "! UNCOMMITTED CHANGES !");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#undef addtext
|
||||||
|
}
|
||||||
|
|
||||||
// (no longer) De-Demo'd Title Screen
|
// (no longer) De-Demo'd Title Screen
|
||||||
void F_TitleScreenDrawer(void)
|
void F_TitleScreenDrawer(void)
|
||||||
{
|
{
|
||||||
|
|
@ -1959,39 +2005,7 @@ void F_TitleScreenDrawer(void)
|
||||||
|
|
||||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_copyright, NULL);
|
V_DrawFixedPatch(0, 0, FRACUNIT, 0, kts_copyright, NULL);
|
||||||
|
|
||||||
// An adapted thing from old menus - most games have version info on the title screen now...
|
F_VersionDrawer();
|
||||||
{
|
|
||||||
INT32 texty = vid.height - 10*vid.dupy;
|
|
||||||
#define addtext(f, str) {\
|
|
||||||
V_DrawThinString(vid.dupx, texty, V_NOSCALESTART|f, str);\
|
|
||||||
texty -= 10*vid.dupy;\
|
|
||||||
}
|
|
||||||
if (customversionstring[0] != '\0')
|
|
||||||
{
|
|
||||||
addtext(V_ALLOWLOWERCASE, customversionstring);
|
|
||||||
addtext(0, "Mod version:");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Development -- show revision / branch info
|
|
||||||
#if defined(TESTERS)
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_SKYMAP, "Tester client");
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate));
|
|
||||||
#elif defined(HOSTTESTERS)
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_REDMAP, "Netgame host for testers");
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", compdate));
|
|
||||||
#elif defined(DEVELOP)
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, comprevision);
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, compbranch);
|
|
||||||
#else // Regular build
|
|
||||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING));
|
|
||||||
#endif
|
|
||||||
if (compuncommitted)
|
|
||||||
addtext(V_REDMAP|V_STRINGDANCE, "! UNCOMMITTED CHANGES !");
|
|
||||||
}
|
|
||||||
#undef addtext
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ void F_EndingDrawer(void);
|
||||||
void F_CreditTicker(void);
|
void F_CreditTicker(void);
|
||||||
void F_CreditDrawer(void);
|
void F_CreditDrawer(void);
|
||||||
|
|
||||||
|
void F_VersionDrawer(void);
|
||||||
|
|
||||||
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
|
void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer);
|
||||||
void F_CutsceneDrawer(void);
|
void F_CutsceneDrawer(void);
|
||||||
void F_EndCutScene(void);
|
void F_EndCutScene(void);
|
||||||
|
|
|
||||||
|
|
@ -541,12 +541,7 @@ void M_Drawer(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef DEVELOP // Development -- show revision / branch info
|
F_VersionDrawer();
|
||||||
V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch);
|
|
||||||
V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision);
|
|
||||||
#else // Regular build
|
|
||||||
V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue