From: Nikoli Date: Wed, 7 Aug 2013 16:12:12 +0000 (+0400) Subject: cl_available is pointless, remove unused code from vid_null.c X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73ebd17710bdf8a2dae88800131183e66061a2f9;p=xonotic%2Fdarkplaces.git cl_available is pointless, remove unused code from vid_null.c --- diff --git a/host.c b/host.c index 02f6edf3..55eb88ba 100644 --- a/host.c +++ b/host.c @@ -186,9 +186,11 @@ static void Host_ServerOptions (void) // COMMANDLINEOPTION: Server: -listen [playerlimit] starts a multiplayer server with graphical client, like singleplayer but other players can connect, default playerlimit is 8 // if no client is in the executable or -dedicated is specified on // commandline, start a dedicated server +#ifdef CONFIG_CLIENT i = COM_CheckParm ("-dedicated"); - if (i || !cl_available) + if (i) { +#endif cls.state = ca_dedicated; // check for -dedicated specifying how many players if (i && i + 1 < com_argc && atoi (com_argv[i+1]) >= 1) @@ -197,8 +199,9 @@ static void Host_ServerOptions (void) Con_Printf ("Only one of -dedicated or -listen can be specified\n"); // default sv_public on for dedicated servers (often hosted by serious administrators), off for listen servers (often hosted by clueless users) Cvar_SetValue("sv_public", 1); +#ifdef CONFIG_CLIENT } - else if (cl_available) + else { // client exists and not dedicated, check if -listen is specified cls.state = ca_disconnected; @@ -216,6 +219,7 @@ static void Host_ServerOptions (void) svs.maxclients = 1; } } +#endif svs.maxclients = svs.maxclients_next = bound(1, svs.maxclients, MAX_SCOREBOARD); diff --git a/vid.h b/vid.h index 650d3223..37d361df 100644 --- a/vid.h +++ b/vid.h @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define ENGINE_ICON ( (gamemode == GAME_NEXUIZ) ? nexuiz_xpm : darkplaces_xpm ) -extern int cl_available; - #define MAX_TEXTUREUNITS 16 typedef enum renderpath_e diff --git a/vid_agl.c b/vid_agl.c index 87559d36..859d070d 100644 --- a/vid_agl.c +++ b/vid_agl.c @@ -36,9 +36,6 @@ #define kCGLCEMPEngine 313 #endif -// Tell startup code that we have a client -int cl_available = true; - qboolean vid_supportrefreshrate = true; // AGL prototypes diff --git a/vid_glx.c b/vid_glx.c index c066555c..fb63311c 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -55,9 +55,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "nexuiz.xpm" #include "darkplaces.xpm" -// Tell startup code that we have a client -int cl_available = true; - // note: if we used the XRandR extension we could support refresh rates qboolean vid_supportrefreshrate = false; diff --git a/vid_null.c b/vid_null.c index 16631589..bb07e110 100644 --- a/vid_null.c +++ b/vid_null.c @@ -19,38 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" -#include - -int cl_available = false; - -qboolean vid_supportrefreshrate = false; - void VID_Shutdown(void) { } -static void signal_handler(int sig) -{ - Con_Printf("Received signal %d, exiting...\n", sig); - Sys_Quit(1); -} - -static void InitSig(void) -{ -#ifndef WIN32 - signal(SIGHUP, signal_handler); - signal(SIGINT, signal_handler); - signal(SIGQUIT, signal_handler); - signal(SIGILL, signal_handler); - signal(SIGTRAP, signal_handler); - signal(SIGIOT, signal_handler); - signal(SIGBUS, signal_handler); - signal(SIGFPE, signal_handler); - signal(SIGSEGV, signal_handler); - signal(SIGTERM, signal_handler); -#endif -} - void VID_SetMouse (qboolean fullscreengrab, qboolean relative, qboolean hidecursor) { } @@ -69,11 +41,6 @@ int VID_GetGamma(unsigned short *ramps, int rampsize) return FALSE; } -void VID_Init(void) -{ - InitSig(); // trap evil signals -} - qboolean VID_InitMode(viddef_mode_t *mode) { return false; @@ -95,8 +62,3 @@ void VID_BuildJoyState(vid_joystate_t *joystate) void IN_Move(void) { } - -size_t VID_ListModes(vid_mode_t *modes, size_t maxcount) -{ - return 0; -} diff --git a/vid_sdl.c b/vid_sdl.c index 3211eaa1..2b0dca97 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -60,9 +60,6 @@ io_connect_t IN_GetIOHandle(void) #define SDL_R_RESTART #endif -// Tell startup code that we have a client -int cl_available = true; - qboolean vid_supportrefreshrate = false; static qboolean vid_usingmouse = false; diff --git a/vid_wgl.c b/vid_wgl.c index f4279570..a0303c44 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -75,9 +75,6 @@ static HINSTANCE gldll; #define WM_MOUSEWHEEL 0x020A #endif -// Tell startup code that we have a client -int cl_available = true; - qboolean vid_supportrefreshrate = true; static int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *);