当前位置: 首页>>代码示例>>C++>>正文


C++ idCmdArgs::Argv方法代码示例

本文整理汇总了C++中idCmdArgs::Argv方法的典型用法代码示例。如果您正苦于以下问题:C++ idCmdArgs::Argv方法的具体用法?C++ idCmdArgs::Argv怎么用?C++ idCmdArgs::Argv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在idCmdArgs的用法示例。


在下文中一共展示了idCmdArgs::Argv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetA_f

/*
============
idCVarSystemLocal::SetA_f
============
*/
void idCVarSystemLocal::SetA_f( const idCmdArgs &args )
{
    idInternalCVar *cvar;

    Set_f( args );
    cvar = localCVarSystem.FindInternal( args.Argv( 1 ) );
    if ( !cvar )
    {
        return;
    }

    // FIXME: enable this for ship, so mods can store extra data
    // but during development we don't want obsolete cvars to continue
    // to be saved
//	cvar->flags |= CVAR_ARCHIVE;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:21,代码来源:CVarSystem.cpp

示例2: RunReach_f

/*
============
RunReach_f
============
*/
void RunReach_f( const idCmdArgs &args )
{
	idAASBuild		aas;
	idAASSettings	settings;
	
	if( args.Argc() <= 1 )
	{
		common->Printf( "runReach [options] <mapfile>\n" );
		return;
	}
	common->ClearWarnings( "calculating AAS reachability" );
	
	common->SetRefreshOnPrint( true );
	
	// get the aas settings definitions
	const idDict *dict = gameEdit->FindEntityDefDict( "aas_types", false );
	
	if( !dict )
	{
		common->Error( "Unable to find entityDef for 'aas_types'" );
	}
	const idKeyValue *kv = dict->MatchPrefix( "type" );
	
	while( kv != NULL )
	{
		const idDict *settingsDict = gameEdit->FindEntityDefDict( kv->GetValue(), false );
		
		if( !settingsDict )
		{
			common->DWarning( "Unable to find '%s' in def/aas.def", kv->GetValue().c_str() );
		}
		else
		{
			settings.FromDict( kv->GetValue(), settingsDict );
			int i = ParseOptions( args, settings );
			aas.BuildReachability( idStr( "maps/" ) + args.Argv( i ), &settings );
		}
		kv = dict->MatchPrefix( "type", kv );
		
		if( kv )
		{
			common->Printf( "=======================================================\n" );
		}
	}
	common->SetRefreshOnPrint( false );
	common->PrintWarnings();
}
开发者ID:revelator,项目名称:MHDoom,代码行数:52,代码来源:AASBuild.cpp

示例3: R_ReloadGuis_f

/*
================,
R_ReloadGuis_f

Reloads any guis that have had their file timestamps changed.
An optional "all" parameter will cause all models to reload, even
if they are not out of date.

Should we also reload the map models?
================
*/
void R_ReloadGuis_f( const idCmdArgs& args )
{
	bool all;
	
	if( !idStr::Icmp( args.Argv( 1 ), "all" ) )
	{
		all = true;
		common->Printf( "Reloading all gui files...\n" );
	}
	else
	{
		all = false;
		common->Printf( "Checking for changed gui files...\n" );
	}
	
	uiManager->Reload( all );
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:28,代码来源:tr_frontend_guisurf.cpp

示例4: Reset_f

/*
============
idCVarSystemLocal::Reset_f
============
*/
void idCVarSystemLocal::Reset_f( const idCmdArgs &args )
{
    idInternalCVar *cvar;

    if ( args.Argc() != 2 )
    {
        common->Printf ("usage: reset <variable>\n");
        return;
    }
    cvar = localCVarSystem.FindInternal( args.Argv( 1 ) );
    if ( !cvar )
    {
        return;
    }

    cvar->Reset();
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:22,代码来源:CVarSystem.cpp

示例5: Con_Dump_f

/*
==============
Con_Dump_f
==============
*/
static void Con_Dump_f( const idCmdArgs &args ) {
	printf("todo: Con_Dump_f");
	exit(0);

#ifdef TODO
	if ( args.Argc() != 2 ) {
		common->Printf( "usage: conDump <filename>\n" );
		return;
	}

	idStr fileName = args.Argv(1);
	fileName.DefaultFileExtension(".txt");

	common->Printf( "Dumped console text to %s.\n", fileName.c_str() );

	localConsole.Dump( fileName.c_str() );
#endif
}
开发者ID:sbrown345,项目名称:doom3_emscripten,代码行数:23,代码来源:Console.cpp

示例6: R_ReloadImages_f

/*
===============
R_ReloadImages_f

Regenerate all images that came directly from files that have changed, so
any saved changes will show up in place.

New r_texturesize/r_texturedepth variables will take effect on reload

reloadImages <all>
===============
*/
void R_ReloadImages_f( const idCmdArgs& args )
{
	bool all = false;
	
	if( args.Argc() == 2 )
	{
		if( !idStr::Icmp( args.Argv( 1 ), "all" ) )
		{
			all = true;
		}
		else
		{
			common->Printf( "USAGE: reloadImages <all>\n" );
			return;
		}
	}
	
	globalImages->ReloadImages( all );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:31,代码来源:ImageManager.cpp

示例7: TouchModel_f

/*
==============
idRenderModelManagerLocal::TouchModel_f

Precache a specific model
==============
*/
void idRenderModelManagerLocal::TouchModel_f( const idCmdArgs& args )
{
	const char*	model = args.Argv( 1 );
	
	if( !model[0] )
	{
		common->Printf( "usage: touchModel <modelName>\n" );
		return;
	}
	
	common->Printf( "touchModel %s\n", model );
	const bool captureToImage = false;
	common->UpdateScreen( captureToImage );
	idRenderModel* m = renderModelManager->CheckModel( model );
	if( !m )
	{
		common->Printf( "...not found\n" );
	}
}
开发者ID:LucasCampos,项目名称:RBDOOM-3-BFG,代码行数:26,代码来源:ModelManager.cpp

示例8: ListTypeInfo_f

void ListTypeInfo_f( const idCmdArgs &args ) {
	int i, j;
	idList<int> index;

	common->Printf( "%-32s : %-32s size (B)\n", "type name", "super type name" );
	for ( i = 0; classTypeInfo[i].typeName != NULL; i++ ) {
		index.Append( i );
	}

	if ( args.Argc() > 1 && idStr::Icmp( args.Argv( 1 ), "size" ) == 0 ) {
		index.Sort( SortTypeInfoBySize );
	} else {
		index.Sort( SortTypeInfoByName );
	}

	for ( i = 0; classTypeInfo[i].typeName != NULL; i++ ) {
		j = index[i];
		common->Printf( "%-32s : %-32s %d\n", classTypeInfo[j].typeName, classTypeInfo[j].superType, classTypeInfo[j].size );
	}
}
开发者ID:iodoom-gitorious,项目名称:windowshasyous-dhewg-iodoom3,代码行数:20,代码来源:TypeInfo.cpp

示例9: Command

/*
============
idCVarSystemLocal::Command
============
*/
bool idCVarSystemLocal::Command( const idCmdArgs &args ) {
	idInternalCVar *internal;

	internal = FindInternal( args.Argv( 0 ) );

	if ( internal == NULL ) {
		return false;
	}

	if ( args.Argc() == 1 ) {
		// print the variable
		common->Printf( "\"%s\" is:\"%s\"" S_COLOR_WHITE " default:\"%s\"\n",
					internal->nameString.c_str(), internal->valueString.c_str(), internal->resetString.c_str() );
		if ( idStr::Length( internal->GetDescription() ) > 0 ) {
			common->Printf( S_COLOR_WHITE "%s\n", internal->GetDescription() );
		}
	} else {
		// set the value
		internal->Set( args.Args(), false, false );
	}
	return true;
}
开发者ID:AndreiBarsan,项目名称:doom3.gpl,代码行数:27,代码来源:CVarSystem.cpp

示例10: ParseOptions

/*
============
ParseOptions
============
*/
int ParseOptions( const idCmdArgs &args, idAASSettings &settings ) {
	int i;
	idStr str;
	for( i = 1; i < args.Argc(); i++ ) {
		str = args.Argv( i );
		str.StripLeading( '-' );
		if( str.Icmp( "usePatches" ) == 0 ) {
			settings.usePatches = true;
			common->Printf( "usePatches = true\n" );
		} else if( str.Icmp( "writeBrushMap" ) == 0 ) {
			settings.writeBrushMap = true;
			common->Printf( "writeBrushMap = true\n" );
		} else if( str.Icmp( "playerFlood" ) == 0 ) {
			settings.playerFlood = true;
			common->Printf( "playerFlood = true\n" );
		} else if( str.Icmp( "noOptimize" ) == 0 ) {
			settings.noOptimize = true;
			common->Printf( "noOptimize = true\n" );
		}
	}
	return args.Argc() - 1;
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:27,代码来源:AASBuild.cpp

示例11: Connect_f

/*
========================
idSessionLocalWin::Connect_f
========================
*/
void idSessionLocalWin::Connect_f( const idCmdArgs& args )
{
	if( args.Argc() < 2 )
	{
		idLib::Printf( "Usage: Connect to IP.  Use with net_port. \n" );
		return;
	}
	
	Cancel();
	
	if( signInManager->GetMasterLocalUser() == NULL )
	{
		signInManager->RegisterLocalUser( 0 );
	}
	
	lobbyConnectInfo_t connectInfo;
	
	Sys_StringToNetAdr( args.Argv( 1 ), &connectInfo.netAddr, true );
	connectInfo.netAddr.port = net_port.GetInteger();
	
	ConnectAndMoveToLobby( GetPartyLobby(), connectInfo, false );
}
开发者ID:LucasCampos,项目名称:RBDOOM-3-BFG,代码行数:27,代码来源:posix_session_local.cpp

示例12: TestSaveGame_f

/*
================
TestSaveGame_f
================
*/
void TestSaveGame_f( const idCmdArgs &args ) {
	idStr name;

	if ( args.Argc() <= 1 ) {
		gameLocal.Printf( "testSaveGame <mapName>\n" );
		return;
	}

	name = args.Argv( 1 );

	try {
		cmdSystem->BufferCommandText( CMD_EXEC_NOW, va( "map %s", name.c_str() ) );
		name.Replace( "\\", "_" );
		name.Replace( "/", "_" );
		cmdSystem->BufferCommandText( CMD_EXEC_NOW, va( "saveGame test_%s", name.c_str() ) );
		cmdSystem->BufferCommandText( CMD_EXEC_NOW, va( "loadGame test_%s", name.c_str() ) );
	}
	catch( idException & ) {
		// an ERR_DROP was thrown
	}
	cmdSystem->BufferCommandText( CMD_EXEC_NOW, "quit" );
}
开发者ID:iodoom-gitorious,项目名称:windowshasyous-dhewg-iodoom3,代码行数:27,代码来源:TypeInfo.cpp

示例13: ArgCompletion_FolderExtension

/*
============
idCmdSystemLocal::ArgCompletion_FolderExtension
============
*/
void idCmdSystemLocal::ArgCompletion_FolderExtension( const idCmdArgs &args, void(*callback)( const char *s ), const char *folder, bool stripFolder, ... ) {
	int i;
	idStr string;
	const char *extension;
	va_list argPtr;

	string = args.Argv( 0 );
	string += " ";
	string += args.Argv( 1 );

    // taaaki: ensure that we clear the auto-complete list for the (d)map commands in case missions are
    //         installed/uninstalled while the game is running
	if ( string.Icmp( completionString ) != 0 || string.Icmp( "map " ) == 0 || string.Icmp( "dmap " ) == 0 ) {
		idStr parm, path;
		idFileList *names;
        const char* gamedir = NULL;

        // check if a fan mission has been set and that the "map" or "dmap" command is being used
        idStr currFm = cvarSystem->GetCVarString("fs_currentfm");
        if ( currFm.Icmp( "darkmod" ) != 0 && ( string.Icmp( "map " ) == 0 || string.Icmp( "dmap " ) == 0 ) ) {
            gamedir = currFm.c_str();
        }

		completionString = string;
		completionParms.Clear();

		parm = args.Argv( 1 );
		parm.ExtractFilePath( path );
		if ( stripFolder || path.Length() == 0 ) {
			path = folder + path;
		}
		path.StripTrailing( '/' );

        // taaaki: don't include folders if we are looking for the currentfm .map file
        //         this is a bit of a hack :/
        if ( !gamedir ) {
            names = fileSystem->ListFiles( path, "/", true, true, gamedir );

		    for ( i = 0; i < names->GetNumFiles(); i++ ) {
			    idStr name = names->GetFile( i );
			    if ( stripFolder ) {
				    name.Strip( folder );
			    } else {
				    name.Strip( "/" );
			    }
			    name = args.Argv( 0 ) + ( " " + name ) + "/";
			    completionParms.Append( name );
		    }
		    fileSystem->FreeFileList( names );
        }

		// list files
		va_start( argPtr, stripFolder );
		for ( extension = va_arg( argPtr, const char * ); extension; extension = va_arg( argPtr, const char * ) ) {
			names = fileSystem->ListFiles( path, extension, true, true, gamedir );
			for ( i = 0; i < names->GetNumFiles(); i++ ) {
				idStr name = names->GetFile( i );
				if ( stripFolder ) {
					name.Strip( folder );
				} else {
					name.Strip( "/" );
				}
				name = args.Argv( 0 ) + ( " " + name );
				completionParms.Append( name );
			}
			fileSystem->FreeFileList( names );
		}
		va_end( argPtr );
	}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:74,代码来源:CmdSystem.cpp

示例14: Dmap

/*
============
Dmap
============
*/
void Dmap( const idCmdArgs &args ) {
	int			i;
	int			start, end;
	char		path[1024];
	idStr		passedName;
	bool		leaked = false;
	bool		noCM = false;
	bool		noAAS = false;

	ResetDmapGlobals();

	if ( args.Argc() < 2 ) {
		DmapHelp();
		return;
	}

	common->Printf("---- World Builder ----\n");
	common->Printf("Processing compile options\n");

	//dmapGlobals.fullCarve = true;
	dmapGlobals.shadowOptLevel = SO_MERGE_SURFACES;		// create shadows by merging all surfaces, but no super optimization
//	dmapGlobals.shadowOptLevel = SO_CLIP_OCCLUDERS;		// remove occluders that are completely covered
//	dmapGlobals.shadowOptLevel = SO_SIL_OPTIMIZE;
//	dmapGlobals.shadowOptLevel = SO_CULL_OCCLUDED;
	dmapGlobals.mapCompileError = "";
	dmapGlobals.noLightCarve = true;

	for ( i = 1 ; i < args.Argc() ; i++ ) {
		const char *s;

		s = args.Argv(i);
		if ( s[0] == '-' ) {
			s++;
			if ( s[0] == '\0' ) {
				continue;
			}
		}

		if ( !idStr::Icmp( s,"glview" ) ) {
			dmapGlobals.glview = true;
		} else if ( !idStr::Icmp( s, "v" ) ) {
			common->Printf( "verbose = true\n" );
			dmapGlobals.verbose = true;
		} else if ( !idStr::Icmp( s, "draw" ) ) {
			common->Printf( "drawflag = true\n" );
			dmapGlobals.drawflag = true;
		} else if ( !idStr::Icmp( s, "noFlood" ) ) {
			common->Printf( "noFlood = true\n" );
			dmapGlobals.noFlood = true;
		} else if ( !idStr::Icmp( s, "noLightCarve" ) ) {
			common->Printf( "noLightCarve = true\n" );
			dmapGlobals.noLightCarve = true;
		} else if ( !idStr::Icmp( s, "lightCarve" ) ) {
			common->Printf( "noLightCarve = false\n" );
			dmapGlobals.noLightCarve = false;
		} else if ( !idStr::Icmp( s, "noOpt" ) ) {
			common->Printf( "noOptimize = true\n" );
			dmapGlobals.noOptimize = true;
		} else if ( !idStr::Icmp( s, "verboseentities" ) ) {
			common->Printf( "verboseentities = true\n");
			dmapGlobals.verboseentities = true;
		} else if ( !idStr::Icmp( s, "noCurves" ) ) {
			common->Printf( "noCurves = true\n");
			dmapGlobals.noCurves = true;
		} else if ( !idStr::Icmp( s, "noModels" ) ) {
			common->Printf( "noModels = true\n" );
			dmapGlobals.noModelBrushes = true;
		} else if ( !idStr::Icmp( s, "noClipSides" ) ) {
			common->Printf( "noClipSides = true\n" );
			dmapGlobals.noClipSides = true;
		} else if ( !idStr::Icmp( s, "noCarve" ) ) {
			common->Printf( "noCarve = true\n" );
			dmapGlobals.fullCarve = false;
		} else if ( !idStr::Icmp( s, "shadowOpt" ) ) {
			dmapGlobals.shadowOptLevel = (shadowOptLevel_t)atoi( args.Argv( i+1 ) );
			common->Printf( "shadowOpt = %i\n",dmapGlobals.shadowOptLevel );
			i += 1;
		} else if ( !idStr::Icmp( s, "noTjunc" ) ) {
			// triangle optimization won't work properly without tjunction fixing
			common->Printf ("noTJunc = true\n" );
			dmapGlobals.noTJunc = true;
			dmapGlobals.noOptimize = true;
			common->Printf ("forcing noOptimize = true\n" );
		} else if ( !idStr::Icmp( s, "noCM" ) ) {
			noCM = true;
			common->Printf( "noCM = true\n" );
		} else if ( !idStr::Icmp( s, "noAAS" ) ) {
			noAAS = true;
			common->Printf( "noAAS = true\n" );
// jmarshall
		} else if ( !idStr::Icmp( s, "novtupdate" ) ) {
			dmapGlobals.novtupdate = true;
		} else if ( !idStr::Icmp( s, "updateents" ) ) {
			dmapGlobals.onlyEntities = true;
		} 
//.........这里部分代码省略.........
开发者ID:Deepfreeze32,项目名称:idtech4cdk,代码行数:101,代码来源:dmap.cpp

示例15: ArgCompletion_FolderExtension

/*
============
idCmdSystemLocal::ArgCompletion_FolderExtension
============
*/
void idCmdSystemLocal::ArgCompletion_FolderExtension( const idCmdArgs& args, void( *callback )( const char* s ), const char* folder, bool stripFolder, ... )
{
	int i;
	idStr string;
	const char* extension;
	va_list argPtr;
	
	string = args.Argv( 0 );
	string += " ";
	string += args.Argv( 1 );
	
	if( string.Icmp( completionString ) != 0 )
	{
		idStr parm, path;
		idFileList* names;
		
		completionString = string;
		completionParms.Clear();
		
		parm = args.Argv( 1 );
		parm.ExtractFilePath( path );
		if( stripFolder || path.Length() == 0 )
		{
			path = folder + path;
		}
		path.StripTrailing( '/' );
		
		// list folders
		names = fileSystem->ListFiles( path, "/", true, true );
		for( i = 0; i < names->GetNumFiles(); i++ )
		{
			idStr name = names->GetFile( i );
			if( stripFolder )
			{
				name.Strip( folder );
			}
			else
			{
				name.Strip( "/" );
			}
			name = args.Argv( 0 ) + ( " " + name ) + "/";
			completionParms.Append( name );
		}
		fileSystem->FreeFileList( names );
		
		// list files
		va_start( argPtr, stripFolder );
		for( extension = va_arg( argPtr, const char* ); extension; extension = va_arg( argPtr, const char* ) )
		{
			names = fileSystem->ListFiles( path, extension, true, true );
			for( i = 0; i < names->GetNumFiles(); i++ )
			{
				idStr name = names->GetFile( i );
				if( stripFolder )
				{
					name.Strip( folder );
				}
				else
				{
					name.Strip( "/" );
				}
				name = args.Argv( 0 ) + ( " " + name );
				completionParms.Append( name );
			}
			fileSystem->FreeFileList( names );
		}
		va_end( argPtr );
	}
开发者ID:cs121,项目名称:TECH4-BFG,代码行数:73,代码来源:CmdSystem.cpp


注:本文中的idCmdArgs::Argv方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。