mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 07:41:47 +00:00
Change the VERSION number from float to string
Using a float number as version number is a bad idea. Correct this long standing problem by changing it to a string. If we ever want to compare version numbers, 2 integer constants "MAJOR_VERSION" and "MINOR_VERSION" should be added.
This commit is contained in:
parent
b52336850f
commit
3918d3ba34
8 changed files with 11 additions and 9 deletions
|
@ -624,7 +624,7 @@ Con_DrawConsole(float frac)
|
|||
SCR_AddDirtyPoint(0, 0);
|
||||
SCR_AddDirtyPoint(viddef.width - 1, lines - 1);
|
||||
|
||||
Com_sprintf(version, sizeof(version), "Yamagi Quake II v%4.2f", VERSION);
|
||||
Com_sprintf(version, sizeof(version), "Yamagi Quake II v%s", VERSION);
|
||||
|
||||
for (x = 0; x < 21; x++)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,9 @@
|
|||
#include "shared.h"
|
||||
#include "crc.h"
|
||||
|
||||
#define VERSION 4.90
|
||||
/* Should have 4 characters. */
|
||||
#define VERSION "4.90"
|
||||
|
||||
#define BASEDIRNAME "baseq2"
|
||||
|
||||
#if defined __linux__
|
||||
|
|
|
@ -241,7 +241,7 @@ Qcommon_Init(int argc, char **argv)
|
|||
dedicated = Cvar_Get("dedicated", "0", CVAR_NOSET);
|
||||
#endif
|
||||
|
||||
s = va("%4.2f %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
|
||||
s = va("%s %s %s %s", VERSION, CPUSTRING, __DATE__, BUILDSTRING);
|
||||
Cvar_Get("version", s, CVAR_SERVERINFO | CVAR_NOSET);
|
||||
|
||||
if (dedicated->value)
|
||||
|
|
|
@ -292,7 +292,7 @@ GLimp_InitGraphics(qboolean fullscreen)
|
|||
#endif
|
||||
|
||||
/* Window title */
|
||||
snprintf(title, sizeof(title), "Yamagi Quake II %4.2f", VERSION);
|
||||
snprintf(title, sizeof(title), "Yamagi Quake II %s", VERSION);
|
||||
SDL_WM_SetCaption(title, title);
|
||||
|
||||
/* No cursor */
|
||||
|
|
|
@ -172,7 +172,7 @@ SVC_DirectConnect(void)
|
|||
if (version != PROTOCOL_VERSION)
|
||||
{
|
||||
Netchan_OutOfBandPrint(NS_SERVER, adr,
|
||||
"print\nServer is version %4.2f.\n", VERSION);
|
||||
"print\nServer is version %s.\n", VERSION);
|
||||
Com_DPrintf(" rejected connect from version %i\n", version);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ main(int argc, char **argv)
|
|||
/* enforce C locale */
|
||||
setenv("LC_ALL", "C", 1);
|
||||
|
||||
printf("\nYamagi Quake II v%4.2f\n", VERSION);
|
||||
printf("\nYamagi Quake II v%s\n", VERSION);
|
||||
printf("=====================\n\n");
|
||||
|
||||
#ifndef DEDICATED_ONLY
|
||||
|
|
|
@ -47,7 +47,7 @@ printBacktrace(int sig)
|
|||
strings = backtrace_symbols(array, size);
|
||||
|
||||
printf("Product: Yamagi Quake II\n");
|
||||
printf("Version: %4.2f\n", VERSION);
|
||||
printf("Version: %s\n", VERSION);
|
||||
printf("Plattform: %s\n", BUILDSTRING);
|
||||
printf("Architecture: %s\n", CPUSTRING);
|
||||
printf("Compiler: %s\n", __VERSION__);
|
||||
|
@ -68,7 +68,7 @@ void
|
|||
printBacktrace(int sig)
|
||||
{
|
||||
printf("Product: Yamagi Quake II\n");
|
||||
printf("Version: %4.2f\n", VERSION);
|
||||
printf("Version: %s\n", VERSION);
|
||||
printf("Plattform: %s\n", BUILDSTRING);
|
||||
printf("Architecture: %s\n", CPUSTRING);
|
||||
printf("Compiler: %s\n", __VERSION__);
|
||||
|
|
|
@ -711,7 +711,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
|||
Sys_RedirectStdout();
|
||||
#endif
|
||||
|
||||
printf("Yamagi Quake II v%4.2f\n", VERSION);
|
||||
printf("Yamagi Quake II v%s\n", VERSION);
|
||||
printf("=====================\n\n");
|
||||
|
||||
#ifndef DEDICATED_ONLY
|
||||
|
|
Loading…
Reference in a new issue