diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc10b1b995..2efe5eec51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,10 +36,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.2 - name: Create Build Environment run: cmake -E make_directory ${{ github.workspace }}/build @@ -68,14 +79,14 @@ jobs: shell: bash run: cmake --install . --config ${{ matrix.build_type }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJK-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} path: ${{ github.workspace }}/build/bin/JediAcademy if-no-files-found: error - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJO-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} @@ -93,7 +104,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: | @@ -149,14 +171,14 @@ jobs: shell: bash run: tar -czvf OpenJO-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz * - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} path: ${{github.workspace}}/install/JediAcademy/OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz if-no-files-found: error - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJO-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} @@ -179,7 +201,18 @@ jobs: arch: arm64 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: | @@ -214,26 +247,22 @@ jobs: if: ${{ matrix.build_type == 'Release' }} working-directory: ${{ github.workspace }}/install/JediAcademy shell: bash - run: | - chmod +x openjk.${{ matrix.arch }}.app/Contents/MacOS/openjk.${{ matrix.arch }} - tar -czvf openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz * + run: tar -czvf openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz * - name: Create OpenJO binary archive if: ${{ matrix.build_type == 'Release' }} working-directory: ${{ github.workspace }}/install/JediOutcast shell: bash - run: | - chmod +x openjo_sp.${{ matrix.arch }}.app/Contents/MacOS/openjo_sp.${{ matrix.arch }} - tar -czvf openjo_sp-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz * + run: tar -czvf openjo_sp-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz * - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} path: ${{ github.workspace }}/install/JediAcademy/openjk-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz if-no-files-found: error - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ matrix.build_type == 'Release' }} with: name: OpenJO-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }} @@ -245,12 +274,12 @@ jobs: needs: [msvc, ubuntu, macos] runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Create binary archives run: | @@ -269,10 +298,11 @@ jobs: mv ./OpenJO-macos-arm64-Release-Non-Portable/* OpenJO-macos-arm64.tar.gz - name: Create latest build - uses: marvinpinto/action-automatic-releases@latest + uses: softprops/action-gh-release@v1 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - automatic_release_tag: "latest" + generate_release_notes: true + tag_name: "latest" prerelease: false title: Latest Build files: | @@ -336,12 +366,12 @@ jobs: zip: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Create archive run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index c168794694..7672c68f1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,10 +323,19 @@ 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" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + 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/README.md b/README.md index 88e23d3c64..e100e95c8c 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ If you have the Mac App Store Version of Jedi Academy, follow these steps to get ### Using OpenJK as a base for a new mod - [Fork](https://github.com/JACoders/OpenJK/fork) the project on GitHub -- Change the `GAMEVERSION` define in [codemp/game/g_local.h](https://github.com/JACoders/OpenJK/blob/master/codemp/game/g_local.h) from "OpenJK" to your project name +- Change the JK_VERSION define in codemp/qcommon/game_version.h from "OpenJK" to your project name - If you make a nice change, please consider back-porting to upstream via pull request as described above. This is so everyone benefits without having to reinvent the wheel for every project. ## Maintainers (full list: [@JACoders](https://github.com/orgs/JACoders/people)) 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/code/CMakeLists.txt b/code/CMakeLists.txt index f41d0f7a2c..7052fd7d62 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -175,7 +175,7 @@ if(BuildSPEngine OR BuildJK2SPEngine) "${SPDir}/qcommon/z_memman_pc.cpp" "${SPDir}/qcommon/qfiles.h" "${SPDir}/qcommon/qcommon.h" - "${SPDir}/qcommon/stv_version.h" + "${SPDir}/qcommon/game_version.h" "${SPDir}/qcommon/timing.h" "${SPDir}/qcommon/MiniHeap.h" diff --git a/code/client/cl_console.cpp b/code/client/cl_console.cpp index f175cbcaf5..d05246cf2e 100644 --- a/code/client/cl_console.cpp +++ b/code/client/cl_console.cpp @@ -28,7 +28,7 @@ along with this program; if not, see . #include "client.h" #include "qcommon/stringed_ingame.h" -#include "qcommon/stv_version.h" +#include "qcommon/game_version.h" int g_console_field_width = 78; @@ -729,11 +729,11 @@ void Con_DrawSolidConsole( float frac ) re.SetColor( console_color ); re.DrawStretchPic( 0, y, SCREEN_WIDTH, 2, 0, 0, 0, 0, cls.whiteShader ); - i = strlen( Q3_VERSION ); + i = strlen( JK_VERSION ); for (x=0 ; x. //================================================================== -// the "gameversion" client command will print this plus compile date -#define GAMEVERSION "OpenJK" - #define BODY_QUEUE_SIZE 8 #define Q3_INFINITE 16777216 diff --git a/code/game/g_main.cpp b/code/game/g_main.cpp index dceac508eb..a349d4f910 100644 --- a/code/game/g_main.cpp +++ b/code/game/g_main.cpp @@ -37,7 +37,7 @@ along with this program; if not, see . //rww - RAGDOLL_END #include "qcommon/ojk_saved_game_helper.h" -#include "qcommon/q_version.h" +#include "qcommon/game_version.h" extern void WP_SaberLoadParms( void ); extern qboolean G_PlayerSpawned( void ); @@ -617,7 +617,7 @@ void G_InitCvars( void ) { g_developer = gi.cvar ("developer", "", 0); // noset vars - gi.cvar( "gamename", GAMEVERSION , CVAR_SERVERINFO | CVAR_ROM ); + gi.cvar( "gamename", JK_VERSION , CVAR_SERVERINFO | CVAR_ROM ); gi.cvar( "gamedate", SOURCE_DATE , CVAR_ROM ); g_skippingcin = gi.cvar ("skippingCinematic", "0", CVAR_ROM); @@ -734,7 +734,7 @@ void InitGame( const char *mapname, const char *spawntarget, int checkSum, cons g_qbLoadTransition = qbLoadTransition; gi.Printf ("------- Game Initialization -------\n"); - gi.Printf ("gamename: %s\n", GAMEVERSION); + gi.Printf ("gamename: %s\n", JK_VERSION); gi.Printf ("gamedate: %s\n", SOURCE_DATE); srand( randomSeed ); diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp index 41f2da9e55..e613ab0946 100644 --- a/code/qcommon/common.cpp +++ b/code/qcommon/common.cpp @@ -26,10 +26,9 @@ along with this program; if not, see . #include "q_shared.h" #include "qcommon.h" -#include "qcommon/q_version.h" #include "sstring.h" // to get Gil's string class, because MS's doesn't compile properly in here #include "stringed_ingame.h" -#include "stv_version.h" +#include "game_version.h" #include "../shared/sys/sys_local.h" #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN @@ -1081,7 +1080,7 @@ Com_Init void Com_Init( char *commandLine ) { char *s; - Com_Printf( "%s %s %s\n", Q3_VERSION, PLATFORM_STRING, SOURCE_DATE ); + Com_Printf( "%s %s %s\n", JK_VERSION, PLATFORM_STRING, SOURCE_DATE ); try { Com_InitZoneMemory(); @@ -1159,8 +1158,7 @@ void Com_Init( char *commandLine ) { Cmd_AddCommand ("freeze", Com_Freeze_f); } - s = va("%s %s %s", Q3_VERSION, 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 ); #ifdef JK2_MODE JK2SP_Init(); diff --git a/code/qcommon/stv_version.h b/code/qcommon/game_version.h similarity index 50% rename from code/qcommon/stv_version.h rename to code/qcommon/game_version.h index be9f98c098..49bf3cc526 100644 --- a/code/qcommon/stv_version.h +++ b/code/qcommon/game_version.h @@ -20,16 +20,27 @@ along with this program; if not, see . =========================================================================== */ -// Current version of the single player game -#include "../win32/AutoVersion.h" +#include "qcommon/q_version.h" -#ifdef _DEBUG - #define Q3_VERSION "(debug)OpenJK: v" VERSION_STRING_DOTTED -#elif defined FINAL_BUILD - #define Q3_VERSION "OpenJK: v" VERSION_STRING_DOTTED -#else - #define Q3_VERSION "(internal)OpenJK: v" VERSION_STRING_DOTTED +#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 -// end +// Current version of the single player game +#define VERSION_MAJOR_RELEASE 1 +#define VERSION_MINOR_RELEASE 0 +#define VERSION_EXTERNAL_BUILD 1 +#define VERSION_INTERNAL_BUILD 1 + +#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)OpenJK: " GIT_TAG + #define JK_VERSION_OLD "(debug)JA: v" VERSION_STRING_DOTTED +#else + #define JK_VERSION "OpenJK: " GIT_TAG + #define JK_VERSION_OLD "JA: v" VERSION_STRING_DOTTED +#endif diff --git a/code/server/sv_ccmds.cpp b/code/server/sv_ccmds.cpp index 67b079ae02..782516bd13 100644 --- a/code/server/sv_ccmds.cpp +++ b/code/server/sv_ccmds.cpp @@ -27,9 +27,7 @@ along with this program; if not, see . #include "../game/weapons.h" #include "../game/g_items.h" #include "../game/statindex.h" - -#include "../win32/AutoVersion.h" - +#include "../qcommon/game_version.h" /* =============================================================================== @@ -386,7 +384,7 @@ static void SV_Status_f( void ) { Com_Printf( "name : %s^7\n", cl->name ); Com_Printf( "score : %i\n", cl->gentity->client->persistant[PERS_SCORE] ); - Com_Printf( "version : %s %s %i\n", STATUS_OS, VERSION_STRING_DOTTED, PROTOCOL_VERSION ); + Com_Printf( "version : %s %s %i\n", STATUS_OS, JK_VERSION, PROTOCOL_VERSION ); #ifdef JK2_MODE Com_Printf( "game : Jedi Outcast %s\n", FS_GetCurrentGameDir() ); #else diff --git a/code/ui/ui_atoms.cpp b/code/ui/ui_atoms.cpp index 69ccfb6e3b..d2aad9ee70 100644 --- a/code/ui/ui_atoms.cpp +++ b/code/ui/ui_atoms.cpp @@ -31,7 +31,6 @@ along with this program; if not, see . #include "ui_local.h" #include "gameinfo.h" -#include "../qcommon/stv_version.h" uiimport_t ui; uiStatic_t uis; diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp index 39a226900a..f8537aa9ed 100644 --- a/code/ui/ui_main.cpp +++ b/code/ui/ui_main.cpp @@ -47,8 +47,8 @@ USER INTERFACE MAIN extern stringID_table_t animTable [MAX_ANIMATIONS+1]; #include "../qcommon/stringed_ingame.h" -#include "../qcommon/stv_version.h" #include "../qcommon/q_shared.h" +#include "../qcommon/game_version.h" extern qboolean ItemParse_model_g2anim_go( itemDef_t *item, const char *animName ); extern qboolean ItemParse_asset_model_go( itemDef_t *item, const char *name ); @@ -3696,9 +3696,9 @@ static void UI_Version(rectDef_t *rect, float scale, vec4_t color, int iFontInde { int width; - width = DC->textWidth(Q3_VERSION, scale, 0); + width = DC->textWidth(JK_VERSION, scale, 0); - DC->drawText(rect->x - width, rect->y, scale, color, Q3_VERSION, 0, ITEM_TEXTSTYLE_SHADOWED, iFontIndex); + DC->drawText(rect->x - width, rect->y, scale, color, JK_VERSION, 0, ITEM_TEXTSTYLE_SHADOWED, iFontIndex); } /* diff --git a/code/win32/AutoVersion.h b/code/win32/AutoVersion.h deleted file mode 100644 index 841c109e4b..0000000000 --- a/code/win32/AutoVersion.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -This file is part of Jedi Academy. - - Jedi Academy is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - Jedi Academy is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Jedi Academy. If not, see . -*/ -// Copyright 2001-2013 Raven Software - -#ifndef __AUTO_VERSION_HEADER -#define __AUTO_VERSION_HEADER - -#define VERSION_MAJOR_RELEASE 1 -#define VERSION_MINOR_RELEASE 0 -#define VERSION_EXTERNAL_BUILD 1 -#define VERSION_INTERNAL_BUILD 1 - -#define VERSION_STRING "1, 0, 1, 1" -#define VERSION_STRING_DOTTED "1.0.1.1" - -#define VERSION_BUILD_NUMBER 80 - -// BEGIN COMMENTS -// 1.0.1.0 10/24/2003 16:29:53 jmonroe patch rc1 -// 1.0.0.4 10/17/2003 17:45:31 jmonroe fix ati texture rect hack -// 1.0.0.3 08/29/2003 18:17:37 jmonroe hide saberrealisticcombat and g_dismemberment debug value -// 1.0.0.2 08/12/2003 17:48:44 jmonroe demo, take 3 -// 1.0.0.1 08/07/2003 19:53:23 jmonroe demo round 2 -// 1.0.0.0 08/01/2003 16:59:44 jmonroe push demo code changes -// 1.0.0.0 07/21/2003 16:09:23 jmonroe going gold -// 0.0.12.0 07/20/2003 19:04:44 jmonroe build 0.12 for qa -// 0.0.11.0 07/19/2003 15:30:08 jmonroe stuff -// 0.0.11.0 07/17/2003 17:08:09 jmonroe build 0.11 for qa -// 0.0.10.1 07/16/2003 17:33:28 mgummelt General Update With Latest Code -// 0.0.10.0 07/16/2003 10:28:51 jmonroe new product id, remove outcast.roq at end, menu ignoreescape, eax looping sounds support chan_less_atten -// 0.0.10.0 07/14/2003 19:04:42 jmonroe build 0.10 for qa -// 0.0.9.0 07/12/2003 13:05:57 jmonroe increase numsnapshot ents -// 0.0.9.0 07/11/2003 17:48:40 jmonroe buil 0.09 for qa -// 0.0.8.4 07/11/2003 15:47:55 jmonroe weatherzone caching -// 0.0.8.3 07/11/2003 12:05:44 mgummelt Lava & Acid fixes -// 0.0.8.2 07/10/2003 17:26:42 mgummelt General Update with today's bug fixes -// 0.0.8.1 07/09/2003 19:24:19 jmonroe eax voice stomp fix, increased weather zones, ... -// 0.0.8.0 07/08/2003 17:28:27 jmonroe build 0.08 for qa -// 0.0.7.2 07/07/2003 16:28:40 mgummelt Blaster Pistol alt-fire returns, Rancor spawnflags corrected -// 0.0.7.1 07/07/2003 10:48:29 jmonroe load menu fixes, darkside autoload fix,... -// 0.0.7.0 07/02/2003 19:31:37 jmonroe buil 7 for qa -// 0.0.6.5 07/02/2003 18:17:17 mgummelt Boss balancing -// 0.0.6.3 07/02/2003 01:34:48 jmonroe saber in moves menu -// 0.0.6.2 06/30/2003 15:33:37 mgummelt Force Sight change (designers readme) -// 0.0.6.1 06/29/2003 19:00:17 jmonroe vv merged, aev_soundchan -// 0.0.6.0 06/28/2003 16:38:27 jmonroe eax update, force sight on key dudes -// 0.0.6.0 06/26/2003 16:45:26 jmonroe qa build -// 0.0.5.6 06/25/2003 21:22:38 mgummelt "redcrosshair" field on misc_model_breakables and func_breakables -// 0.0.5.5 06/25/2003 18:31:52 mgummelt Force Visible on all applicable ents -// 0.0.5.4 06/25/2003 10:45:12 jmonroe EAX 4.0 -// 0.0.5.3 06/24/2003 22:59:31 mgummelt Reborn tweaks -// 0.0.5.2 06/24/2003 18:53:55 mgummelt New Reborn Master -// 0.0.5.1 06/23/2003 20:47:44 jmonroe fix NULL NPC usage -// 0.0.5.0 06/21/2003 13:04:27 jmonroe fix eweb crash -// 0.0.4.2 06/18/2003 14:24:35 jmonroe script cmd SET_WEAPON now precaches weapon, gil's optimized dlights -// 0.0.4.1 06/17/2003 19:04:28 mgummelt Various Force Power, saber move & Enemy Jedi tweaks -// 0.0.4.0 06/16/2003 19:41:54 jmonroe bug stuff -// 0.0.4.0 06/13/2003 23:52:36 jmonroe inc version to match qa beta -// 0.0.2.6 06/12/2003 13:11:21 creed new z-far cull -// 0.0.2.5 06/10/2003 17:02:17 creed targetJump & other navigation -// 0.0.2.4 06/10/2003 11:18:58 jmonroe footstep sounds in per material -// 0.0.2.3 06/10/2003 01:37:10 mgummelt helping with entity limit at spawntime -// 0.0.2.2 06/09/2003 14:10:32 scork fix for asian languages being bust by bad font -// 0.0.2.1 06/08/2003 17:57:11 mgummelt Area portal fix -// 0.0.2.0 06/08/2003 14:02:03 mgummelt Force sight change -// 0.0.2.0 06/08/2003 00:03:58 jmonroe CGEN_LIGHTING_DIFFUSE_ENTITY merges lightingdiffuse and entity color -// 0.0.1.25 06/05/2003 20:51:30 mgummelt Saber pull-attacks done -// 0.0.1.24 06/05/2003 18:11:06 mgummelt Both saber control schemes implemented -// 0.0.1.23 05/30/2003 17:12:34 mgummelt Fixed Noghri and Sand Creature -// 0.0.1.22 05/30/2003 12:15:37 mgummelt Saboteur change, new cultist -// 0.0.1.21 05/29/2003 16:02:48 creed Fixes For Assassin, ST AI changes -// 0.0.1.20 05/29/2003 12:00:18 mgummelt Navigation changes -// 0.0.1.19 05/29/2003 11:08:06 mgummelt various tweaks -// 0.0.1.18 05/28/2003 22:08:16 creed Boba Fett ++ -// 0.0.1.17 05/28/2003 20:38:33 mgummelt force grip and force sense changes -// 0.0.1.15 05/28/2003 17:07:26 mgummelt tweaks of force drain, protect and absorb -// 0.0.1.14 05/28/2003 14:48:57 mgummelt various saber & AI fixes -// 0.0.1.13 05/27/2003 17:26:30 areis Ported Glow stuff from MP (with support for nVidia and ATI cards). Added solid flag for roffs (in behaved) and made tie-bombers explode with effect. -// 0.0.1.12 05/27/2003 13:06:03 mgummelt Noghri stick weapon shoots a projectile, E-Web uses proper sounds -// 0.0.1.7 05/19/2003 15:00:10 mgummelt adding random jedi, elder prisoners, jedi master -// 0.0.1.6 05/19/2003 09:22:18 creed Weather Effects & Haz Trooper -// 0.0.1.5 05/16/2003 18:55:10 creed New Wind Spawn Flags For Dusty Fog & 1/2 way through Haz Trooper Fixins -// 0.0.1.4 05/15/2003 14:29:35 jmonroe misc_model_static stay around after a vid_start -// 0.0.1.3 05/14/2003 17:53:44 mgummelt testing misc_model_breakable scaling -// 0.0.1.2 05/13/2003 20:48:35 jmonroe vv post merge -// 0.0.1.1 05/13/2003 14:17:20 scork ste test comment -// END COMMENTS - -#endif // __AUTO_VERSION_HEADER diff --git a/code/win32/game.rc b/code/win32/game.rc index 3632640c44..25a37910c4 100644 --- a/code/win32/game.rc +++ b/code/win32/game.rc @@ -51,7 +51,7 @@ END // // Version // -#include "AutoVersion.h" +#include "../qcommon/game_version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_MAJOR_RELEASE,VERSION_MINOR_RELEASE,VERSION_EXTERNAL_BUILD,VERSION_INTERNAL_BUILD diff --git a/code/win32/winquake.rc b/code/win32/winquake.rc index 751d5b49b3..937ad8c83f 100644 --- a/code/win32/winquake.rc +++ b/code/win32/winquake.rc @@ -59,7 +59,7 @@ IDI_ICON1 ICON "starwars.ico" // // Version // -#include "AutoVersion.h" +#include "../qcommon/game_version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_MAJOR_RELEASE,VERSION_MINOR_RELEASE,VERSION_EXTERNAL_BUILD,VERSION_INTERNAL_BUILD diff --git a/codeJK2/game/g_local.h b/codeJK2/game/g_local.h index 40dbdbb544..221cf26d98 100644 --- a/codeJK2/game/g_local.h +++ b/codeJK2/game/g_local.h @@ -37,9 +37,6 @@ along with this program; if not, see . //================================================================== -// the "gameversion" client command will print this plus compile date -#define GAMEVERSION "base" - #define BODY_QUEUE_SIZE 8 #define Q3_INFINITE 16777216 diff --git a/codeJK2/game/g_main.cpp b/codeJK2/game/g_main.cpp index 22135c231f..671b309a80 100644 --- a/codeJK2/game/g_main.cpp +++ b/codeJK2/game/g_main.cpp @@ -36,7 +36,7 @@ along with this program; if not, see . #include "../cgame/cg_local.h" // yeah I know this is naughty, but we're shipping soon... #include "time.h" #include "../code/qcommon/ojk_saved_game_helper.h" -#include "qcommon/q_version.h" +#include "../code/qcommon/game_version.h" extern CNavigator navigator; @@ -558,7 +558,7 @@ void G_InitCvars( void ) { g_developer = gi.cvar ("developer", "", 0); // noset vars - gi.cvar( "gamename", GAMEVERSION , CVAR_SERVERINFO | CVAR_ROM ); + gi.cvar( "gamename", JK_VERSION , CVAR_SERVERINFO | CVAR_ROM ); gi.cvar( "gamedate", SOURCE_DATE , CVAR_ROM ); g_skippingcin = gi.cvar ("skippingCinematic", "0", CVAR_ROM); @@ -620,7 +620,7 @@ void InitGame( const char *mapname, const char *spawntarget, int checkSum, cons g_qbLoadTransition = qbLoadTransition; gi.Printf ("------- Game Initialization -------\n"); - gi.Printf ("gamename: %s\n", GAMEVERSION); + gi.Printf ("gamename: %s\n", JK_VERSION); gi.Printf ("gamedate: %s\n", SOURCE_DATE); srand( randomSeed ); diff --git a/codeJK2/qcommon/game_version.h b/codeJK2/qcommon/game_version.h new file mode 100644 index 0000000000..ea720b923b --- /dev/null +++ b/codeJK2/qcommon/game_version.h @@ -0,0 +1,46 @@ +/* +=========================================================================== +Copyright (C) 2000 - 2013, Raven Software, Inc. +Copyright (C) 2001 - 2013, Activision, Inc. +Copyright (C) 2013 - 2015, OpenJK contributors + +This file is part of the OpenJK source code. + +OpenJK is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License version 2 as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . +=========================================================================== +*/ + +#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 single player game +#define VERSION_MAJOR_RELEASE 1 +#define VERSION_MINOR_RELEASE 0 +#define VERSION_EXTERNAL_BUILD 3 +#define VERSION_INTERNAL_BUILD 0 + +#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)OpenJO: " GIT_TAG + #define JK_VERSION_OLD "(debug)JO: v" VERSION_STRING_DOTTED +#else + #define JK_VERSION "OpenJO: " GIT_TAG + #define JK_VERSION_OLD "JO: v" VERSION_STRING_DOTTED +#endif diff --git a/codeJK2/win32/AutoVersion.h b/codeJK2/win32/AutoVersion.h deleted file mode 100644 index 841c109e4b..0000000000 --- a/codeJK2/win32/AutoVersion.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -This file is part of Jedi Academy. - - Jedi Academy is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - Jedi Academy is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Jedi Academy. If not, see . -*/ -// Copyright 2001-2013 Raven Software - -#ifndef __AUTO_VERSION_HEADER -#define __AUTO_VERSION_HEADER - -#define VERSION_MAJOR_RELEASE 1 -#define VERSION_MINOR_RELEASE 0 -#define VERSION_EXTERNAL_BUILD 1 -#define VERSION_INTERNAL_BUILD 1 - -#define VERSION_STRING "1, 0, 1, 1" -#define VERSION_STRING_DOTTED "1.0.1.1" - -#define VERSION_BUILD_NUMBER 80 - -// BEGIN COMMENTS -// 1.0.1.0 10/24/2003 16:29:53 jmonroe patch rc1 -// 1.0.0.4 10/17/2003 17:45:31 jmonroe fix ati texture rect hack -// 1.0.0.3 08/29/2003 18:17:37 jmonroe hide saberrealisticcombat and g_dismemberment debug value -// 1.0.0.2 08/12/2003 17:48:44 jmonroe demo, take 3 -// 1.0.0.1 08/07/2003 19:53:23 jmonroe demo round 2 -// 1.0.0.0 08/01/2003 16:59:44 jmonroe push demo code changes -// 1.0.0.0 07/21/2003 16:09:23 jmonroe going gold -// 0.0.12.0 07/20/2003 19:04:44 jmonroe build 0.12 for qa -// 0.0.11.0 07/19/2003 15:30:08 jmonroe stuff -// 0.0.11.0 07/17/2003 17:08:09 jmonroe build 0.11 for qa -// 0.0.10.1 07/16/2003 17:33:28 mgummelt General Update With Latest Code -// 0.0.10.0 07/16/2003 10:28:51 jmonroe new product id, remove outcast.roq at end, menu ignoreescape, eax looping sounds support chan_less_atten -// 0.0.10.0 07/14/2003 19:04:42 jmonroe build 0.10 for qa -// 0.0.9.0 07/12/2003 13:05:57 jmonroe increase numsnapshot ents -// 0.0.9.0 07/11/2003 17:48:40 jmonroe buil 0.09 for qa -// 0.0.8.4 07/11/2003 15:47:55 jmonroe weatherzone caching -// 0.0.8.3 07/11/2003 12:05:44 mgummelt Lava & Acid fixes -// 0.0.8.2 07/10/2003 17:26:42 mgummelt General Update with today's bug fixes -// 0.0.8.1 07/09/2003 19:24:19 jmonroe eax voice stomp fix, increased weather zones, ... -// 0.0.8.0 07/08/2003 17:28:27 jmonroe build 0.08 for qa -// 0.0.7.2 07/07/2003 16:28:40 mgummelt Blaster Pistol alt-fire returns, Rancor spawnflags corrected -// 0.0.7.1 07/07/2003 10:48:29 jmonroe load menu fixes, darkside autoload fix,... -// 0.0.7.0 07/02/2003 19:31:37 jmonroe buil 7 for qa -// 0.0.6.5 07/02/2003 18:17:17 mgummelt Boss balancing -// 0.0.6.3 07/02/2003 01:34:48 jmonroe saber in moves menu -// 0.0.6.2 06/30/2003 15:33:37 mgummelt Force Sight change (designers readme) -// 0.0.6.1 06/29/2003 19:00:17 jmonroe vv merged, aev_soundchan -// 0.0.6.0 06/28/2003 16:38:27 jmonroe eax update, force sight on key dudes -// 0.0.6.0 06/26/2003 16:45:26 jmonroe qa build -// 0.0.5.6 06/25/2003 21:22:38 mgummelt "redcrosshair" field on misc_model_breakables and func_breakables -// 0.0.5.5 06/25/2003 18:31:52 mgummelt Force Visible on all applicable ents -// 0.0.5.4 06/25/2003 10:45:12 jmonroe EAX 4.0 -// 0.0.5.3 06/24/2003 22:59:31 mgummelt Reborn tweaks -// 0.0.5.2 06/24/2003 18:53:55 mgummelt New Reborn Master -// 0.0.5.1 06/23/2003 20:47:44 jmonroe fix NULL NPC usage -// 0.0.5.0 06/21/2003 13:04:27 jmonroe fix eweb crash -// 0.0.4.2 06/18/2003 14:24:35 jmonroe script cmd SET_WEAPON now precaches weapon, gil's optimized dlights -// 0.0.4.1 06/17/2003 19:04:28 mgummelt Various Force Power, saber move & Enemy Jedi tweaks -// 0.0.4.0 06/16/2003 19:41:54 jmonroe bug stuff -// 0.0.4.0 06/13/2003 23:52:36 jmonroe inc version to match qa beta -// 0.0.2.6 06/12/2003 13:11:21 creed new z-far cull -// 0.0.2.5 06/10/2003 17:02:17 creed targetJump & other navigation -// 0.0.2.4 06/10/2003 11:18:58 jmonroe footstep sounds in per material -// 0.0.2.3 06/10/2003 01:37:10 mgummelt helping with entity limit at spawntime -// 0.0.2.2 06/09/2003 14:10:32 scork fix for asian languages being bust by bad font -// 0.0.2.1 06/08/2003 17:57:11 mgummelt Area portal fix -// 0.0.2.0 06/08/2003 14:02:03 mgummelt Force sight change -// 0.0.2.0 06/08/2003 00:03:58 jmonroe CGEN_LIGHTING_DIFFUSE_ENTITY merges lightingdiffuse and entity color -// 0.0.1.25 06/05/2003 20:51:30 mgummelt Saber pull-attacks done -// 0.0.1.24 06/05/2003 18:11:06 mgummelt Both saber control schemes implemented -// 0.0.1.23 05/30/2003 17:12:34 mgummelt Fixed Noghri and Sand Creature -// 0.0.1.22 05/30/2003 12:15:37 mgummelt Saboteur change, new cultist -// 0.0.1.21 05/29/2003 16:02:48 creed Fixes For Assassin, ST AI changes -// 0.0.1.20 05/29/2003 12:00:18 mgummelt Navigation changes -// 0.0.1.19 05/29/2003 11:08:06 mgummelt various tweaks -// 0.0.1.18 05/28/2003 22:08:16 creed Boba Fett ++ -// 0.0.1.17 05/28/2003 20:38:33 mgummelt force grip and force sense changes -// 0.0.1.15 05/28/2003 17:07:26 mgummelt tweaks of force drain, protect and absorb -// 0.0.1.14 05/28/2003 14:48:57 mgummelt various saber & AI fixes -// 0.0.1.13 05/27/2003 17:26:30 areis Ported Glow stuff from MP (with support for nVidia and ATI cards). Added solid flag for roffs (in behaved) and made tie-bombers explode with effect. -// 0.0.1.12 05/27/2003 13:06:03 mgummelt Noghri stick weapon shoots a projectile, E-Web uses proper sounds -// 0.0.1.7 05/19/2003 15:00:10 mgummelt adding random jedi, elder prisoners, jedi master -// 0.0.1.6 05/19/2003 09:22:18 creed Weather Effects & Haz Trooper -// 0.0.1.5 05/16/2003 18:55:10 creed New Wind Spawn Flags For Dusty Fog & 1/2 way through Haz Trooper Fixins -// 0.0.1.4 05/15/2003 14:29:35 jmonroe misc_model_static stay around after a vid_start -// 0.0.1.3 05/14/2003 17:53:44 mgummelt testing misc_model_breakable scaling -// 0.0.1.2 05/13/2003 20:48:35 jmonroe vv post merge -// 0.0.1.1 05/13/2003 14:17:20 scork ste test comment -// END COMMENTS - -#endif // __AUTO_VERSION_HEADER diff --git a/codeJK2/win32/game.rc b/codeJK2/win32/game.rc index 408dea4f48..42449da65c 100644 --- a/codeJK2/win32/game.rc +++ b/codeJK2/win32/game.rc @@ -51,7 +51,7 @@ END // // Version // -#include "AutoVersion.h" +#include "../qcommon/game_version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_MAJOR_RELEASE,VERSION_MINOR_RELEASE,VERSION_EXTERNAL_BUILD,VERSION_INTERNAL_BUILD diff --git a/codemp/cgame/CMakeLists.txt b/codemp/cgame/CMakeLists.txt index 00348972a3..92cc7f2acc 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? diff --git a/codemp/client/cl_console.cpp b/codemp/client/cl_console.cpp index 68968dd941..8db76629be 100644 --- a/codemp/client/cl_console.cpp +++ b/codemp/client/cl_console.cpp @@ -28,6 +28,7 @@ along with this program; if not, see . #include "cl_cgameapi.h" #include "qcommon/stringed_ingame.h" #include "qcommon/game_version.h" +#include "qcommon/q_version.h" int g_console_field_width = 78; diff --git a/codemp/client/cl_main.cpp b/codemp/client/cl_main.cpp index dca664073a..22ca3953d1 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" @@ -925,7 +926,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 1c2d7b6311..46738663aa 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -36,7 +36,7 @@ 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 DEFAULT_SABER "Kyle" diff --git a/codemp/game/g_cvar.c b/codemp/game/g_cvar.c index e2c7600e0c..eaad719cbf 100644 --- a/codemp/game/g_cvar.c +++ b/codemp/game/g_cvar.c @@ -26,6 +26,7 @@ along with this program; if not, see . #include "bg_public.h" #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 34601bd45e..cc4031372d 100644 --- a/codemp/game/g_local.h +++ b/codemp/game/g_local.h @@ -43,9 +43,6 @@ extern vec3_t gPainPoint; //================================================================== -// the "gameversion" client command will print this plus compile date -#define GAMEVERSION "OpenJK" - #define SECURITY_LOG "security.log" #define BODY_QUEUE_SIZE 8 diff --git a/codemp/game/g_main.c b/codemp/game/g_main.c index a8d33959e1..d5fa551027 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, ... ); @@ -200,7 +200,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 df9ee8094a..8c9ecd9b1a 100644 --- a/codemp/game/g_xcvar.h +++ b/codemp/game/g_xcvar.h @@ -171,7 +171,7 @@ XCVAR_DEF( g_warmup, "20", NULL, CVAR_ARCHIVE, qtrue ) XCVAR_DEF( g_weaponDisable, "0", NULL, 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 69061d16de..e9f9f55e05 100644 --- 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) @@ -1154,7 +1153,6 @@ Com_Init ================= */ void Com_Init( char *commandLine ) { - char *s; int qport; Com_Printf( "%s %s %s\n", JK_VERSION, PLATFORM_STRING, SOURCE_DATE ); @@ -1274,8 +1272,7 @@ void Com_Init( char *commandLine ) { com_timestamps = Cvar_Get( "com_timestamps", "1", CVAR_ARCHIVE_ND, "Show timestamps in terminal and qconsole.log" ); - 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 a0988af0e3..4e4cc5cce2 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,13 +34,13 @@ 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)OpenJK-MP: v" VERSION_STRING_DOTTED + #define JK_VERSION "(debug)OpenJK-MP: " GIT_TAG #define JK_VERSION_OLD "(debug)JAmp: v" VERSION_STRING_DOTTED #else - #define JK_VERSION "OpenJK-MP: v" VERSION_STRING_DOTTED + #define JK_VERSION "OpenJK-MP: " 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 47c2deb879..9603b921e0 100644 --- 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" /* =============================================================================== diff --git a/codemp/ui/CMakeLists.txt b/codemp/ui/CMakeLists.txt index c4ecb7bdbd..79b8f35989 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? 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 4a8768130f..55d062588a 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 #include