本文整理汇总了C++中COM_CheckParm函数的典型用法代码示例。如果您正苦于以下问题:C++ COM_CheckParm函数的具体用法?C++ COM_CheckParm怎么用?C++ COM_CheckParm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了COM_CheckParm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: R_InitParticles
/*
===============
R_InitParticles
===============
*/
void R_InitParticles (void)
{
int i;
i = COM_CheckParm ("-particles");
if (i)
{
r_numparticles = (int)(Q_atoi(com_argv[i+1]));
if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
r_numparticles = ABSOLUTE_MIN_PARTICLES;
}
else
{
r_numparticles = MAX_PARTICLES;
}
particles = (particle_t *)
Hunk_AllocName (r_numparticles * sizeof(particle_t), "particles");
}
示例2: Sys_InitFloatTime
/*
================
Sys_InitFloatTime
================
*/
void Sys_InitFloatTime(void)
{
int j;
Sys_FloatTime();
oldtime = curtime;
j = COM_CheckParm("-starttime");
if (j)
{
curtime = (double)(Q_atof(com_argv[j+1]));
}
else
{
curtime = 0.0;
}
lastcurtime = curtime;
}
示例3: InitHWGamma
void InitHWGamma (void)
{
#ifdef USE_VMODE
int xf86vm_gammaramp_size;
if (COM_CheckParm("-nohwgamma"))
return;
XF86VidModeGetGammaRampSize(x_disp, scrnum, &xf86vm_gammaramp_size);
vid_gammaworks = (xf86vm_gammaramp_size == 256);
if (vid_gammaworks)
{
XF86VidModeGetGammaRamp(x_disp,scrnum,xf86vm_gammaramp_size,
systemgammaramp[0], systemgammaramp[1], systemgammaramp[2]);
}
vid_hwgamma_enabled = vid_hwgammacontrol.value && vid_gammaworks; // && fullscreen?
#endif
}
示例4: R_InitParticles
/*
===============
R_InitParticles
===============
*/
void R_InitParticles (void)
{
int i;
FILE *f;
i = COM_CheckParm ("-particles");
MyTable[0] = 254;
if (i)
{
r_numparticles = (int)(atoi(com_argv[i+1]));
if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
r_numparticles = ABSOLUTE_MIN_PARTICLES;
}
else
{
r_numparticles = MAX_PARTICLES;
}
particles = (particle_t *)
Hunk_AllocName (r_numparticles * sizeof(particle_t), "particles");
Cvar_RegisterVariable (&leak_color);
//JFM: snow test
Cvar_RegisterVariable (&snow_flurry);
Cvar_RegisterVariable (&snow_active);
transTable = (byte *)malloc(65536);
if (!transTable)
Sys_Error ("Couldn't load gfx/tinttab.lmp");
COM_FOpenFile ("gfx/tinttab.lmp", &f, false);
if (f)
{
fread(transTable,1,65536,f);
fclose(f);
}
}
示例5: CFG_ReadCvarOverrides
/*
===================
CFG_ReadCvarOverrides
convenience function, reading the "+" command line override
values of cvars in the given list. doesn't do anything with
the config file.
===================
*/
void CFG_ReadCvarOverrides (const char **vars, int num_vars)
{
char buff[64];
int i, j;
if (num_vars < 1)
return;
buff[0] = '+';
for (i = 0; i < num_vars; i++)
{
q_strlcpy (&buff[1], vars[i], sizeof(buff) - 1);
j = COM_CheckParm(buff);
if (j != 0 && j < com_argc - 1)
{
if (com_argv[j + 1][0] != '-' && com_argv[j + 1][0] != '+')
Cvar_Set(vars[i], com_argv[j + 1]);
}
}
}
示例6: IN_Init
void
IN_Init(void)
{
#ifdef USE_XF86DGA
int MajorVersion, MinorVersion;
#endif
keyboard_grab_active = false;
mouse_grab_active = false;
// FIXME - do proper detection?
// - Also, look at other vid_*.c files for clues
mouse_available = (COM_CheckParm("-nomouse")) ? false : true;
if (x_disp == NULL)
Sys_Error("x_disp not initialised before input...");
#ifdef USE_XF86DGA
dga_mouse_active = false;
if (!XF86DGAQueryVersion(x_disp, &MajorVersion, &MinorVersion)) {
Con_Printf("Failed to detect XF86DGA Mouse\n");
in_dgamouse.value = 0;
dga_available = false;
} else {
dga_available = true;
}
#endif
// Need to grab the input focus at startup, just in case...
// FIXME - must be viewable or get BadMatch
XSetInputFocus(x_disp, x_win, RevertToParent, CurrentTime);
IN_InitCvars();
if (VID_IsFullScreen()) {
if (!mouse_grab_active)
IN_GrabMouse();
if (!keyboard_grab_active)
IN_GrabKeyboard();
}
}
示例7: VID_Init
/*
================
VID_Init
================
*/
void VID_Init (unsigned char *palette)
{
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None");
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_ARCHIVE, "None");
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_ARCHIVE, "None");
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None");
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None");
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None");
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None");
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_ARCHIVE, "None");
vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_ARCHIVE, "None");
block_switch = Cvar_Get("block_switch", "0", CVAR_ARCHIVE, "None");
Cmd_AddCommand ("vid_testmode", VID_TestMode_f);
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
Cmd_AddCommand ("vid_describemode", VID_DescribeMode_f);
Cmd_AddCommand ("vid_describemodes", VID_DescribeModes_f);
// set up the mode list; note that later inits link in their modes ahead of
// earlier ones, so the standard VGA modes are always first in the list. This
// is important because mode 0 must always be VGA mode 0x13
if (!COM_CheckParm ("-stdvid"))
VID_InitExtra ();
VGA_Init ();
vid_testingmode = 0;
vid_modenum = vid_mode->int_val;
VID_SetMode (vid_modenum, palette);
vid_realmode = vid_modenum;
vid_menudrawfn = VID_MenuDraw;
vid_menukeyfn = VID_MenuKey;
}
示例8: VID_Init
/*
================
VID_Init
================
*/
void VID_Init (unsigned char *palette)
{
Cvar_RegisterVariable (&vid_mode);
Cvar_RegisterVariable (&vid_wait);
Cvar_RegisterVariable (&vid_nopageflip);
Cvar_RegisterVariable (&_vid_wait_override);
Cvar_RegisterVariable (&_vid_default_mode);
Cvar_RegisterVariable (&_vid_default_mode_win);
Cvar_RegisterVariable (&vid_config_x);
Cvar_RegisterVariable (&vid_config_y);
Cvar_RegisterVariable (&vid_stretch_by_2);
Cvar_RegisterVariable (&_windowed_mouse);
Cvar_RegisterVariable (&vid_fullscreen_mode);
Cvar_RegisterVariable (&vid_windowed_mode);
Cvar_RegisterVariable (&block_switch);
Cmd_AddCommand ("vid_testmode", VID_TestMode_f);
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
Cmd_AddCommand ("vid_describemode", VID_DescribeMode_f);
Cmd_AddCommand ("vid_describemodes", VID_DescribeModes_f);
// set up the mode list; note that later inits link in their modes ahead of
// earlier ones, so the standard VGA modes are always first in the list. This
// is important because mode 0 must always be VGA mode 0x13
if (!COM_CheckParm ("-stdvid"))
VID_InitExtra ();
VGA_Init ();
vid_testingmode = 0;
vid_modenum = vid_mode.value;
VID_SetMode (vid_modenum, palette);
vid_realmode = vid_modenum;
vid_menudrawfn = VID_MenuDraw;
vid_menukeyfn = VID_MenuKey;
}
示例9: UDP_Init
int UDP_Init (void)
{
struct hostent *local;
char buff[MAXHOSTNAMELEN];
struct qsockaddr addr;
char *colon;
if (COM_CheckParm ("-noudp"))
return -1;
// determine my name & address
gethostname(buff, MAXHOSTNAMELEN);
local = gethostbyname(buff);
myAddr = *(int *)local->h_addr_list[0];
// if the quake hostname isn't set, set it to the machine name
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
{
buff[15] = 0;
Cvar_Set ("hostname", buff);
}
if ((net_controlsocket = UDP_OpenSocket (0)) == -1)
Sys_Error("UDP_Init: Unable to open control socket\n");
((struct sockaddr_in *)&broadcastaddr)->sin_family = AF_INET;
((struct sockaddr_in *)&broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST;
((struct sockaddr_in *)&broadcastaddr)->sin_port = htons(net_hostport);
UDP_GetSocketAddr (net_controlsocket, &addr);
Q_strcpy(my_tcpip_address, UDP_AddrToString (&addr));
colon = Q_strrchr (my_tcpip_address, ':');
if (colon)
*colon = 0;
Con_Printf("UDP Initialized\n");
tcpipAvailable = true;
return net_controlsocket;
}
示例10: Sys_Init
/*
=============
Sys_Init
Quake calls this so the system can register variables before host_hunklevel
is marked
=============
*/
void Sys_Init (void)
{
qbool WinNT;
OSVERSIONINFO vinfo;
// make sure the timer is high precision, otherwise
// NT gets 18ms resolution
timeBeginPeriod( 1 );
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
if (!GetVersionEx (&vinfo))
Sys_Error ("Couldn't get OS info");
if (vinfo.dwMajorVersion < 4 || vinfo.dwPlatformId == VER_PLATFORM_WIN32s)
Sys_Error (SERVER_NAME " requires at least Win95 or NT 4.0");
WinNT = (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT ? true : false);
Cvar_Register (&sys_nostdout);
Cvar_Register (&sys_sleep);
if (COM_CheckParm ("-nopriority"))
{
Cvar_Set (&sys_sleep, "0");
}
else
{
if ( ! SetPriorityClass (GetCurrentProcess(), HIGH_PRIORITY_CLASS))
Con_Printf ("SetPriorityClass() failed\n");
else
Con_Printf ("Process priority class set to HIGH\n");
// sys_sleep > 0 seems to cause packet loss on WinNT (why?)
if (WinNT)
Cvar_Set (&sys_sleep, "0");
}
Sys_InitDoubleTime ();
}
示例11: S_InitSys
static void S_InitSys (void)
{
if (safemode || COM_CheckParm("-nosound") || COM_CheckParm("-s"))
snd_system = S_SYS_NULL;
#if HAVE_SDL_SOUND
else if (COM_CheckParm ("-sndsdl"))
snd_system = S_SYS_SDL;
#endif
#if HAVE_ALSA_SOUND
else if (COM_CheckParm ("-sndalsa"))
snd_system = S_SYS_ALSA;
#endif
#if HAVE_OSS_SOUND
else if (COM_CheckParm ("-sndoss"))
snd_system = S_SYS_OSS;
#endif
#if HAVE_SUN_SOUND
else if (COM_CheckParm ("-sndsun") || COM_CheckParm ("-sndbsd"))
snd_system = S_SYS_SUN;
#endif
else
#if HAVE_WIN_SOUND
snd_system = S_SYS_WIN;
#elif HAVE_DOS_SOUND
snd_system = S_SYS_DOS;
#elif HAVE_OSS_SOUND
snd_system = S_SYS_OSS;
#elif HAVE_SUN_SOUND
snd_system = S_SYS_SUN;
#elif HAVE_ALSA_SOUND
snd_system = S_SYS_ALSA;
#elif HAVE_SDL_SOUND
snd_system = S_SYS_SDL;
#else
snd_system = S_SYS_NULL;
#endif
}
示例12: Con_Init
/*
================
Con_Init
================
*/
void Con_Init (void)
{
con_debuglog = COM_CheckParm("-condebug");
con = &con_main;
con_linewidth = -1;
Con_CheckResize ();
Con_Printf ("Console initialized.\n");
//
// register our commands
//
Cvar_RegisterVariable (&con_notifytime);
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
Cmd_AddCommand ("togglechat", Con_ToggleChat_f);
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
Cmd_AddCommand ("messagemode2", Con_MessageMode2_f);
Cmd_AddCommand ("clear", Con_Clear_f);
con_initialized = true;
}
示例13: Rulesets_Init
void Rulesets_Init (void)
{
int temp;
Cvar_Register (&ruleset);
if ((temp = COM_CheckParm ("-ruleset")) && temp + 1 < COM_Argc()) {
if (!strcasecmp (COM_Argv(temp + 1), "smackdown")) {
Cvar_Set (&ruleset, "smackdown");
return;
} else if (!strcasecmp (COM_Argv(temp + 1), "mtfl")) {
Cvar_Set (&ruleset, "mtfl");
return;
} else if (strcasecmp (COM_Argv(temp + 1), "default")){
Cvar_Set (&ruleset, "default");
return;
} else {
Rulesets_Default ();
return;
}
}
}
示例14: Sys_InitTime
/*
================
Sys_InitTime
================
*/
static void Sys_InitTime (void)
{
#if !USE_UCLOCK_TIME
int j;
Sys_DoubleTime ();
oldtime = curtime;
j = COM_CheckParm("-starttime");
if (j && j < com_argc - 1)
{
curtime = (double) (atof(com_argv[j+1]));
}
else
{
curtime = 0.0;
}
lastcurtime = curtime;
#endif /* ! USE_UCLOCK_TIME */
}
示例15: Host_SaveConfig_to
/*
===============
Host_SaveConfig_f
Writes key bindings and archived cvars to config.cfg
===============
*/
static void Host_SaveConfig_to(const char *file)
{
qfile_t *f;
// dedicated servers initialize the host but don't parse and set the
// config.cfg cvars
// LordHavoc: don't save a config if it crashed in startup
if (host_framecount >= 3 && cls.state != ca_dedicated && !COM_CheckParm("-benchmark") && !COM_CheckParm("-capturedemo"))
{
f = FS_OpenRealFile(file, "wb", false);
if (!f)
{
Con_Printf("Couldn't write %s.\n", file);
return;
}
Key_WriteBindings (f);
Cvar_WriteVariables (f);
FS_Close (f);
}
}