From 3bbba8adcedd462b405e89afc16d36b7b44810c9 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Mon, 25 Nov 2019 01:55:47 -0500 Subject: [PATCH] replace version numbers with strings --- source/console.c | 6 +++--- source/gl_vidsdl.c | 2 +- source/host.c | 4 ++-- source/host_cmd.c | 30 +++++++++++++++--------------- source/main_sdl.c | 6 +++--- source/menu.c | 8 ++++---- source/quakedef.h | 17 +++-------------- source/sv_main.c | 12 ++++++------ 8 files changed, 37 insertions(+), 48 deletions(-) diff --git a/source/console.c b/source/console.c index 5884704..cd4b76f 100644 --- a/source/console.c +++ b/source/console.c @@ -522,7 +522,7 @@ void Con_Printf (const char *fmt, ...) /* ================ Con_DWarning -- ericw - + same as Con_Warning, but only prints if "developer" cvar is set. use for "exceeds standard limit of" messages, which are only relevant for developers targetting vanilla engines @@ -951,7 +951,7 @@ void Con_TabComplete (void) // for (like "map ") and a list of all the maps. arg_completion_type_t arg_completion = arg_completion_types[j]; const char *command_name = arg_completion.command; - + if (!strncmp (key_lines[edit_line] + 1, command_name, strlen(command_name))) { int nummatches = 0; @@ -1227,7 +1227,7 @@ void Con_DrawConsole (int lines, qboolean drawinput) //draw version number in bottom right y += 8; - q_snprintf (ver, sizeof(ver), "QuakeSpasm " QUAKESPASM_VER_STRING); + q_snprintf (ver, sizeof(ver), "QuakeSpasm " QUAKESPASM_VERSION); for (x = 0; x < (int)strlen(ver); x++) Draw_Character ((con_linewidth - strlen(ver) + x + 2)<<3, y, ver[x] /*+ 128*/); } diff --git a/source/gl_vidsdl.c b/source/gl_vidsdl.c index 34b67d8..3413f8b 100644 --- a/source/gl_vidsdl.c +++ b/source/gl_vidsdl.c @@ -505,7 +505,7 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, fsaa > 0 ? 1 : 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa); - q_snprintf(caption, sizeof(caption), "QuakeSpasm " QUAKESPASM_VER_STRING); + q_snprintf(caption, sizeof(caption), "QuakeSpasm " QUAKESPASM_VERSION); /* Create the window if needed, hidden */ if (!draw_context) diff --git a/source/host.c b/source/host.c index 8ebbe19..04da0c3 100644 --- a/source/host.c +++ b/source/host.c @@ -230,8 +230,8 @@ void Host_FindMaxClients (void) void Host_Version_f (void) { - Con_Printf ("Quake Version %1.2f\n", VERSION); - Con_Printf ("QuakeSpasm Version " QUAKESPASM_VER_STRING "\n"); + Con_Printf ("Quake Version %s\n", VERSION); + Con_Printf ("QuakeSpasm Version " QUAKESPASM_VERSION "\n"); Con_Printf ("Exe: " __TIME__ " " __DATE__ "\n"); } diff --git a/source/host_cmd.c b/source/host_cmd.c index 70cc0d8..c0aaad3 100644 --- a/source/host_cmd.c +++ b/source/host_cmd.c @@ -98,7 +98,7 @@ void FileList_Add (const char *name, filelist_item_t **list) static void FileList_Clear (filelist_item_t **list) { filelist_item_t *blah; - + while (*list) { blah = (*list)->next; @@ -316,11 +316,11 @@ void DemoList_Init (void) searchpath_t *search; pack_t *pak; int i; - + // we don't want to list the demos in id1 pakfiles, // because these are not "add-on" demos q_snprintf (ignorepakdir, sizeof(ignorepakdir), "/%s/", GAMENAME); - + for (search = com_searchpaths; search; search = search->next) { if (*search->filename) //directory @@ -442,7 +442,7 @@ void Host_Status_f (void) print_fn = SV_ClientPrintf; print_fn ("host: %s\n", Cvar_VariableString ("hostname")); - print_fn ("version: %4.2f\n", VERSION); + print_fn ("version: " VERSION "\n"); if (tcpipAvailable) print_fn ("tcp/ip: %s\n", my_tcpip_address); if (ipxAvailable) @@ -631,10 +631,10 @@ void Host_SetPos_f(void) Cmd_ForwardToServer (); return; } - + if (pr_global_struct->deathmatch) return; - + if (Cmd_Argc() != 7 && Cmd_Argc() != 4) { SV_ClientPrintf("usage:\n"); @@ -650,23 +650,23 @@ void Host_SetPos_f(void) (int)sv_player->v.v_angle[2]); return; } - + if (sv_player->v.movetype != MOVETYPE_NOCLIP) { noclip_anglehack = true; sv_player->v.movetype = MOVETYPE_NOCLIP; SV_ClientPrintf ("noclip ON\n"); } - + //make sure they're not going to whizz away from it sv_player->v.velocity[0] = 0; sv_player->v.velocity[1] = 0; sv_player->v.velocity[2] = 0; - + sv_player->v.origin[0] = atof(Cmd_Argv(1)); sv_player->v.origin[1] = atof(Cmd_Argv(2)); sv_player->v.origin[2] = atof(Cmd_Argv(3)); - + if (Cmd_Argc() == 7) { sv_player->v.angles[0] = atof(Cmd_Argv(4)); @@ -674,7 +674,7 @@ void Host_SetPos_f(void) sv_player->v.angles[2] = atof(Cmd_Argv(6)); sv_player->v.fixangle = 1; } - + SV_LinkEdict (sv_player, false); } @@ -1120,7 +1120,7 @@ Host_Loadgame_f void Host_Loadgame_f (void) { static char *start; - + char name[MAX_OSPATH]; char mapname[MAX_QPATH]; float time, tfloat; @@ -1139,7 +1139,7 @@ void Host_Loadgame_f (void) Con_Printf ("load : load a game\n"); return; } - + if (strstr(Cmd_Argv(1), "..")) { Con_Printf ("Relative pathnames are not allowed.\n"); @@ -1156,11 +1156,11 @@ void Host_Loadgame_f (void) // SCR_BeginLoadingPlaque (); Con_Printf ("Loading game from %s...\n", name); - + // avoid leaking if the previous Host_Loadgame_f failed with a Host_Error if (start != NULL) free (start); - + start = (char *) COM_LoadMallocFile_TextMode_OSPath(name, NULL); if (start == NULL) { diff --git a/source/main_sdl.c b/source/main_sdl.c index b6a53d8..326c6db 100644 --- a/source/main_sdl.c +++ b/source/main_sdl.c @@ -105,10 +105,10 @@ int main(int argc, char *argv[]) if (!parms.membase) Sys_Error ("Not enough memory free; check disk space\n"); - Sys_Printf("Quake %1.2f (c) id Software\n", VERSION); - Sys_Printf("FitzQuake %1.2f (c) John Fitzgibbons\n", FITZQUAKE_VERSION); + Sys_Printf("Quake " VERSION " (c) id Software\n"); + Sys_Printf("FitzQuake " FITZQUAKE_VERSION " (c) John Fitzgibbons\n"); Sys_Printf("FitzQuake SDL port (c) SleepwalkR, Baker\n"); - Sys_Printf("QuakeSpasm " QUAKESPASM_VER_STRING " (c) Ozkan Sezer, Eric Wasylishen & others\n"); + Sys_Printf("QuakeSpasm " QUAKESPASM_VERSION " (c) Ozkan Sezer, Eric Wasylishen & others\n"); Sys_Printf("Host_Init\n"); Host_Init(); diff --git a/source/menu.c b/source/menu.c index 0a76fc5..b33beaf 100644 --- a/source/menu.c +++ b/source/menu.c @@ -1089,9 +1089,9 @@ void M_AdjustSliders (int dir) curr_alwaysrun = ALWAYSRUN_VANILLA; else curr_alwaysrun = ALWAYSRUN_OFF; - + target_alwaysrun = (ALWAYSRUN_ITEMS + curr_alwaysrun + dir) % ALWAYSRUN_ITEMS; - + if (target_alwaysrun == ALWAYSRUN_VANILLA) { Cvar_SetValue ("cl_alwaysrun", 0); @@ -1200,7 +1200,7 @@ void M_Options_Draw (void) M_Print (16, 32 + 8*OPT_CONTRAST, " Contrast"); r = vid_contrast.value - 1.0; M_DrawSlider (220, 32 + 8*OPT_CONTRAST, r); - + // OPT_MOUSESPEED: M_Print (16, 32 + 8*OPT_MOUSESPEED, " Mouse Speed"); r = (sensitivity.value - 1)/10; @@ -1696,7 +1696,7 @@ void M_Quit_Draw (void) //johnfitz -- modified for new quit message m_state = m_quit; } - sprintf(msg1, "QuakeSpasm " QUAKESPASM_VER_STRING); + sprintf(msg1, "QuakeSpasm " QUAKESPASM_VERSION); //okay, this is kind of fucked up. M_DrawTextBox will always act as if //width is even. Also, the width and lines values are for the interior of the box, diff --git a/source/quakedef.h b/source/quakedef.h index bb3ec39..fdeb60b 100644 --- a/source/quakedef.h +++ b/source/quakedef.h @@ -26,20 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // quakedef.h -- primary header for client -#define VERSION 1.09 - -#define FITZQUAKE_VERSION 0.85 //johnfitz -#define QUAKESPASM_VERSION 0.93 -#define QUAKESPASM_VER_PATCH 1 // helper to print a string like 0.93.1 -#ifndef QUAKESPASM_VER_SUFFIX -#define QUAKESPASM_VER_SUFFIX // optional version suffix string literal like "-beta1" -#endif - -#define QS_STRINGIFY_(x) #x -#define QS_STRINGIFY(x) QS_STRINGIFY_(x) - -// combined version string like "0.92.1-beta1" -#define QUAKESPASM_VER_STRING QS_STRINGIFY(QUAKESPASM_VERSION) "." QS_STRINGIFY(QUAKESPASM_VER_PATCH) QUAKESPASM_VER_SUFFIX +#define VERSION "1.09" +#define FITZQUAKE_VERSION "0.85" //johnfitz +#define QUAKESPASM_VERSION "0.93.1" //define PARANOID // speed sapping error checking diff --git a/source/sv_main.c b/source/sv_main.c index 91deeac..1b4d7ef 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -289,18 +289,18 @@ void SV_SendServerinfo (client_t *client) int i; //johnfitz MSG_WriteByte (&client->message, svc_print); - sprintf (message, "%c\nFITZQUAKE %1.2f SERVER (%i CRC)\n", 2, FITZQUAKE_VERSION, pr_crc); //johnfitz -- include fitzquake version + sprintf (message, "%c\nFITZQUAKE " FITZQUAKE_VERSION " SERVER (%i CRC)\n", 2, pr_crc); //johnfitz -- include fitzquake version MSG_WriteString (&client->message,message); MSG_WriteByte (&client->message, svc_serverinfo); MSG_WriteLong (&client->message, sv.protocol); //johnfitz -- sv.protocol instead of PROTOCOL_VERSION - + if (sv.protocol == PROTOCOL_RMQ) { // mh - now send protocol flags so that the client knows the protocol features to expect MSG_WriteLong (&client->message, sv.protocolflags); } - + MSG_WriteByte (&client->message, svs.maxclients); if (!coop.value && deathmatch.value) @@ -517,7 +517,7 @@ byte *SV_FatPVS (vec3_t org, qmodel_t *worldmodel) //johnfitz -- added worldmode if (!fatpvs) Sys_Error ("SV_FatPVS: realloc() failed on %d bytes", fatpvs_capacity); } - + Q_memset (fatpvs, 0, fatbytes); SV_AddToFatPVS (org, worldmodel->nodes, worldmodel); //johnfitz -- worldmodel as a parameter return fatpvs; @@ -586,7 +586,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg) for (i=0 ; i < ent->num_leafs ; i++) if (pvs[ent->leafnums[i] >> 3] & (1 << (ent->leafnums[i]&7) )) break; - + // ericw -- added ent->num_leafs < MAX_ENT_LEAFS condition. // // if ent->num_leafs == MAX_ENT_LEAFS, the ent is visible from too many leafs @@ -1365,7 +1365,7 @@ void SV_SpawnServer (const char *server) q_strlcpy (sv.name, server, sizeof(sv.name)); sv.protocol = sv_protocol; // johnfitz - + if (sv.protocol == PROTOCOL_RMQ) { // set up the protocol flags used by this server