Change version to 5.33pre, changes for arbitrary length version strings

Con_DrawConsole() assumed that the version string was always 21chars
long, we changed it to allow longer strings with other lenghts.
In Unix main() we changed the code for underlining
"Yamagi Quake II $version" with === so the underlining is as long
as the underlined string.
This commit is contained in:
Daniel Gibson 2015-11-01 17:15:10 +01:00
parent 92d48735f5
commit 12604bebe9
3 changed files with 18 additions and 6 deletions

View file

@ -38,6 +38,8 @@ int
main(int argc, char **argv)
{
int time, oldtime, newtime;
int verLen, i;
const char* versionString;
/* register signal handler */
registerHandler();
@ -59,7 +61,7 @@ main(int argc, char **argv)
{
printf("The effective UID is not the real UID! Your binary is probably marked\n");
printf("'setuid'. That is not good idea, please fix it :) If you really know\n");
printf("what you're doin edit src/unix/main.c and remove this check. Don't\n");
printf("what you're doing edit src/unix/main.c and remove this check. Don't\n");
printf("complain if Quake II eats your dog afterwards!\n");
return 1;
@ -68,8 +70,15 @@ main(int argc, char **argv)
/* enforce C locale */
setenv("LC_ALL", "C", 1);
printf("\nYamagi Quake II v%s\n", YQ2VERSION);
printf("=====================\n\n");
versionString = va("Yamagi Quake II v%s", YQ2VERSION);
verLen = strlen(versionString);
printf("\n%s\n", versionString);
for(i=0; i<verLen; ++i)
{
putc('=', stdout);
}
puts("\n");
#ifndef DEDICATED_ONLY
printf("Client build options:\n");

View file

@ -610,6 +610,7 @@ Con_DrawConsole(float frac)
{
int i, j, x, y, n;
int rows;
int verLen;
char *text;
int row;
int lines;
@ -643,9 +644,11 @@ Con_DrawConsole(float frac)
Com_sprintf(version, sizeof(version), "Yamagi Quake II v%s", YQ2VERSION);
for (x = 0; x < 21; x++)
verLen = strlen(version);
for (x = 0; x < verLen; x++)
{
Draw_CharScaled(viddef.width - (173 * scale) + x * 8 * scale, lines - 35 * scale, 128 + version[x], scale);
Draw_CharScaled(viddef.width - ((verLen*8+5) * scale) + x * 8 * scale, lines - 35 * scale, 128 + version[x], scale);
}
t = time(NULL);

View file

@ -33,7 +33,7 @@
#include "crc.h"
/* Should have 4 characters. */
#define YQ2VERSION "5.32"
#define YQ2VERSION "5.33pre"
#define BASEDIRNAME "baseq2"