From 70ce88b345e2575cae2b5580a4dcfaf7315938ba Mon Sep 17 00:00:00 2001 From: molivier Date: Mon, 10 Mar 2003 07:05:45 +0000 Subject: [PATCH] Fixed a MSVC6 warning in matrixlib. Added a "Public server" yes/no line in the server creation menu. Removed a duplicated cvar declaration in "net.h". git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2821 d7cf8633-e32d-0410-b094-e92efae38249 --- matrixlib.c | 2 +- menu.c | 25 +++++++++++++++++-------- net.h | 2 -- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/matrixlib.c b/matrixlib.c index 4fa58d79..e983e782 100644 --- a/matrixlib.c +++ b/matrixlib.c @@ -431,6 +431,6 @@ void Matrix4x4_OriginFromMatrix (const matrix4x4_t *in, float *out) float Matrix4x4_ScaleFromMatrix (const matrix4x4_t *in) { // we only support uniform scaling, so assume the first row is enough - return sqrt(in->m[0][0] * in->m[0][0] + in->m[0][1] * in->m[0][1] + in->m[0][2] * in->m[0][2]); + return (float)sqrt(in->m[0][0] * in->m[0][0] + in->m[0][1] * in->m[0][1] + in->m[0][2] * in->m[0][2]); } diff --git a/menu.c b/menu.c index bcc5117e..f9407669 100644 --- a/menu.c +++ b/menu.c @@ -3023,6 +3023,8 @@ int maxplayers; qboolean m_serverInfoMessage = false; double m_serverInfoMessageTime; +extern cvar_t sv_public; + void M_Menu_GameOptions_f (void) { key_dest = key_menu; @@ -3035,8 +3037,8 @@ void M_Menu_GameOptions_f (void) } -int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 112, 120}; -#define NUM_GAMEOPTIONS 9 +int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 104, 120, 128}; +#define NUM_GAMEOPTIONS 10 int gameoptions_cursor; void M_GameOptions_Draw (void) @@ -3139,14 +3141,17 @@ void M_GameOptions_Draw (void) else M_Print (160, 96, va("%i minutes", timelimit.integer)); + M_Print (0, 104, " Public server"); + M_Print (160, 104, (sv_public.integer == 0) ? "no" : "yes"); + g = lookupgameinfo(); - M_Print (0, 112, " Episode"); - M_Print (160, 112, g->episodes[startepisode].description); + M_Print (0, 120, " Episode"); + M_Print (160, 120, g->episodes[startepisode].description); - M_Print (0, 120, " Level"); - M_Print (160, 120, g->levels[g->episodes[startepisode].firstLevel + startlevel].description); - M_Print (160, 128, g->levels[g->episodes[startepisode].firstLevel + startlevel].name); + M_Print (0, 128, " Level"); + M_Print (160, 128, g->levels[g->episodes[startepisode].firstLevel + startlevel].description); + M_Print (160, 136, g->levels[g->episodes[startepisode].firstLevel + startlevel].name); // line cursor M_DrawCharacter (144, gameoptions_cursor_table[gameoptions_cursor], 12+((int)(realtime*4)&1)); @@ -3251,6 +3256,10 @@ void M_NetStart_Change (int dir) break; case 7: + Cvar_SetValueQuick (&sv_public, !sv_public.integer); + break; + + case 8: startepisode += dir; g = lookupgameinfo(); @@ -3263,7 +3272,7 @@ void M_NetStart_Change (int dir) startlevel = 0; break; - case 8: + case 9: startlevel += dir; g = lookupgameinfo(); diff --git a/net.h b/net.h index 8323b205..5a1d7fd4 100644 --- a/net.h +++ b/net.h @@ -333,8 +333,6 @@ extern qboolean slistInProgress; extern qboolean slistSilent; extern qboolean slistLocal; -extern cvar_t hostname; - void NET_Slist_f (void); void NET_InetSlist_f (void); -- 2.39.2