本文整理汇总了C++中Cmd_AddCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ Cmd_AddCommand函数的具体用法?C++ Cmd_AddCommand怎么用?C++ Cmd_AddCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Cmd_AddCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: S_Init
/**
* @sa S_Shutdown
* @sa S_Restart_f
*/
void S_Init (void)
{
SDL_version version;
char drivername[MAX_VAR];
Com_Printf("\n------- sound initialization -------\n");
OBJZERO(s_env);
snd_init = Cvar_Get("snd_init", "1", CVAR_ARCHIVE, "Should the sound renderer get initialized");
snd_init->modified = false; /* don't restart right away */
Cmd_AddCommand("snd_restart", S_Restart_f, "Restart the sound renderer");
if (!snd_init->integer) {
Com_Printf("not initializing.\n");
Cmd_AddCommand("music_change", Cmd_Dummy_f, "Dummy command if sound is disabled");
Cvar_Get("snd_music", "PsymongN3", 0, "Background music track");
return;
}
cl_soundSysPool = Mem_CreatePool("Client: Sound system");
snd_distance_scale = Cvar_Get("snd_distance_scale", "0.1", 0, "Sound distance scale");
snd_volume = Cvar_Get("snd_volume", "0.7", CVAR_ARCHIVE, "Sound volume - default is 0.7");
snd_rate = Cvar_Get("snd_rate", "44100", CVAR_ARCHIVE, "Hz value for sound renderer - default is 44100");
snd_chunkbufsize = Cvar_Get("snd_chunkbufsize", "1024", CVAR_ARCHIVE, "The sound buffer chunk size");
/* set volumes to be changed so they are applied again for next sound/music playing */
/** @todo implement the volume change for already loaded sample chunks */
snd_volume->modified = true;
Cmd_AddCommand("snd_play", S_Play_f, "Plays a sound fx file. Pass path relative to base/sound without file extension");
Cmd_AddParamCompleteFunction("snd_play", S_CompleteSounds);
if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
Com_Printf("S_Init: %s.\n", SDL_GetError());
return;
}
}
MIX_VERSION(&version)
Com_Printf("SDL_mixer version: %d.%d.%d\n", version.major, version.minor, version.patch);
Com_Printf("... requested audio rate: %i\n", snd_rate->integer);
if (Mix_OpenAudio(snd_rate->integer, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, snd_chunkbufsize->integer) == -1) {
Com_Printf("S_Init: %s\n", Mix_GetError());
return;
}
if (Mix_QuerySpec(&s_env.rate, &s_env.format, &s_env.numChannels) == 0) {
Com_Printf("S_Init: %s\n", Mix_GetError());
return;
}
if (SDL_AudioDriverName(drivername, sizeof(drivername)) == NULL)
Q_strncpyz(drivername, "(UNKNOWN)", sizeof(drivername));
Com_Printf("... driver: '%s'\n", drivername);
if (Mix_AllocateChannels(MAX_CHANNELS) != MAX_CHANNELS) {
Com_Printf("S_Init: %s\n", Mix_GetError());
return;
}
Mix_ChannelFinished(S_FreeChannel);
Com_Printf("... audio rate: %i\n", s_env.rate);
Com_Printf("... audio channels: %i\n", s_env.numChannels);
#if COMPARE_VERSION(1, 2, 10)
if (!(Mix_Init(MIX_INIT_OGG) & MIX_INIT_OGG))
Com_Printf("... could not load ogg vorbis support\n");
else
Com_Printf("... loaded ogg vorbis support\n");
#endif
s_env.initialized = true;
M_Init();
}
示例2: FMod_Init
void FMod_Init (void)
{
int lastid;
Cmd_AddCommand("f_modified", FMod_Response);
memset (check_models, 0, sizeof (check_models));
lastid = FMod_AddModel ("progs/armor.mdl", FMOD_DM | FMOD_TF, progs_armor_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_armor);
FMod_AddModelAlt(lastid, &mdlhash_ruohis_armor);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_armor);
lastid = FMod_AddModel ("progs/backpack.mdl", FMOD_DM | FMOD_TF, progs_backpack_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_backpack);
FMod_AddModel ("progs/bolt2.mdl", FMOD_DM | FMOD_TF, progs_bolt2_mdl_FMOD_DM_FMOD_TF);
FMod_AddModel ("progs/end1.mdl", FMOD_DM | FMOD_TF, progs_end1_mdl_FMOD_DM_FMOD_TF);
lastid = FMod_AddModel ("progs/end2.mdl", FMOD_DM | FMOD_TF, progs_end2_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_unknown_end2);
lastid = FMod_AddModel ("progs/end3.mdl", FMOD_DM | FMOD_TF, progs_end3_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_unknown_end3);
lastid = FMod_AddModel ("progs/end4.mdl", FMOD_DM | FMOD_TF, progs_end4_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_unknown_end4);
FMod_AddModel ("progs/eyes.mdl", FMOD_DM | FMOD_TF, progs_eyes_mdl_FMOD_DM_FMOD_TF);
lastid = FMod_AddModel ("progs/g_light.mdl", FMOD_DM | FMOD_TF, progs_g_light_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_light);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_light);
lastid = FMod_AddModel ("progs/g_nail.mdl", FMOD_DM | FMOD_TF, progs_g_nail_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_nail);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_nail);
lastid = FMod_AddModel ("progs/g_nail2.mdl", FMOD_DM | FMOD_TF, progs_g_nail2_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_nail2);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_nail2);
lastid = FMod_AddModel ("progs/g_rock.mdl", FMOD_DM | FMOD_TF, progs_g_rock_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_rock);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_rock);
lastid = FMod_AddModel ("progs/g_rock2.mdl", FMOD_DM | FMOD_TF, progs_g_rock2_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_rock2);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_rock2);
lastid = FMod_AddModel ("progs/g_shot.mdl", FMOD_DM | FMOD_TF, progs_g_shot_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_g_shot);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_g_shot);
lastid = FMod_AddModel ("progs/gib1.mdl", FMOD_DM | FMOD_TF, progs_gib1_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_gib1);
lastid = FMod_AddModel ("progs/gib2.mdl", FMOD_DM | FMOD_TF, progs_gib2_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_gib2);
lastid = FMod_AddModel ("progs/gib3.mdl", FMOD_DM | FMOD_TF, progs_gib3_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_gib3);
lastid = FMod_AddModel ("progs/grenade.mdl", FMOD_DM | FMOD_TF, progs_grenade_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_grenade);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_grenade);
lastid = FMod_AddModel ("progs/invisibl.mdl", FMOD_DM | FMOD_TF, progs_invisibl_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_invisibl);
lastid = FMod_AddModel ("progs/invulner.mdl", FMOD_DM | FMOD_TF, progs_invulner_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_invulner);
lastid = FMod_AddModel ("progs/missile.mdl", FMOD_DM | FMOD_TF, progs_missile_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_missile);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_missile);
lastid = FMod_AddModel ("progs/quaddama.mdl", FMOD_DM | FMOD_TF, progs_quaddama_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_quaddama);
lastid = FMod_AddModel ("progs/s_spike.mdl", FMOD_DM | FMOD_TF, progs_s_spike_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_s_spike);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_s_spike);
lastid = FMod_AddModel ("progs/spike.mdl", FMOD_DM | FMOD_TF, progs_spike_mdl_FMOD_DM_FMOD_TF);
FMod_AddModelAlt(lastid, &mdlhash_debug_spike);
FMod_AddModelAlt(lastid, &mdlhash_plaguespak_spike);
FMod_AddModel ("progs/suit.mdl", FMOD_DM | FMOD_TF, progs_suit_mdl_FMOD_DM_FMOD_TF);
FMod_AddModel ("progs/player.mdl", FMOD_DM, progs_player_mdl_FMOD_DM);
FMod_AddModel ("progs/player.mdl", FMOD_TF, progs_player_mdl_FMOD_TF);
FMod_AddModel ("progs/tf_flag.mdl", FMOD_TF, progs_tf_flag_mdl_FMOD_TF);
FMod_AddModel ("progs/turrbase.mdl", FMOD_TF, progs_turrbase_mdl_FMOD_TF);
FMod_AddModel ("progs/turrgun.mdl", FMOD_TF, progs_turrgun_mdl_FMOD_TF);
FMod_AddModel ("progs/disp.mdl", FMOD_TF, progs_disp_mdl_FMOD_TF);
FMod_AddModel ("progs/tf_stan.mdl", FMOD_TF, progs_tf_stan_mdl_FMOD_TF);
FMod_AddModel ("progs/hgren2.mdl", FMOD_TF, progs_hgren2_mdl_FMOD_TF); // gren1
FMod_AddModel ("progs/grenade2.mdl", FMOD_TF, progs_grenade2_mdl_FMOD_TF); // gren2
FMod_AddModel ("progs/detpack.mdl", FMOD_TF, progs_detpack_mdl_FMOD_TF); // detpack
FMod_AddModel ("progs/s_bubble.spr", FMOD_DM | FMOD_TF, progs_s_bubble_spr_FMOD_DM_FMOD_TF);
FMod_AddModel ("progs/s_explod.spr", FMOD_DM | FMOD_TF, progs_s_explod_spr_FMOD_DM_FMOD_TF);
//.........这里部分代码省略.........
示例3: SV_InitOperatorCommands
void
SV_InitOperatorCommands(void)
{
Cmd_AddCommand("heartbeat", SV_Heartbeat_f);
Cmd_AddCommand("kick", SV_Kick_f);
Cmd_AddCommand("status", SV_Status_f);
Cmd_AddCommand("serverinfo", SV_Serverinfo_f);
Cmd_AddCommand("dumpuser", SV_DumpUser_f);
Cmd_AddCommand("map", SV_Map_f);
Cmd_AddCommand("demomap", SV_DemoMap_f);
Cmd_AddCommand("gamemap", SV_GameMap_f);
Cmd_AddCommand("setmaster", SV_SetMaster_f);
if (dedicated->value)
{
Cmd_AddCommand("say", SV_ConSay_f);
}
Cmd_AddCommand("serverrecord", SV_ServerRecord_f);
Cmd_AddCommand("serverstop", SV_ServerStop_f);
Cmd_AddCommand("save", SV_Savegame_f);
Cmd_AddCommand("load", SV_Loadgame_f);
Cmd_AddCommand("killserver", SV_KillServer_f);
Cmd_AddCommand("sv", SV_ServerCommand_f);
}
示例4: CL_InitInput
/*
============
CL_InitInput
============
*/
void CL_InitInput(void)
{
Cmd_AddCommand("+moveup", IN_UpDown);
Cmd_AddCommand("-moveup", IN_UpUp);
Cmd_AddCommand("+movedown", IN_DownDown);
Cmd_AddCommand("-movedown", IN_DownUp);
Cmd_AddCommand("+left", IN_LeftDown);
Cmd_AddCommand("-left", IN_LeftUp);
Cmd_AddCommand("+right", IN_RightDown);
Cmd_AddCommand("-right", IN_RightUp);
Cmd_AddCommand("+forward", IN_ForwardDown);
Cmd_AddCommand("-forward", IN_ForwardUp);
Cmd_AddCommand("+back", IN_BackDown);
Cmd_AddCommand("-back", IN_BackUp);
Cmd_AddCommand("+lookup", IN_LookupDown);
Cmd_AddCommand("-lookup", IN_LookupUp);
Cmd_AddCommand("+lookdown", IN_LookdownDown);
Cmd_AddCommand("-lookdown", IN_LookdownUp);
Cmd_AddCommand("+strafe", IN_StrafeDown);
Cmd_AddCommand("-strafe", IN_StrafeUp);
Cmd_AddCommand("+moveleft", IN_MoveleftDown);
Cmd_AddCommand("-moveleft", IN_MoveleftUp);
Cmd_AddCommand("+moveright", IN_MoverightDown);
Cmd_AddCommand("-moveright", IN_MoverightUp);
Cmd_AddCommand("+speed", IN_SpeedDown);
Cmd_AddCommand("-speed", IN_SpeedUp);
Cmd_AddCommand("+attack", IN_Button0Down); // ---- id (primary firing)
Cmd_AddCommand("-attack", IN_Button0Up);
Cmd_AddCommand("+button1", IN_Button1Down);
Cmd_AddCommand("-button1", IN_Button1Up);
Cmd_AddCommand("+useitem", IN_UseItemDown);
Cmd_AddCommand("-useitem", IN_UseItemUp);
Cmd_AddCommand("+salute", IN_Button3Down);
Cmd_AddCommand("-salute", IN_Button3Up);
Cmd_AddCommand("+activate", IN_ActivateDown);
Cmd_AddCommand("-activate", IN_ActivateUp);
Cmd_AddCommand("+prone", IN_ProneDown);
Cmd_AddCommand("-prone", IN_ProneUp);
Cmd_AddCommand("+sprint", IN_SprintDown);
Cmd_AddCommand("-sprint", IN_SprintUp);
// wolf buttons
Cmd_AddCommand("+attack2", IN_Wbutton0Down); // secondary firing
Cmd_AddCommand("-attack2", IN_Wbutton0Up);
Cmd_AddCommand("+zoom", IN_ZoomDown);
Cmd_AddCommand("-zoom", IN_ZoomUp);
Cmd_AddCommand("+reload", IN_ReloadDown);
Cmd_AddCommand("-reload", IN_ReloadUp);
Cmd_AddCommand("+leanleft", IN_LeanLeftDown);
Cmd_AddCommand("-leanleft", IN_LeanLeftUp);
Cmd_AddCommand("+leanright", IN_LeanRightDown);
Cmd_AddCommand("-leanright", IN_LeanRightUp);
Cmd_AddCommand("+mlook", IN_MLookDown);
Cmd_AddCommand("-mlook", IN_MLookUp);
Cmd_AddCommand("help", IN_Help);
cl_nodelta = Cvar_Get("cl_nodelta", "0", 0);
cl_debugMove = Cvar_Get("cl_debugMove", "0", 0);
}
示例5: CL_RegisterInput
/*
============
CL_RegisterInput
============
*/
void CL_RegisterInput( void ) {
Cmd_AddCommand ("centerview",IN_CenterView);
Cmd_AddCommand ("+moveup",IN_UpDown);
Cmd_AddCommand ("-moveup",IN_UpUp);
Cmd_AddCommand ("+movedown",IN_DownDown);
Cmd_AddCommand ("-movedown",IN_DownUp);
Cmd_AddCommand ("+left",IN_LeftDown);
Cmd_AddCommand ("-left",IN_LeftUp);
Cmd_AddCommand ("+right",IN_RightDown);
Cmd_AddCommand ("-right",IN_RightUp);
Cmd_AddCommand ("+forward",IN_ForwardDown);
Cmd_AddCommand ("-forward",IN_ForwardUp);
Cmd_AddCommand ("+back",IN_BackDown);
Cmd_AddCommand ("-back",IN_BackUp);
Cmd_AddCommand ("+lookup", IN_LookupDown);
Cmd_AddCommand ("-lookup", IN_LookupUp);
Cmd_AddCommand ("+lookdown", IN_LookdownDown);
Cmd_AddCommand ("-lookdown", IN_LookdownUp);
Cmd_AddCommand ("+strafe", IN_StrafeDown);
Cmd_AddCommand ("-strafe", IN_StrafeUp);
Cmd_AddCommand ("+moveleft", IN_MoveleftDown);
Cmd_AddCommand ("-moveleft", IN_MoveleftUp);
Cmd_AddCommand ("+moveright", IN_MoverightDown);
Cmd_AddCommand ("-moveright", IN_MoverightUp);
Cmd_AddCommand ("+speed", IN_SpeedDown);
Cmd_AddCommand ("-speed", IN_SpeedUp);
Cmd_AddCommand ("+attack", IN_AttackDown);
Cmd_AddCommand ("-attack", IN_AttackUp);
Cmd_AddCommand ("+use", IN_UseDown);
Cmd_AddCommand ("-use", IN_UseUp);
Cmd_AddCommand ("impulse", IN_Impulse);
Cmd_AddCommand ("+klook", IN_KLookDown);
Cmd_AddCommand ("-klook", IN_KLookUp);
Cmd_AddCommand( "+mlook", IN_MLookDown );
Cmd_AddCommand( "-mlook", IN_MLookUp );
Cmd_AddCommand( "in_restart", IN_Restart_f );
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0);
cl_maxpackets = Cvar_Get( "cl_maxpackets", "30", 0 );
cl_fuzzhack = Cvar_Get( "cl_fuzzhack", "0", 0 );
cl_packetdup = Cvar_Get( "cl_packetdup", "1", 0 );
#ifdef _DEBUG
cl_showpackets = Cvar_Get( "cl_showpackets", "0", 0 );
#endif
cl_instantpacket = Cvar_Get( "cl_instantpacket", "1", 0 );
cl_batchcmds = Cvar_Get( "cl_batchcmds", "1", 0 );
cl_upspeed = Cvar_Get ( "cl_upspeed", "200", 0 );
cl_forwardspeed = Cvar_Get ( "cl_forwardspeed", "200", 0 );
cl_sidespeed = Cvar_Get ( "cl_sidespeed", "200", 0 );
cl_yawspeed = Cvar_Get ( "cl_yawspeed", "140", 0 );
cl_pitchspeed = Cvar_Get ( "cl_pitchspeed", "150", CVAR_CHEAT );
cl_anglespeedkey = Cvar_Get ( "cl_anglespeedkey", "1.5", CVAR_CHEAT );
cl_run = Cvar_Get( "cl_run", "1", CVAR_ARCHIVE );
freelook = Cvar_Get( "freelook", "0", CVAR_ARCHIVE );
lookspring = Cvar_Get ( "lookspring", "0", CVAR_ARCHIVE );
lookstrafe = Cvar_Get ( "lookstrafe", "0", CVAR_ARCHIVE );
sensitivity = Cvar_Get ( "sensitivity", "3", CVAR_ARCHIVE );
m_pitch = Cvar_Get ( "m_pitch", "0.022", CVAR_ARCHIVE );
m_yaw = Cvar_Get ( "m_yaw", "0.022", 0 );
m_forward = Cvar_Get ( "m_forward", "1", 0 );
m_side = Cvar_Get ( "m_side", "1", 0 );
m_filter = Cvar_Get( "m_filter", "0", 0 );
m_accel = Cvar_Get( "m_accel", "0", 0 );
m_autosens = Cvar_Get( "m_autosens", "0", 0 );
}
示例6: S_Init
/*
=================
S_Init
=================
*/
void S_Init(void)
{
cvar_t *cv;
qboolean started = qfalse;
Com_Printf("------ Initializing Sound ------\n");
s_volume = Cvar_Get("s_volume", "0.8", CVAR_ARCHIVE);
s_musicVolume = Cvar_Get("s_musicvolume", "0.25", CVAR_ARCHIVE);
s_muted = Cvar_Get("s_muted", "0", CVAR_ROM);
s_doppler = Cvar_Get("s_doppler", "1", CVAR_ARCHIVE);
s_backend = Cvar_Get("s_backend", "", CVAR_ROM);
s_muteWhenMinimized = Cvar_Get("s_muteWhenMinimized", "0", CVAR_ARCHIVE);
s_muteWhenUnfocused = Cvar_Get("s_muteWhenUnfocused", "0", CVAR_ARCHIVE);
cv = Cvar_Get("s_initsound", "1", 0);
if(!cv->integer)
{
Com_Printf("Sound disabled.\n");
}
else
{
S_CodecInit();
Cmd_AddCommand("play", S_Play_f);
Cmd_AddCommand("music", S_Music_f);
Cmd_AddCommand("stopmusic", S_StopMusic_f);
Cmd_AddCommand("s_list", S_SoundList);
Cmd_AddCommand("s_stop", S_StopAllSounds);
Cmd_AddCommand("s_info", S_SoundInfo);
cv = Cvar_Get("s_useOpenAL", "1", CVAR_ARCHIVE);
if(cv->integer)
{
//OpenAL
started = S_AL_Init(&si);
Cvar_Set("s_backend", "OpenAL");
}
if(!started)
{
started = S_Base_Init(&si);
Cvar_Set("s_backend", "base");
}
if(started)
{
if(!S_ValidSoundInterface(&si))
{
Com_Error(ERR_FATAL, "Sound interface invalid.");
}
S_SoundInfo();
Com_Printf("Sound initialization successful.\n");
}
else
{
Com_Printf("Sound initialization failed.\n");
}
}
Com_Printf("--------------------------------\n");
}
示例7: MP3_Init
void MP3_Init(void)
{
XMMS_LoadLibrary();
if (!MP3_IsActive())
return;
Cmd_AddCommand("xmms_prev", MP3_Prev_f);
Cmd_AddCommand("xmms_play", MP3_PlayTrackNum_f);
Cmd_AddCommand("xmms_pause", MP3_Pause_f);
Cmd_AddCommand("xmms_stop", MP3_Stop_f);
Cmd_AddCommand("xmms_next", MP3_Next_f);
Cmd_AddCommand("xmms_fforward", MP3_FastForward_f);
Cmd_AddCommand("xmms_rewind", MP3_Rewind_f);
Cmd_AddCommand("xmms_fadeout", MP3_FadeOut_f);
Cmd_AddCommand("xmms_shuffle", MP3_Shuffle_f);
Cmd_AddCommand("xmms_repeat", MP3_Repeat_f);
Cmd_AddCommand("xmms_volume", MP3_SetVolume_f );
Cmd_AddCommand("xmms_playlist", MP3_PrintPlaylist_f);
Cmd_AddCommand("xmms_songinfo", MP3_SongInfo_f);
Cmd_AddCommand("xmms_start", MP3_Execute_f);
xmms_dir = Cvar_Get("xmms_dir", "/usr/local/bin", CVAR_ARCHIVE);
xmms_session = Cvar_Get("xmms_session", "0", CVAR_ARCHIVE);
xmms_messages = Cvar_Get("xmms_messages", "0", CVAR_ARCHIVE);
Cmd_AddMacro( "cursong", MP3_SongTitle_m );
}
示例8: CL_InitInput
/*
============
CL_InitInput
============
*/
void CL_InitInput (void)
{
Cmd_AddCommand ("+moveup",IN_UpDown);
Cmd_AddCommand ("-moveup",IN_UpUp);
Cmd_AddCommand ("+movedown",IN_DownDown);
Cmd_AddCommand ("-movedown",IN_DownUp);
Cmd_AddCommand ("+left",IN_LeftDown);
Cmd_AddCommand ("-left",IN_LeftUp);
Cmd_AddCommand ("+right",IN_RightDown);
Cmd_AddCommand ("-right",IN_RightUp);
Cmd_AddCommand ("+forward",IN_ForwardDown);
Cmd_AddCommand ("-forward",IN_ForwardUp);
Cmd_AddCommand ("+back",IN_BackDown);
Cmd_AddCommand ("-back",IN_BackUp);
Cmd_AddCommand ("+lookup", IN_LookupDown);
Cmd_AddCommand ("-lookup", IN_LookupUp);
Cmd_AddCommand ("+lookdown", IN_LookdownDown);
Cmd_AddCommand ("-lookdown", IN_LookdownUp);
Cmd_AddCommand ("+strafe", IN_StrafeDown);
Cmd_AddCommand ("-strafe", IN_StrafeUp);
Cmd_AddCommand ("+moveleft", IN_MoveleftDown);
Cmd_AddCommand ("-moveleft", IN_MoveleftUp);
Cmd_AddCommand ("+moveright", IN_MoverightDown);
Cmd_AddCommand ("-moveright", IN_MoverightUp);
Cmd_AddCommand ("+speed", IN_SpeedDown);
Cmd_AddCommand ("-speed", IN_SpeedUp);
Cmd_AddCommand ("+attack", IN_AttackDown);
Cmd_AddCommand ("-attack", IN_AttackUp);
Cmd_AddCommand ("+use", IN_UseDown);
Cmd_AddCommand ("-use", IN_UseUp);
Cmd_AddCommand ("+jump", IN_JumpDown);
Cmd_AddCommand ("-jump", IN_JumpUp);
Cmd_AddCommand ("impulse", IN_Impulse);
Cmd_AddCommand ("+klook", IN_KLookDown);
Cmd_AddCommand ("-klook", IN_KLookUp);
Cmd_AddCommand ("+mlook", IN_MLookDown);
Cmd_AddCommand ("-mlook", IN_MLookUp);
Cvar_RegisterVariable (&cl_nodelta);
}
示例9: SV_InitOperatorCommands
/*
==================
SV_InitOperatorCommands
==================
*/
void SV_InitOperatorCommands( void )
{
Cmd_AddCommand( "heartbeat", SV_Heartbeat_f, "send a heartbeat to the master server" );
Cmd_AddCommand( "kick", SV_Kick_f, "kick a player off the server by number or name" );
Cmd_AddCommand( "status", SV_Status_f, "print server status information" );
Cmd_AddCommand( "serverinfo", SV_ServerInfo_f, "print server settings" );
Cmd_AddCommand( "clientinfo", SV_ClientInfo_f, "print user infostring (player num required)" );
Cmd_AddCommand( "playersonly", SV_PlayersOnly_f, "freezes physics, except for players" );
Cmd_AddCommand( "map", SV_Map_f, "start new level" );
Cmd_AddCommand( "newgame", SV_NewGame_f, "begin new game" );
Cmd_AddCommand( "endgame", SV_EndGame_f, "end current game, takes ending message" );
Cmd_AddCommand( "killgame", SV_KillGame_f, "end current game" );
Cmd_AddCommand( "hazardcourse", SV_HazardCourse_f, "start a Hazard Course" );
Cmd_AddCommand( "changelevel", SV_ChangeLevel_f, "change level" );
Cmd_AddCommand( "changelevel2", SV_ChangeLevel2_f, "change level, in Half-Life style" );
Cmd_AddCommand( "restart", SV_Restart_f, "restart current level" );
Cmd_AddCommand( "reload", SV_Reload_f, "continue from latest save or restart level" );
Cmd_AddCommand( "entpatch", SV_EntPatch_f, "write entity patch to allow external editing" );
Cmd_AddCommand( "edicts_info", SV_EdictsInfo_f, "show info about edicts" );
Cmd_AddCommand( "entity_info", SV_EntityInfo_f, "show more info about edicts" );
Cmd_AddCommand( "save", SV_Save_f, "save the game to a file" );
Cmd_AddCommand( "load", SV_Load_f, "load a saved game file" );
Cmd_AddCommand( "savequick", SV_QuickSave_f, "save the game to the quicksave" );
Cmd_AddCommand( "loadquick", SV_QuickLoad_f, "load a quick-saved game file" );
Cmd_AddCommand( "killsave", SV_DeleteSave_f, "delete a saved game file and saveshot" );
Cmd_AddCommand( "autosave", SV_AutoSave_f, "save the game to 'autosave' file" );
if( host.type == HOST_DEDICATED )
{
Cmd_AddCommand( "say", SV_ConSay_f, "send a chat message to everyone on the server" );
Cmd_AddCommand( "killserver", SV_KillServer_f, "shutdown current server" );
}
else
{
Cmd_AddCommand( "map_background", SV_MapBackground_f, "set background map" );
}
}
示例10: Commands_For_Configs_Init
static void Commands_For_Configs_Init (void)
{
extern void SV_Floodprot_f (void);
extern void SV_Floodprotmsg_f (void);
extern void TP_MsgTrigger_f (void);
extern void TP_MsgFilter_f (void);
extern void TP_Took_f (void);
extern void TP_Pickup_f (void);
extern void TP_Point_f (void);
extern void MT_AddMapGroups (void);
extern void MT_MapGroup_f (void);
extern void MT_AddSkyGroups (void);
extern void MT_SkyGroup_f (void);
extern void CL_Fog_f (void);
extern void SB_SourceUnmarkAll(void);
extern void SB_SourceMark(void);
extern void LoadConfig_f(void);
//disconnect: fix it if i forgot something
Cmd_AddCommand ("floodprot", SV_Floodprot_f);
Cmd_AddCommand ("floodprotmsg", SV_Floodprotmsg_f);
Cmd_AddCommand ("msg_trigger", TP_MsgTrigger_f);
Cmd_AddCommand ("filter", TP_MsgFilter_f);
Cmd_AddCommand ("tp_took", TP_Took_f);
Cmd_AddCommand ("tp_pickup", TP_Pickup_f);
Cmd_AddCommand ("tp_point", TP_Point_f);
MT_AddMapGroups ();
Cmd_AddCommand ("mapgroup", MT_MapGroup_f);
MT_AddSkyGroups ();
Cmd_AddCommand ("skygroup", MT_SkyGroup_f);
Cmd_AddCommand ("fog", CL_Fog_f);
Cmd_AddCommand ("allskins", Skin_AllSkins_f);
Cmd_AddCommand ("sb_sourceunmarkall", SB_SourceUnmarkAll);
Cmd_AddCommand ("sb_sourcemark", SB_SourceMark);
Browser_Init2();
}
示例11: R_RegisterSystemVars
static void R_RegisterSystemVars (void)
{
const cmdList_t *commands;
r_driver = Cvar_Get("r_driver", "", CVAR_ARCHIVE | CVAR_R_CONTEXT, "You can define the opengl driver you want to use - empty if you want to use the system default");
r_drawentities = Cvar_Get("r_drawentities", "1", 0, "Draw the local entities");
r_drawworld = Cvar_Get("r_drawworld", "1", 0, "Draw the world brushes");
r_isometric = Cvar_Get("r_isometric", "0", CVAR_ARCHIVE, "Draw the world in isometric mode");
r_nocull = Cvar_Get("r_nocull", "0", 0, "Don't perform culling for brushes and entities");
r_anisotropic = Cvar_Get("r_anisotropic", "1", CVAR_ARCHIVE);
r_texture_lod = Cvar_Get("r_texture_lod", "0", CVAR_ARCHIVE);
r_screenshot_format = Cvar_Get("r_screenshot_format", "jpg", CVAR_ARCHIVE, "png, jpg or tga are valid screenshot formats");
r_screenshot_jpeg_quality = Cvar_Get("r_screenshot_jpeg_quality", "75", CVAR_ARCHIVE, "jpeg quality in percent for jpeg screenshots");
r_threads = Cvar_Get("r_threads", "0", CVAR_ARCHIVE, "Activate threads for the renderer");
r_materials = Cvar_Get("r_materials", "1", CVAR_ARCHIVE, "Activate material subsystem");
r_default_specular = Cvar_Get("r_default_specular", "0.2", CVAR_R_CONTEXT, "Default specular exponent");
r_default_hardness = Cvar_Get("r_default_hardness", "0.2", CVAR_R_CONTEXT, "Default specular brightness");
Cvar_RegisterChangeListener("r_default_specular", R_UpdateDefaultMaterial);
Cvar_RegisterChangeListener("r_default_hardness", R_UpdateDefaultMaterial);
r_checkerror = Cvar_Get("r_checkerror", "0", CVAR_ARCHIVE, "Check for opengl errors");
r_shadows = Cvar_Get("r_shadows", "1", CVAR_ARCHIVE, "Multiplier for the alpha of the shadows");
r_stencilshadows = Cvar_Get("r_stencilshadows", "0", CVAR_ARCHIVE, "Activate or deactivate stencil shadows");
r_maxtexres = Cvar_Get("r_maxtexres", "2048", CVAR_ARCHIVE | CVAR_R_IMAGES, "The maximum texture resolution UFO should use");
r_texturemode = Cvar_Get("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE, "change the filtering and mipmapping for textures");
r_texturealphamode = Cvar_Get("r_texturealphamode", "GL_RGBA", CVAR_ARCHIVE);
r_texturesolidmode = Cvar_Get("r_texturesolidmode", "GL_RGB", CVAR_ARCHIVE);
r_wire = Cvar_Get("r_wire", "0", 0, "Draw the scene in wireframe mode");
r_showbox = Cvar_Get("r_showbox", "0", CVAR_ARCHIVE, "1=Shows model bounding box, 2=show also the brushes bounding boxes");
r_lightmap = Cvar_Get("r_lightmap", "0", CVAR_R_PROGRAMS, "Draw only the lightmap");
r_lightmap->modified = false;
r_deluxemap = Cvar_Get("r_deluxemap", "0", CVAR_R_PROGRAMS, "Draw only the deluxemap");
r_deluxemap->modified = false;
r_debug_normals = Cvar_Get("r_debug_normals", "0", CVAR_R_PROGRAMS, "Draw dot(normal, light_0 direction)");
r_debug_normals->modified = false;
r_debug_tangents = Cvar_Get("r_debug_tangents", "0", CVAR_R_PROGRAMS, "Draw tangent, bitangent, and normal dotted with light dir as RGB espectively");
r_debug_tangents->modified = false;
r_debug_lights = Cvar_Get("r_debug_lights", "0", CVAR_ARCHIVE, "Draw active light sources");
r_ext_texture_compression = Cvar_Get("r_ext_texture_compression", "0", CVAR_ARCHIVE | CVAR_R_CONTEXT);
r_ext_nonpoweroftwo = Cvar_Get("r_ext_nonpoweroftwo", "1", CVAR_ARCHIVE, "Enable or disable the non power of two extension");
r_ext_s3tc_compression = Cvar_Get("r_ext_s3tc_compression", "1", CVAR_ARCHIVE, "Also see r_ext_texture_compression");
r_intel_hack = Cvar_Get("r_intel_hack", "1", CVAR_ARCHIVE, "Intel cards have activated texture compression and no shaders until this is set to 0");
r_vertexbuffers = Cvar_Get("r_vertexbuffers", "0", CVAR_ARCHIVE | CVAR_R_CONTEXT, "Controls usage of OpenGL Vertex Buffer Objects (VBO) versus legacy vertex arrays.");
r_maxlightmap = Cvar_Get("r_maxlightmap", "2048", CVAR_ARCHIVE | CVAR_LATCH, "Reduce this value on older hardware");
Cvar_SetCheckFunction("r_maxlightmap", R_CvarCheckMaxLightmap);
r_drawbuffer = Cvar_Get("r_drawbuffer", "GL_BACK");
r_swapinterval = Cvar_Get("r_swapinterval", "0", CVAR_ARCHIVE | CVAR_R_CONTEXT, "Controls swap interval synchronization (V-Sync). Values between 0 and 2");
r_multisample = Cvar_Get("r_multisample", "0", CVAR_ARCHIVE | CVAR_R_CONTEXT, "Controls multisampling (anti-aliasing). Values between 0 and 4");
r_warp = Cvar_Get("r_warp", "1", CVAR_ARCHIVE, "Activates or deactivates warping surface rendering");
r_shownormals = Cvar_Get("r_shownormals", "0", CVAR_ARCHIVE, "Show normals on bsp surfaces");
r_bumpmap = Cvar_Get("r_bumpmap", "1.0", CVAR_ARCHIVE | CVAR_R_PROGRAMS, "Activate bump mapping");
r_specular = Cvar_Get("r_specular", "1.0", CVAR_ARCHIVE, "Controls specular parameters");
r_hardness = Cvar_Get("r_hardness", "1.0", CVAR_ARCHIVE, "Hardness control for GLSL shaders (specular, bump, ...)");
r_parallax = Cvar_Get("r_parallax", "1.0", CVAR_ARCHIVE, "Controls parallax parameters");
r_fog = Cvar_Get("r_fog", "1", CVAR_ARCHIVE | CVAR_R_PROGRAMS, "Activate or deactivate fog");
r_flares = Cvar_Get("r_flares", "1", CVAR_ARCHIVE, "Activate or deactivate flares");
r_coronas = Cvar_Get("r_coronas", "1", CVAR_ARCHIVE, "Activate or deactivate coronas");
r_particles = Cvar_Get("r_particles", "1", 0, "Activate or deactivate particle rendering");
r_drawtags = Cvar_Get("r_drawtags", "0", 0, "Activate or deactivate tag rendering");
for (commands = r_commands; commands->name; commands++)
Cmd_AddCommand(commands->name, commands->function, commands->description);
}
示例12: Cvar_Init
/*
============
Cvar_Init
Reads in all archived cvars
============
*/
void Cvar_Init (void) {
memset( cvar_indexes, 0, sizeof( cvar_indexes ) );
memset( hashTable, 0, sizeof( hashTable ) );
cvar_cheats = Cvar_Get( "sv_cheats", "1", CVAR_ROM|CVAR_SYSTEMINFO );
Cmd_AddCommand( "print", Cvar_Print_f );
Cmd_SetCommandCompletionFunc( "print", Cvar_CompleteCvarName );
Cmd_AddCommand( "toggle", Cvar_Toggle_f );
Cmd_SetCommandCompletionFunc( "toggle", Cvar_CompleteCvarName );
Cmd_AddCommand( "set", Cvar_Set_f );
Cmd_SetCommandCompletionFunc( "set", Cvar_CompleteCvarName );
Cmd_AddCommand( "sets", Cvar_Set_f );
Cmd_SetCommandCompletionFunc( "sets", Cvar_CompleteCvarName );
Cmd_AddCommand( "setu", Cvar_Set_f );
Cmd_SetCommandCompletionFunc( "setu", Cvar_CompleteCvarName );
Cmd_AddCommand( "seta", Cvar_Set_f );
Cmd_SetCommandCompletionFunc( "seta", Cvar_CompleteCvarName );
Cmd_AddCommand( "reset", Cvar_Reset_f );
Cmd_SetCommandCompletionFunc( "reset", Cvar_CompleteCvarName );
Cmd_AddCommand( "unset", Cvar_Unset_f );
Cmd_SetCommandCompletionFunc( "unset", Cvar_CompleteCvarName );
Cmd_AddCommand( "cvarlist", Cvar_List_f );
Cmd_AddCommand( "cvar_modified", Cvar_ListModified_f );
Cmd_AddCommand( "cvar_restart", Cvar_Restart_f );
}
示例13: CL_UISystemCalls
/*
====================
CL_UISystemCalls
The ui module is making a system call
====================
*/
intptr_t CL_UISystemCalls(intptr_t *args)
{
switch (args[0])
{
case UI_ERROR:
Com_Error(ERR_DROP, "%s", (char *)VMA(1));
return 0;
case UI_PRINT:
Com_Printf("%s", (char *)VMA(1));
return 0;
case UI_MILLISECONDS:
return Sys_Milliseconds();
case UI_CVAR_REGISTER:
Cvar_Register(VMA(1), VMA(2), VMA(3), args[4]);
return 0;
case UI_CVAR_UPDATE:
Cvar_Update(VMA(1));
return 0;
case UI_CVAR_SET:
Cvar_SetSafe(VMA(1), VMA(2));
return 0;
case UI_CVAR_VARIABLEVALUE:
return FloatAsInt(Cvar_VariableValue(VMA(1)));
case UI_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer(VMA(1), VMA(2), args[3]);
return 0;
case UI_CVAR_LATCHEDVARIABLESTRINGBUFFER:
Cvar_LatchedVariableStringBuffer(VMA(1), VMA(2), args[3]);
return 0;
case UI_CVAR_SETVALUE:
Cvar_SetValueSafe(VMA(1), VMF(2));
return 0;
case UI_CVAR_RESET:
Cvar_Reset(VMA(1));
return 0;
case UI_CVAR_CREATE:
Cvar_Register(NULL, VMA(1), VMA(2), args[3]);
return 0;
case UI_CVAR_INFOSTRINGBUFFER:
Cvar_InfoStringBuffer(args[1], VMA(2), args[3]);
return 0;
case UI_ARGC:
return Cmd_Argc();
case UI_ARGV:
Cmd_ArgvBuffer(args[1], VMA(2), args[3]);
return 0;
case UI_CMD_EXECUTETEXT:
if (args[1] == EXEC_NOW
&& (!strncmp(VMA(2), "snd_restart", 11)
|| !strncmp(VMA(2), "vid_restart", 11)
|| !strncmp(VMA(2), "quit", 5)))
{
Com_Printf(S_COLOR_YELLOW "turning EXEC_NOW '%.11s' into EXEC_INSERT\n", (const char *)VMA(2));
args[1] = EXEC_INSERT;
}
Cbuf_ExecuteText(args[1], VMA(2));
return 0;
case UI_ADDCOMMAND:
Cmd_AddCommand(VMA(1));
return 0;
case UI_FS_FOPENFILE:
return FS_FOpenFileByMode(VMA(1), VMA(2), args[3]);
case UI_FS_READ:
FS_Read(VMA(1), args[2], args[3]);
return 0;
case UI_FS_WRITE:
FS_Write(VMA(1), args[2], args[3]);
return 0;
case UI_FS_FCLOSEFILE:
FS_FCloseFile(args[1]);
return 0;
case UI_FS_DELETEFILE:
return FS_Delete(VMA(1));
case UI_FS_GETFILELIST:
return FS_GetFileList(VMA(1), VMA(2), VMA(3), args[4]);
case UI_R_REGISTERMODEL:
return re.RegisterModel(VMA(1));
case UI_R_REGISTERSKIN:
return re.RegisterSkin(VMA(1));
case UI_R_REGISTERSHADERNOMIP:
return re.RegisterShaderNoMip(VMA(1));
case UI_R_CLEARSCENE:
re.ClearScene();
return 0;
case UI_R_ADDREFENTITYTOSCENE:
re.AddRefEntityToScene(VMA(1));
return 0;
case UI_R_ADDPOLYTOSCENE:
re.AddPolyToScene(args[1], args[2], VMA(3));
return 0;
case UI_R_ADDPOLYSTOSCENE:
re.AddPolysToScene(args[1], args[2], VMA(3), args[4]);
return 0;
//.........这里部分代码省略.........
示例14: IN_Init
void IN_Init(void)
{
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
}
示例15: Host_Init
//.........这里部分代码省略.........
// initialize process nice level
Sys_InitProcessNice();
// initialize ixtable
Mathlib_Init();
// initialize filesystem (including fs_basedir, fs_gamedir, -game, scr_screenshot_name)
FS_Init();
// register the cvars for session locking
Host_InitSession();
// must be after FS_Init
Crypto_Init();
Crypto_Init_Commands();
NetConn_Init();
Curl_Init();
//PR_Init();
//PR_Cmd_Init();
PRVM_Init();
Mod_Init();
World_Init();
SV_Init();
V_Init(); // some cvars needed by server player physics (cl_rollangle etc)
Host_InitCommands();
Host_InitLocal();
Host_ServerOptions();
IRC_Init();
Thread_Init();
if (cls.state == ca_dedicated)
Cmd_AddCommand ("disconnect", CL_Disconnect_f, "disconnect from server (or disconnect all clients if running a server)");
else
{
Con_DPrintf("Initializing client\n");
R_Modules_Init();
Palette_Init();
#ifdef CONFIG_MENU
MR_Init_Commands();
#endif
VID_Shared_Init();
VID_Init();
Render_Init();
S_Init();
#ifdef CONFIG_CD
CDAudio_Init();
#endif
Key_Init();
CL_Init();
}
// save off current state of aliases, commands and cvars for later restore if FS_GameDir_f is called
// NOTE: menu commands are freed by Cmd_RestoreInitState
Cmd_SaveInitState();
// FIXME: put this into some neat design, but the menu should be allowed to crash
// without crashing the whole game, so this should just be a short-time solution
// here comes the not so critical stuff
if (setjmp(host_abortframe)) {
return;
}