diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5e9f0c76d..962ca31c78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,10 +40,21 @@ jobs: platform: x64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v1.3.1 - name: Create Build Environment run: cmake -E make_directory ${{ github.workspace }}/build @@ -89,7 +100,18 @@ jobs: portable: [Non-Portable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Create Build Environment run: | @@ -155,7 +177,18 @@ jobs: portable: [Non-Portable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/checkout@v4 + if: github.event_name != 'pull_request' + with: + fetch-depth: 0 + fetch-tags: true - name: Create Build Environment run: | @@ -205,7 +238,7 @@ jobs: needs: [msvc, ubuntu, macos] runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -236,7 +269,7 @@ jobs: needs: [msvc, ubuntu, macos] runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -291,7 +324,7 @@ jobs: zip: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive diff --git a/CMakeLists.txt b/CMakeLists.txt index 6206fa08a7..4c89274bcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,10 +323,18 @@ else() message(STATUS "SOURCE_DATE_EPOCH is set ($ENV{SOURCE_DATE_EPOCH}): SOURCE_DATE set to \"${SOURCE_DATE}\"") endif() -# Current Git SHA1 hash -include(GetGitRevisionDescription) -get_git_head_revision(GIT_REFSPEC GIT_HASH) -message(STATUS "Git revision is ${GIT_HASH}") +# Current Git tag/version +# ideally we would separate the hash suffix into its own variable, but sed is not available everywhere +execute_process( + COMMAND "git" "describe" "--tag" + OUTPUT_VARIABLE GIT_TAG + RESULT_VARIABLE GIT_TAG_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(GIT_TAG_ERROR AND NOT GIT_TAG_ERROR EQUAL 0) + message(WARNING "Unable to determine Git tag") + set(GIT_TAG vUNKNOWN) +endif() +message(STATUS "Git tag is ${GIT_TAG}") configure_file(shared/qcommon/q_version.h.in shared/qcommon/q_version.h @ONLY) diff --git a/cmake/Modules/GetGitRevisionDescription.cmake b/cmake/Modules/GetGitRevisionDescription.cmake deleted file mode 100644 index 1bf0230088..0000000000 --- a/cmake/Modules/GetGitRevisionDescription.cmake +++ /dev/null @@ -1,123 +0,0 @@ -# - Returns a version string from Git -# -# These functions force a re-configure on each git commit so that you can -# trust the values of the variables in your build system. -# -# get_git_head_revision( [ ...]) -# -# Returns the refspec and sha hash of the current head revision -# -# git_describe( [ ...]) -# -# Returns the results of git describe on the source tree, and adjusting -# the output so that it tests false if an error occurs. -# -# git_get_exact_tag( [ ...]) -# -# Returns the results of git describe --exact-match on the source tree, -# and adjusting the output so that it tests false if there was no exact -# matching tag. -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_git_revision_description) - return() -endif() -set(__get_git_revision_description YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() - - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - - configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" - @ONLY) - include("${GIT_DATA}/grabRef.cmake") - - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) -endfunction() - -function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - # TODO sanitize - #if((${ARGN}" MATCHES "&&") OR - # (ARGN MATCHES "||") OR - # (ARGN MATCHES "\\;")) - # message("Please report the following error to the project!") - # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") - #endif() - - #message(STATUS "Arguments to execute_process: ${ARGN}") - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() - - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) -endfunction() diff --git a/cmake/Modules/GetGitRevisionDescription.cmake.in b/cmake/Modules/GetGitRevisionDescription.cmake.in deleted file mode 100644 index 888ce13aab..0000000000 --- a/cmake/Modules/GetGitRevisionDescription.cmake.in +++ /dev/null @@ -1,38 +0,0 @@ -# -# Internal file for GetGitRevisionDescription.cmake -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(HEAD_HASH) - -file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) - -string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) -if(HEAD_CONTENTS MATCHES "ref") - # named branch - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") - configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - set(HEAD_HASH "${HEAD_REF}") - endif() -else() - # detached HEAD - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) -endif() - -if(NOT HEAD_HASH) - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) - string(STRIP "${HEAD_HASH}" HEAD_HASH) -endif() diff --git a/codemp/cgame/CMakeLists.txt b/codemp/cgame/CMakeLists.txt index 805d5f0236..ecbaa28d7f 100644 --- a/codemp/cgame/CMakeLists.txt +++ b/codemp/cgame/CMakeLists.txt @@ -25,6 +25,7 @@ set(MPCGameIncludeDirectories "${MPDir}" "${SharedDir}" "${GSLIncludeDirectory}" + "${CMAKE_BINARY_DIR}/shared" ) if(WIN32) set(MPCGameLibraries "odbc32" "odbccp32") # what are these even? @@ -112,7 +113,7 @@ set(MPCGameCommonFiles "${MPDir}/qcommon/q_shared.h" "${MPDir}/qcommon/qfiles.h" "${MPDir}/qcommon/tags.h" - + ${SharedCommonFiles} ) source_group("common" FILES ${MPCGameCommonFiles}) diff --git a/codemp/client/cl_console.cpp b/codemp/client/cl_console.cpp index f9f0340747..dc9490f13f 100644 --- a/codemp/client/cl_console.cpp +++ b/codemp/client/cl_console.cpp @@ -560,46 +560,6 @@ void Con_Init (void) { Cmd_AddCommand( "clear", Con_Clear_f, "Clear console text" ); Cmd_AddCommand( "condump", Con_Dump_f, "Dump console text to file" ); Cmd_SetCommandCompletionFunc( "condump", Cmd_CompleteTxtName ); - - {//build version string for console - int day, year; - char month[4]; - - if (sscanf(SOURCE_DATE, "%s %i %i", month, &day, &year) == 3) { - int mm = 0; - - //sry.. - if (month[0] == 'J' && month[1] == 'a' && month[2] == 'n') - mm = 1; - else if (month[0] == 'F') - mm = 2; - else if (month[0] == 'M' && month[1] == 'a' && month[2] == 'r') - mm = 3; - else if (month[0] == 'A' && month[1] == 'p') - mm = 4; - else if (month[0] == 'M' && month[1] == 'a' && month[2] == 'y') - mm = 5; - else if (month[0] == 'J' && month[1] == 'u' && month[2] == 'n') - mm = 6; - else if (month[0] == 'J' && month[1] == 'u' && month[2] == 'l') - mm = 7; - else if (month[0] == 'A' && month[1] == 'u') - mm = 8; - else if (month[0] == 'S') - mm = 9; - else if (month[0] == 'O') - mm = 10; - else if (month[0] == 'N') - mm = 11; - else if (month[0] == 'D') - mm = 12; - - Com_sprintf(version, sizeof(version), "EternalJK: [%02i/%02i/%04i]", mm, day, year); - } - } - - if (!version[0]) - Q_strncpyz(version, "EternalJK", sizeof(version)); } /* @@ -1017,7 +977,6 @@ void Con_DrawSolidConsole( float frac ) { SCR_DrawSmallChar(cls.glconfig.vidWidth - (i - x) * con.charWidth, lines - (con.charHeight + con.charHeight / 2) + padding, ts[x]); } - // draw the text con.vislines = lines; rows = (lines-con.charWidth)/con.charWidth; // rows of text to draw diff --git a/codemp/client/cl_main.cpp b/codemp/client/cl_main.cpp index d81b0cb6f4..59723084b7 100644 --- a/codemp/client/cl_main.cpp +++ b/codemp/client/cl_main.cpp @@ -31,6 +31,7 @@ along with this program; if not, see . #include "qcommon/cm_public.h" #include "qcommon/MiniHeap.h" #include "qcommon/stringed_ingame.h" +#include "qcommon/game_version.h" #include "cl_cgameapi.h" #include "cl_uiapi.h" #include "cl_lan.h" @@ -1045,7 +1046,7 @@ void CL_RequestMotd( void ) { Info_SetValueForKey( info, "challenge", cls.updateChallenge ); Info_SetValueForKey( info, "renderer", cls.glconfig.renderer_string ); Info_SetValueForKey( info, "rvendor", cls.glconfig.vendor_string ); - Info_SetValueForKey( info, "version", com_version->string ); + Info_SetValueForKey( info, "version", JK_VERSION_OLD " " PLATFORM_STRING " " SOURCE_DATE ); //If raven starts filtering for this, add this code back in #if 0 diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h index b8c047785f..3186ceff61 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -36,12 +36,12 @@ along with this program; if not, see . #define MAX_SPAWN_VARS 64 #define MAX_SPAWN_VARS_CHARS 4096 +// like a protocol version, but for mods +#define GAME_VERSION "basejka-1" -#define GAME_VERSION "basejka-1" - -#define DEFAULT_SABER "single_1" +#define DEFAULT_SABER "single_8" #define DEFAULT_SABER_STAFF "dual_1" -#define DEFAULT_SABER_MODEL "models/weapons2/saber_1/saber_1.glm" +#define DEFAULT_SABER_MODEL "models/weapons2/saber_1/saber_8.glm" #define DEFAULT_MODEL "kyle" #define DEFAULT_MODEL_FEMALE "jan" @@ -473,7 +473,7 @@ extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS]; #define JAPRO_CINFO_BACKSLASH (1<<8) //unlock backslash aim #define JAPRO_CINFO_REDDFA (1<<9) //unlock DFA aim #define JAPRO_CINFO_BHOP1 (1<<10) //force bhop only mode -#define JAPRO_CINFO_LG (1<<11) //Lightning Gun +#define JAPRO_CINFO_LG (1<<11) //Lightning Gun #define JAPRO_CINFO_JETPACK (1<<12) //jetpack physics #define JAPRO_CINFO_UNLAGGEDPROJ (1<<13) //allow unlagged #define JAPRO_CINFO_SCREENSHAKE (1<<14) //remove screenshake @@ -510,17 +510,17 @@ extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS]; //ja+ cp_plugindisable stuff #define JAPRO_PLUGIN_NEWDRAINEFX (1<<0) #define JAPRO_PLUGIN_DUELSEEOTHERS (1<<1) -#define JAPRO_PLUGIN_ENDDUELROTATION (1<<2) +#define JAPRO_PLUGIN_ENDDUELROTATION (1<<2) #define JAPRO_PLUGIN_BLACKSABERSDISABLE (1<<3) -#define JAPRO_PLUGIN_AUTOREPLYDISABLE (1<<4) -#define JAPRO_PLUGIN_NEWFORCEEFFECT (1<<5) +#define JAPRO_PLUGIN_AUTOREPLYDISABLE (1<<4) +#define JAPRO_PLUGIN_NEWFORCEEFFECT (1<<5) #define JAPRO_PLUGIN_NEWDEATHMSG_DISABLE (1<<6) -#define JAPRO_PLUGIN_NEWSIGHTEFFECT (1<<7) +#define JAPRO_PLUGIN_NEWSIGHTEFFECT (1<<7) #define JAPRO_PLUGIN_NOALTDIMEFFECT (1<<8) -#define JAPRO_PLUGIN_HOLSTEREDSABER (1<<9) +#define JAPRO_PLUGIN_HOLSTEREDSABER (1<<9) #define JAPRO_PLUGIN_LEDGEGRAB (1<<10) -#define JAPRO_PLUGIN_NEWDFAPRIM (1<<11) -#define JAPRO_PLUGIN_NEWDFAALT (1<<12) +#define JAPRO_PLUGIN_NEWDFAPRIM (1<<11) +#define JAPRO_PLUGIN_NEWDFAALT (1<<12) #define JAPRO_PLUGIN_NOSPCARTWHEEL (1<<13) #define JAPRO_PLUGIN_ALLOWLIBCURL (1<<14) @@ -707,7 +707,7 @@ typedef enum { STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?) STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?) STAT_MAX_HEALTH, // health / armor limit, changable by handicap - STAT_DASHTIME, + STAT_DASHTIME, STAT_LASTJUMPSPEED, STAT_RACEMODE, STAT_RESTRICTIONS, diff --git a/codemp/game/g_cvar.c b/codemp/game/g_cvar.c index 6d83f56f08..533c5d9f21 100644 --- a/codemp/game/g_cvar.c +++ b/codemp/game/g_cvar.c @@ -25,6 +25,7 @@ along with this program; if not, see . #include "g_local.h" #include "game/bg_public.h" +#include "qcommon/game_version.h" // // Cvar callbacks diff --git a/codemp/game/g_local.h b/codemp/game/g_local.h index 12d3aa042c..f7c98b8151 100644 --- a/codemp/game/g_local.h +++ b/codemp/game/g_local.h @@ -208,8 +208,8 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th #define WT_INFINITE_AMMO (1<<17) #define WT_STUN_HEAL (1<<18) #define WT_ANTI_VEHICLE (1<<19) -#define WT_ALLOW_GUNROLL (1<<20) -#define WT_FAST_WEAPONSWITCH (1<<21) +#define WT_ALLOW_GUNROLL (1<<20) +#define WT_FAST_WEAPONSWITCH (1<<21) #define WT_IMPACT_NITRON (1<<22) #define WT_STAKE_GUN (1<<23) #define WT_FIX_MINEAMMO (1<<24) @@ -220,7 +220,7 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th #define WT_SOLID_ROCKET (1<<29) #define WT_NERFED_PISTOL (1<<30) -//wt_halt +//wt_halt //wt_hook //wt proj barrier //wt discord/tag @@ -229,8 +229,8 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th /* //#define REDUCE_SABERBLOCK (1<<20) //s #define ALLOW_GUNROLL (1<<21) //CLIENT -#define FAST_WEAPONSWITCH (1<<22) -//#define FIXED_SABERSWITCH (1<<23) //s +#define FAST_WEAPONSWITCH (1<<22) +//#define FIXED_SABERSWITCH (1<<23) //s #define IMPACT_NITRON (1<<24) #define STAKE_GUN (1<<25) //#define REDUCE_SABERDROP (1<<26) //s @@ -1435,10 +1435,10 @@ typedef struct level_locals_s { char mTeamFilter[MAX_QPATH]; //JAPRO - Serverside - Amlockteam - Start - qboolean isLockedred; - qboolean isLockedblue; - qboolean isLockedspec; - qboolean isLockedfree; + qboolean isLockedred; + qboolean isLockedblue; + qboolean isLockedspec; + qboolean isLockedfree; fileHandle_t duelLog; fileHandle_t raceLog; fileHandle_t failRaceLog; @@ -1447,7 +1447,7 @@ typedef struct level_locals_s { #endif fileHandle_t playerLog; - char courseName[24][32];//japro defrag + char courseName[24][32];//japro defrag int numCourses; int numRealVotingClients; //fixed vote checking diff --git a/codemp/game/g_main.c b/codemp/game/g_main.c index 22b9c98e9a..68e1c8204f 100644 --- a/codemp/game/g_main.c +++ b/codemp/game/g_main.c @@ -29,7 +29,7 @@ along with this program; if not, see . #include "bg_saga.h" #include "b_local.h" #include "game/bg_public.h" -#include "qcommon/q_version.h" +#include "qcommon/game_version.h" NORETURN_PTR void (*Com_Error)( int level, const char *error, ... ); void (*Com_Printf)( const char *msg, ... ); @@ -239,7 +239,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) { BG_VehicleLoadParms(); trap->Print ("------- Game Initialization -------\n"); - trap->Print ("gamename: %s\n", GAMEVERSION); + trap->Print ("gamename: %s\n", JK_VERSION); trap->Print ("gamedate: %s\n", SOURCE_DATE); // init as zero, to be updated by the following cvar registration diff --git a/codemp/game/g_xcvar.h b/codemp/game/g_xcvar.h index 6a1023d881..eaeaeb5964 100644 --- a/codemp/game/g_xcvar.h +++ b/codemp/game/g_xcvar.h @@ -21,9 +21,7 @@ along with this program; if not, see . =========================================================================== */ -#include "qcommon/q_version.h" - -#if defined(XCVAR_PROTO) +#if defined XCVAR_PROTO #define XCVAR_DEF( name, defVal, update, flags, announce ) extern vmCvar_t name; #elif defined(XCVAR_DECL) #define XCVAR_DEF( name, defVal, update, flags, announce ) vmCvar_t name; @@ -168,7 +166,7 @@ XCVAR_DEF( g_warmup, "20", NULL, CVAR_ARCHIVE, qtrue ) XCVAR_DEF( g_weaponDisable, "0", CVU_WeaponDisable, CVAR_SERVERINFO|CVAR_ARCHIVE/*|CVAR_LATCH*/, qtrue ) XCVAR_DEF( g_weaponRespawn, "5", NULL, CVAR_NONE, qtrue ) XCVAR_DEF( gamedate, SOURCE_DATE, NULL, CVAR_ROM, qfalse ) -XCVAR_DEF( gamename, GAMEVERSION, NULL, CVAR_SERVERINFO|CVAR_ROM, qfalse ) +XCVAR_DEF( gamename, JK_VERSION, NULL, CVAR_SERVERINFO|CVAR_ROM, qfalse ) XCVAR_DEF( pmove_fixed, "0", NULL, CVAR_SYSTEMINFO|CVAR_ARCHIVE, qtrue ) XCVAR_DEF( pmove_float, "0", NULL, CVAR_SYSTEMINFO|CVAR_ARCHIVE, qtrue ) XCVAR_DEF( pmove_msec, "8", NULL, CVAR_SYSTEMINFO|CVAR_ARCHIVE, qtrue ) diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp index c6513f8843..fad162db7a 100755 --- a/codemp/qcommon/common.cpp +++ b/codemp/qcommon/common.cpp @@ -27,7 +27,6 @@ along with this program; if not, see . #include "stringed_ingame.h" #include "qcommon/cm_public.h" #include "qcommon/game_version.h" -#include "qcommon/q_version.h" #include "../server/NPCNav/navigator.h" #include "../shared/sys/sys_local.h" #if defined(_WIN32) @@ -1319,7 +1318,6 @@ Com_Init ================= */ void Com_Init( char *commandLine ) { - char *s; int qport; Com_Printf( "%s %s %s\n", JK_VERSION, PLATFORM_STRING, SOURCE_DATE ); @@ -1460,8 +1458,7 @@ void Com_Init( char *commandLine ) { com_bootlogo = Cvar_Get( "com_bootlogo", "0", CVAR_ARCHIVE_ND, "Show intro movies" ); - s = va("%s %s %s", JK_VERSION_OLD, PLATFORM_STRING, SOURCE_DATE ); - com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO ); + com_version = Cvar_Get ("version", JK_VERSION " " PLATFORM_STRING " " SOURCE_DATE, CVAR_ROM | CVAR_SERVERINFO ); SE_Init(); diff --git a/codemp/qcommon/game_version.h b/codemp/qcommon/game_version.h index 9e74379a30..55990e1164 100644 --- a/codemp/qcommon/game_version.h +++ b/codemp/qcommon/game_version.h @@ -20,8 +20,13 @@ along with this program; if not, see . =========================================================================== */ -#define _STR(x) #x -#define STR(x) _STR(x) +#include "qcommon/q_version.h" + +#if !defined(STRING) && !defined(XSTRING) + // rather than including q_shared.h from win32 resource scripts (win32/*.rc) + #define STRING( a ) #a + #define XSTRING( a ) STRING( a ) +#endif // Current version of the multi player game #define VERSION_MAJOR_RELEASE 1 @@ -29,16 +34,16 @@ along with this program; if not, see . #define VERSION_EXTERNAL_BUILD 1 #define VERSION_INTERNAL_BUILD 0 -#define VERSION_STRING STR(VERSION_MAJOR_RELEASE) ", " STR(VERSION_MINOR_RELEASE) ", " STR(VERSION_EXTERNAL_BUILD) ", " STR(VERSION_INTERNAL_BUILD) // "a, b, c, d" -#define VERSION_STRING_DOTTED STR(VERSION_MAJOR_RELEASE) "." STR(VERSION_MINOR_RELEASE) "." STR(VERSION_EXTERNAL_BUILD) "." STR(VERSION_INTERNAL_BUILD) // "a.b.c.d" +#define VERSION_STRING XSTRING(VERSION_MAJOR_RELEASE) ", " XSTRING(VERSION_MINOR_RELEASE) ", " XSTRING(VERSION_EXTERNAL_BUILD) ", " XSTRING(VERSION_INTERNAL_BUILD) // "a, b, c, d" +#define VERSION_STRING_DOTTED XSTRING(VERSION_MAJOR_RELEASE) "." XSTRING(VERSION_MINOR_RELEASE) "." XSTRING(VERSION_EXTERNAL_BUILD) "." XSTRING(VERSION_INTERNAL_BUILD) // "a.b.c.d" #if defined(_DEBUG) - #define JK_VERSION "(debug)EternalJK: " SOURCE_DATE + #define JK_VERSION "(debug)EternalJK: " GIT_TAG #define JK_VERSION_OLD "(debug)JAmp: v" VERSION_STRING_DOTTED #elif defined (TOURNAMENT_CLIENT) - #define JK_VERSION "EternalJK: Tournament Client" + #define JK_VERSION "EternalJK: Tournament Client" GIT_TAG #define JK_VERSION_OLD "JAmp: v" VERSION_STRING_DOTTED #else - #define JK_VERSION "EternalJK: " SOURCE_DATE + #define JK_VERSION "EternalJK: " GIT_TAG #define JK_VERSION_OLD "JAmp: v" VERSION_STRING_DOTTED #endif diff --git a/codemp/server/sv_ccmds.cpp b/codemp/server/sv_ccmds.cpp index a3fb34aa55..b68f06eb12 100755 --- a/codemp/server/sv_ccmds.cpp +++ b/codemp/server/sv_ccmds.cpp @@ -24,8 +24,8 @@ along with this program; if not, see . #include "server.h" #include "qcommon/stringed_ingame.h" -#include "server/sv_gameapi.h" #include "qcommon/game_version.h" +#include "server/sv_gameapi.h" #include #include diff --git a/codemp/ui/CMakeLists.txt b/codemp/ui/CMakeLists.txt index 0e20157bf1..8483a1f300 100644 --- a/codemp/ui/CMakeLists.txt +++ b/codemp/ui/CMakeLists.txt @@ -25,6 +25,7 @@ set(MPUIIncludeDirectories "${MPDir}" "${SharedDir}" "${GSLIncludeDirectory}" + "${CMAKE_BINARY_DIR}/shared" ) if(WIN32) set(MPUILibraries "odbc32" "odbccp32") # what are these even? @@ -54,7 +55,7 @@ set(MPUICommonFiles "${MPDir}/qcommon/q_shared.h" "${MPDir}/qcommon/qfiles.h" "${MPDir}/qcommon/tags.h" - + ${SharedCommonFiles} ) source_group("common" FILES ${MPUICommonFiles}) diff --git a/shared/qcommon/q_version.h.in b/shared/qcommon/q_version.h.in index d58c533843..559233daf4 100644 --- a/shared/qcommon/q_version.h.in +++ b/shared/qcommon/q_version.h.in @@ -1,5 +1,5 @@ #cmakedefine SOURCE_DATE "@SOURCE_DATE@" -#cmakedefine GIT_HASH "@GIT_HASH@" +#cmakedefine GIT_TAG "@GIT_TAG@" #cmakedefine BUILD_PORTABLE #if !defined(SOURCE_DATE) diff --git a/shared/sys/sys_win32.cpp b/shared/sys/sys_win32.cpp index 8f21ac2380..1eac0ec6c9 100644 --- a/shared/sys/sys_win32.cpp +++ b/shared/sys/sys_win32.cpp @@ -19,7 +19,6 @@ along with this program; if not, see . =========================================================================== */ -#include "qcommon/q_version.h" #include "sys_local.h" #include "sys_loadlib.h" #include