mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Automate VERSION/SUBVERSION; move version related definitions to version.h
CMake support. Srb2win.rc still needs touchy, whatever.
This commit is contained in:
parent
2b63f1af4d
commit
d92afe87a0
4 changed files with 37 additions and 19 deletions
|
|
@ -1,8 +1,12 @@
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
|
file(STRINGS src/version.h SRB2_VERSION)
|
||||||
|
string(REGEX MATCH "[0-9]+\\.[0-9.]+" SRB2_VERSION ${SRB2_VERSION})
|
||||||
|
|
||||||
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
||||||
# Version change is fine.
|
# Version change is fine.
|
||||||
project(SRB2
|
project(SRB2
|
||||||
VERSION 2.2.6
|
VERSION ${SRB2_VERSION}
|
||||||
LANGUAGES C)
|
LANGUAGES C)
|
||||||
|
|
||||||
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR})
|
||||||
|
|
|
||||||
18
src/d_main.c
18
src/d_main.c
|
|
@ -1142,6 +1142,21 @@ static inline void D_Titlebar(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
D_ConvertVersionNumbers (void)
|
||||||
|
{
|
||||||
|
/* leave at defaults (0) under DEVELOP */
|
||||||
|
#ifndef DEVELOP
|
||||||
|
int major;
|
||||||
|
int minor;
|
||||||
|
|
||||||
|
sscanf(SRB2VERSION, "%d.%d.%d", &major, &minor, &SUBVERSION);
|
||||||
|
|
||||||
|
/* this is stupid */
|
||||||
|
VERSION = ( major * 100 ) + minor;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// D_SRB2Main
|
// D_SRB2Main
|
||||||
//
|
//
|
||||||
|
|
@ -1152,6 +1167,9 @@ void D_SRB2Main(void)
|
||||||
INT32 pstartmap = 1;
|
INT32 pstartmap = 1;
|
||||||
boolean autostart = false;
|
boolean autostart = false;
|
||||||
|
|
||||||
|
/* break the version string into version numbers, for netplay */
|
||||||
|
D_ConvertVersionNumbers();
|
||||||
|
|
||||||
// Print GPL notice for our console users (Linux)
|
// Print GPL notice for our console users (Linux)
|
||||||
CONS_Printf(
|
CONS_Printf(
|
||||||
"\n\nSonic Robo Blast 2\n"
|
"\n\nSonic Robo Blast 2\n"
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@
|
||||||
// warning C4213: nonstandard extension used : cast on l-value
|
// warning C4213: nonstandard extension used : cast on l-value
|
||||||
|
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
@ -135,17 +136,11 @@ extern char logfilename[1024];
|
||||||
|
|
||||||
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
#define VERSION 0 // Game version
|
|
||||||
#define SUBVERSION 0 // more precise version number
|
|
||||||
#define VERSIONSTRING "Development EXE"
|
#define VERSIONSTRING "Development EXE"
|
||||||
#define VERSIONSTRINGW L"Development EXE"
|
|
||||||
// most interface strings are ignored in development mode.
|
// most interface strings are ignored in development mode.
|
||||||
// we use comprevision and compbranch instead.
|
// we use comprevision and compbranch instead.
|
||||||
#else
|
#else
|
||||||
#define VERSION 202 // Game version
|
#define VERSIONSTRING "v"SRB2VERSION
|
||||||
#define SUBVERSION 6 // more precise version number
|
|
||||||
#define VERSIONSTRING "v2.2.6"
|
|
||||||
#define VERSIONSTRINGW L"v2.2.6"
|
|
||||||
// Hey! If you change this, add 1 to the MODVERSION below!
|
// Hey! If you change this, add 1 to the MODVERSION below!
|
||||||
// Otherwise we can't force updates!
|
// Otherwise we can't force updates!
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -204,17 +199,6 @@ extern char logfilename[1024];
|
||||||
// Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc.
|
// Will always resemble the versionstring, 205 = 2.0.5, 210 = 2.1, etc.
|
||||||
#define CODEBASE 220
|
#define CODEBASE 220
|
||||||
|
|
||||||
// The Modification ID; must be obtained from a Master Server Admin ( https://mb.srb2.org/showgroups.php ).
|
|
||||||
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
|
|
||||||
// "18" is the default mod ID for version 2.2
|
|
||||||
#define MODID 18
|
|
||||||
|
|
||||||
// The Modification Version, starting from 1. Do not follow your version string for this,
|
|
||||||
// it's only for detection of the version the player is using so the MS can alert them of an update.
|
|
||||||
// Only set it higher, not lower, obviously.
|
|
||||||
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
|
|
||||||
#define MODVERSION 47
|
|
||||||
|
|
||||||
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
|
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
|
||||||
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
|
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
|
||||||
// to an increment in MODVERSION. This might never happen in practice.
|
// to an increment in MODVERSION. This might never happen in practice.
|
||||||
|
|
|
||||||
12
src/version.h
Normal file
12
src/version.h
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#define SRB2VERSION "2.2.6"/* this must be the first line, for cmake !! */
|
||||||
|
|
||||||
|
// The Modification ID; must be obtained from a Master Server Admin ( https://mb.srb2.org/showgroups.php ).
|
||||||
|
// DO NOT try to set this otherwise, or your modification will be unplayable through the Master Server.
|
||||||
|
// "18" is the default mod ID for version 2.2
|
||||||
|
#define MODID 18
|
||||||
|
|
||||||
|
// The Modification Version, starting from 1. Do not follow your version string for this,
|
||||||
|
// it's only for detection of the version the player is using so the MS can alert them of an update.
|
||||||
|
// Only set it higher, not lower, obviously.
|
||||||
|
// Note that we use this to help keep internal testing in check; this is why v2.2.0 is not version "1".
|
||||||
|
#define MODVERSION 47
|
||||||
Loading…
Add table
Reference in a new issue