mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-19 14:32:34 +00:00
Print on the title screen and in console if there are uncommitted changes
This commit is contained in:
parent
495c58e53f
commit
62b2718261
5 changed files with 21 additions and 0 deletions
|
|
@ -195,6 +195,14 @@ passthru_opts:=
|
|||
# separate suffix with an underscore
|
||||
exesuffix:=$(call _,$(EXESUFFIX))
|
||||
|
||||
# If there are uncommitted changes
|
||||
# -uno: disregard untracked files
|
||||
# Warning: this can only be accurate for comptime.c since
|
||||
# that file is always recompiled!
|
||||
ifneq ($(shell git status --porcelain -uno),)
|
||||
opts+=-DCOMPVERSION_UNCOMMITTED
|
||||
endif
|
||||
|
||||
include Makefile.d/platform.mk
|
||||
include Makefile.d/features.mk
|
||||
include Makefile.d/versions.mk
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ const char *comprevision = SRB2_COMP_REVISION;
|
|||
#elif (defined(COMPVERSION))
|
||||
#include "comptime.h"
|
||||
|
||||
const int compuncommitted =
|
||||
#if (defined(COMPVERSION_UNCOMMITTED))
|
||||
1;
|
||||
#else
|
||||
0;
|
||||
#endif
|
||||
|
||||
#else
|
||||
const char *compbranch = "Unknown";
|
||||
const char *comprevision = "illegal";
|
||||
|
|
|
|||
|
|
@ -4756,6 +4756,9 @@ static void Command_Version_f(void)
|
|||
CONS_Printf("\x87" "DEVELOP " "\x80");
|
||||
#endif
|
||||
|
||||
if (compuncommitted)
|
||||
CONS_Printf("\x85" "! UNCOMMITTED CHANGES ! " "\x80");
|
||||
|
||||
CONS_Printf("\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -613,6 +613,7 @@ UINT32 quickncasehash (const char *p, size_t n)
|
|||
|
||||
// Compile date and time and revision.
|
||||
extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
extern int compuncommitted;
|
||||
|
||||
// Disabled code and code under testing
|
||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||
|
|
|
|||
|
|
@ -2006,6 +2006,8 @@ void F_TitleScreenDrawer(void)
|
|||
#else // Regular build
|
||||
addtext(V_ALLOWLOWERCASE|V_TRANSLUCENT, va("%s", VERSIONSTRING));
|
||||
#endif
|
||||
if (compuncommitted)
|
||||
addtext(V_REDMAP|V_STRINGDANCE, "! UNCOMMITTED CHANGES !");
|
||||
}
|
||||
#undef addtext
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue