From 95e8238ac7bd49287e1cca92341bd2520e01e8e2 Mon Sep 17 00:00:00 2001 From: molivier Date: Fri, 4 Oct 2002 06:05:46 +0000 Subject: [PATCH] Added a couple more "const". Fixed "+map" in the command line for dedicated servers. Updated LordHavoc email address in the multiplayer menu. Removed some duplicated code. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2494 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 2 +- cl_screen.h | 2 +- host_cmd.c | 2 +- menu.c | 44 +++++++++----------------------------------- net_main.c | 39 +++++++++++++++++++-------------------- 5 files changed, 31 insertions(+), 58 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 741f4484..5abb2196 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -506,7 +506,7 @@ void DrawQ_Pic(float x, float y, char *picname, float width, float height, float r_refdef.drawqueuesize += dq->size; } -void DrawQ_String(float x, float y, char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags) +void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags) { int size, len; drawqueue_t *dq; diff --git a/cl_screen.h b/cl_screen.h index 37b15ad3..9a4859b5 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -39,7 +39,7 @@ void DrawQ_Clear(void); // draw an image void DrawQ_Pic(float x, float y, char *picname, float width, float height, float red, float green, float blue, float alpha, int flags); // draw a text string -void DrawQ_String(float x, float y, char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags); +void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags); // draw a filled rectangle void DrawQ_Fill (float x, float y, float w, float h, float red, float green, float blue, float alpha, int flags); // draw a triangle mesh diff --git a/host_cmd.c b/host_cmd.c index 423ba2ff..0a3f978d 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -1532,7 +1532,7 @@ void Host_Startdemos_f (void) if (cls.state == ca_dedicated) { - if (!sv.active) + if (!sv.active && !sv_spawnmap[0]) Cbuf_AddText ("map start\n"); return; } diff --git a/menu.c b/menu.c index c729750b..9b6375ed 100644 --- a/menu.c +++ b/menu.c @@ -178,7 +178,7 @@ void M_Print (float cx, float cy, char *str) DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0); } -void M_PrintWhite (float cx, float cy, char *str) +void M_PrintWhite (float cx, float cy, const char *str) { DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0); } @@ -2772,7 +2772,7 @@ void M_GameOptions_Draw (void) M_Print (x, 146, " More than 64 players?? "); M_Print (x, 154, " First, question your "); M_Print (x, 162, " sanity, then email "); - M_Print (x, 170, " havoc@gamevisions.com "); + M_Print (x, 170, " havoc@inside3d.com "); } else { @@ -2965,6 +2965,7 @@ void M_Menu_Search_f (void) void M_Search_Draw (void) { + const char* string; cachepic_t *p; int x; @@ -2992,7 +2993,11 @@ void M_Search_Draw (void) return; } - M_PrintWhite ((320/2) - ((22*8)/2), 64, "No Quake servers found"); + if (gamemode == GAME_TRANSFUSION) + string = "No Transfusion servers found"; + else + string = "No Quake servers found"; + M_PrintWhite ((320/2) - ((22*8)/2), 64, string); if ((realtime - searchCompleteTime) < 3.0) return; @@ -3022,38 +3027,7 @@ void M_Menu_InetSearch_f (void) void M_InetSearch_Draw (void) { - cachepic_t *p; - int x; - - p = Draw_CachePic ("gfx/p_multi.lmp"); - M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp"); - x = (320/2) - ((12*8)/2) + 4; - M_DrawTextBox (x-8, 32, 12, 1); - M_Print (x, 40, "Searching..."); - - if(slistInProgress) - { - NET_Poll(); - return; - } - - if (! searchComplete) - { - searchComplete = true; - searchCompleteTime = realtime; - } - - if (hostCacheCount) - { - M_Menu_ServerList_f (); - return; - } - - M_PrintWhite ((320/2) - ((22*8)/2), 64, "No Quake servers found"); - if ((realtime - searchCompleteTime) < 3.0) - return; - - M_Menu_LanConfig_f (); + M_Search_Draw (); // it's the same one, so why bother? } diff --git a/net_main.c b/net_main.c index 39340373..0697022f 100644 --- a/net_main.c +++ b/net_main.c @@ -260,49 +260,48 @@ static void PrintSlistTrailer(void) if (hostCacheCount) Con_Printf("== end list ==\n\n"); else - Con_Printf("No Quake servers found.\n\n"); + { + if (gamemode == GAME_TRANSFUSION) + Con_Printf("No Transfusion servers found.\n\n"); + else + Con_Printf("No Quake servers found.\n\n"); + } } -void NET_Slist_f (void) +void NET_SlistCommon (PollProcedure *sendProcedure, PollProcedure *pollProcedure) { if (slistInProgress) return; if (! slistSilent) { - Con_Printf("Looking for Quake servers...\n"); + if (gamemode == GAME_TRANSFUSION) + Con_Printf("Looking for Transfusion servers...\n"); + else + Con_Printf("Looking for Quake servers...\n"); PrintSlistHeader(); } slistInProgress = true; slistStartTime = Sys_DoubleTime(); - SchedulePollProcedure(&slistSendProcedure, 0.0); - SchedulePollProcedure(&slistPollProcedure, 0.1); + SchedulePollProcedure(sendProcedure, 0.0); + SchedulePollProcedure(pollProcedure, 0.1); hostCacheCount = 0; } -void NET_InetSlist_f (void) +void NET_Slist_f (void) { - if (slistInProgress) - return; - - if (! slistSilent) - { - Con_Printf("Looking for Quake servers...\n"); - PrintSlistHeader(); - } - - slistInProgress = true; - slistStartTime = Sys_DoubleTime(); + NET_SlistCommon (&slistSendProcedure, &slistPollProcedure); +} - SchedulePollProcedure(&inetSlistSendProcedure, 0.0); - SchedulePollProcedure(&inetSlistPollProcedure, 0.1); - hostCacheCount = 0; +void NET_InetSlist_f (void) +{ + NET_SlistCommon (&inetSlistSendProcedure, &inetSlistPollProcedure); } -- 2.39.2