mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Add commit hash and date to title screen
The commit hash and date are now shown above the version number in the bottom-right of the title screen. They both automatically go away when compiled in release mode. https://cdn.discordapp.com/attachments/717089363896434719/779525976689213480/vvvvvv_with_interim_commit_and_date.png This is useful to easily figure out which commit someone is on whenever they report an issue, without having to ask them to do `git show` or whatever.
This commit is contained in:
parent
2b6d8b8090
commit
ebe074e308
2 changed files with 26 additions and 0 deletions
|
@ -16,6 +16,26 @@ SET(GOG OFF CACHE BOOL "Use the GOG API")
|
|||
IF(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
SET(STEAM ON)
|
||||
SET(GOG ON)
|
||||
ELSE()
|
||||
# Get interim commit and date of commit
|
||||
FIND_PACKAGE(Git)
|
||||
IF(GIT_FOUND)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h
|
||||
OUTPUT_VARIABLE INTERIM_COMMIT
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DINTERIM_COMMIT="${INTERIM_COMMIT}")
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cs
|
||||
OUTPUT_VARIABLE COMMIT_DATE
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DCOMMIT_DATE="${COMMIT_DATE}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Set standard to C++98/C++03
|
||||
|
|
|
@ -40,6 +40,12 @@ void menurender()
|
|||
graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb);
|
||||
#if defined(MAKEANDPLAY)
|
||||
graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true);
|
||||
#endif
|
||||
#ifdef COMMIT_DATE
|
||||
graphics.Print( 310 - (10*8), 210, COMMIT_DATE, tr/2, tg/2, tb/2);
|
||||
#endif
|
||||
#ifdef INTERIM_COMMIT
|
||||
graphics.Print( 310 - (8*8), 220, INTERIM_COMMIT, tr/2, tg/2, tb/2);
|
||||
#endif
|
||||
graphics.Print( 310 - (4*8), 230, "v2.3", tr/2, tg/2, tb/2);
|
||||
|
||||
|
|
Loading…
Reference in a new issue