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


C++ idCmdArgs类代码示例

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


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

示例1: Set_f

/*
============
idCVarSystemLocal::Set_f
============
*/
void idCVarSystemLocal::Set_f( const idCmdArgs &args )
{
    const char *str;

    str = args.Args( 2, args.Argc() - 1 );
    localCVarSystem.SetCVarString( args.Argv(1), str );
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:12,代码来源:CVarSystem.cpp

示例2: 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:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:39,代码来源:AASBuild.cpp

示例3: R_ModulateLights_f

/*
====================
R_ModulateLights_f

Modifies the shaderParms on all the lights so the level
designers can easily test different color schemes
====================
*/
void R_ModulateLights_f( const idCmdArgs& args )
{
	if( !tr.primaryWorld )
	{
		return;
	}
	if( args.Argc() != 4 )
	{
		common->Printf( "usage: modulateLights <redFloat> <greenFloat> <blueFloat>\n" );
		return;
	}
	
	float modulate[3];
	for( int i = 0; i < 3; i++ )
	{
		modulate[i] = atof( args.Argv( i + 1 ) );
	}
	
	int count = 0;
	for( int i = 0; i < tr.primaryWorld->lightDefs.Num(); i++ )
	{
		idRenderLightLocal* light = tr.primaryWorld->lightDefs[i];
		if( light != NULL )
		{
			count++;
			for( int j = 0; j < 3; j++ )
			{
				light->parms.shaderParms[j] *= modulate[j];
			}
		}
	}
	common->Printf( "modulated %i lights\n", count );
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:41,代码来源:RenderWorld_defs.cpp

示例4: Wait_f

/*
============
idCmdSystemLocal::Wait_f

Causes execution of the remainder of the command buffer to be delayed until next frame.
============
*/
void idCmdSystemLocal::Wait_f( const idCmdArgs &args ) {
	if ( args.Argc() == 2 ) {
		cmdSystemLocal.SetWait( atoi( args.Argv( 1 ) ) );
	} else {
		cmdSystemLocal.SetWait( 1 );
	}
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:14,代码来源:CmdSystem.cpp

示例5: ListByFlags

void idCmdSystemLocal::ListByFlags( const idCmdArgs &args, cmdFlags_t flags ) {
	int i;
	idStr match;
	const commandDef_t *cmd;
	idList<const commandDef_t *> cmdList;

	if ( args.Argc() > 1 ) {
		match = args.Args( 1, -1 );
		match.Remove( ' ' );
	} else {
		match = "";
	}

	for ( cmd = cmdSystemLocal.GetCommands(); cmd; cmd = cmd->next ) {
		if ( !( cmd->flags & flags ) ) {
			continue;
		}
		if ( match.Length() && idStr( cmd->name ).Filter( match, false ) == 0 ) {
			continue;
		}

		cmdList.Append( cmd );
	}

	cmdList.Sort();

	for ( i = 0; i < cmdList.Num(); i++ ) {
		cmd = cmdList[i];

		common->Printf( "  %-21s %s\n", cmd->name, cmd->description );
	}

	common->Printf( "%i commands\n", cmdList.Num() );
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:34,代码来源:CmdSystem.cpp

示例6: TestAnim

/*
================
idTestModel::TestAnim
================
*/
void idTestModel::TestAnim( const idCmdArgs &args ) {
	idStr			name;
	int				animNum;

	if ( args.Argc() < 2 ) {
		gameLocal.Printf( "usage: testanim <animname>\n" );
		return;
	}


	name = args.Argv( 1 );
#if 0
	const idAnim	*newanim = NULL;
	if ( strstr( name, ".ma" ) || strstr( name, ".mb" ) ) {
		const idMD5Anim	*md5anims[ ANIM_MaxSyncedAnims ];
		idModelExport exporter;
		exporter.ExportAnim( name );
		name.SetFileExtension( MD5_ANIM_EXT );
		md5anims[ 0 ] = animationLib.GetAnim( name );
		if ( md5anims[ 0 ] ) {
			customAnim.SetAnim( animator.ModelDef(), name, name, 1, md5anims );
			newanim = &customAnim;
		}
	} else {
		animNum = animator.GetAnim( name );
	}
#else
	animNum = animator.GetAnim( name );
#endif

	if ( !animNum ) {
		gameLocal.Printf( "Animation '%s' not found.\n", name.c_str() );
		return;
	}

	anim = animNum;
	starttime = gameLocal.time;
	animtime = animator.AnimLength( anim );
	headAnim = 0;
	if ( headAnimator ) {
		headAnimator->ClearAllAnims( gameLocal.time, 0 );
        headAnim = headAnimator->GetAnim( animname );
		if ( !headAnim ) {
			headAnim = headAnimator->GetAnim( "idle" );
			if ( !headAnim ) {
				gameLocal.Printf( "Missing 'idle' anim for head.\n" );
			}
		}

		if ( headAnim && ( headAnimator->AnimLength( headAnim ) > animtime ) ) {
			animtime = headAnimator->AnimLength( headAnim );
		}
	}

	animname = name;
	gameLocal.Printf( "anim '%s', %d.%03d seconds, %d frames\n", animname.c_str(), animator.AnimLength( anim ) / 1000, animator.AnimLength( anim ) % 1000, animator.NumFrames( anim ) );

	// reset the anim
	mode = -1;
}
开发者ID:angjminer,项目名称:morpheus,代码行数:65,代码来源:Anim_Testmodel.cpp

示例7: Parse_f

/*
============
idCmdSystemLocal::Parse_f

This just prints out how the rest of the line was parsed, as a debugging tool.
============
*/
void idCmdSystemLocal::Parse_f( const idCmdArgs &args ) {
	int		i;

	for ( i = 0; i < args.Argc(); i++ ) {
		common->Printf( "%i: %s\n", i, args.Argv(i) );
	}
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:14,代码来源:CmdSystem.cpp

示例8: RunReach_f

/*
============
RunReach_f
============
*/
void RunReach_f( const idCmdArgs &args ) {
	int i;
	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->Warning( "Unable to find '%s' in def/aas.def", kv->GetValue().c_str() );
		} else {
			settings.FromDict( kv->GetValue(), settingsDict );
			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:SL987654,项目名称:The-Darkmod-Experimental,代码行数:38,代码来源:AASBuild.cpp

示例9: TestSkin_f

/*
=================
idTestModel::TestSkin_f

Sets a skin on an existing testModel
=================
*/
void idTestModel::TestSkin_f( const idCmdArgs& args )
{
	idVec3		offset;
	idStr		name;
	idPlayer* 	player;
	idDict		dict;
	
	player = gameLocal.GetLocalPlayer();
	if( !player || !gameLocal.CheatsOk() )
	{
		return;
	}
	
	// delete the testModel if active
	if( !gameLocal.testmodel )
	{
		common->Printf( "No active testModel\n" );
		return;
	}
	
	if( args.Argc() < 2 )
	{
		common->Printf( "removing testSkin.\n" );
		gameLocal.testmodel->SetSkin( NULL );
		return;
	}
	
	name = args.Argv( 1 );
	gameLocal.testmodel->SetSkin( declManager->FindSkin( name ) );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:37,代码来源:Anim_Testmodel.cpp

示例10: Exec_f

/*
===============
idCmdSystemLocal::Exec_f
===============
*/
void idCmdSystemLocal::Exec_f( const idCmdArgs& args )
{
	char* 	f;
	int		len;
	idStr	filename;
	
	if( args.Argc() != 2 )
	{
		common->Printf( "exec <filename> : execute a script file\n" );
		return;
	}
	
	filename = args.Argv( 1 );
	filename.DefaultFileExtension( ".cfg" );
	len = fileSystem->ReadFile( filename, reinterpret_cast<void**>( &f ), NULL );
	if( !f )
	{
		common->Printf( "couldn't exec %s\n", args.Argv( 1 ) );
		return;
	}
	common->Printf( "execing %s\n", args.Argv( 1 ) );
	
	cmdSystemLocal.BufferCommandText( CMD_EXEC_INSERT, f );
	
	fileSystem->FreeFile( f );
}
开发者ID:cs121,项目名称:TECH4-BFG,代码行数:31,代码来源:CmdSystem.cpp

示例11: 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:revelator,项目名称:Revelator-Doom3,代码行数:33,代码来源:CVarSystem.cpp

示例12: RunAAS_f

/*
============
RunAAS_f
============
*/
void RunAAS_f( const idCmdArgs &args )
{
	idAASBuild		aas;
	idAASSettings	settings;
	idStr			mapName;
	
	if( args.Argc() <= 1 )
	{
		common->Printf( "runAAS [options] <mapfile>\n"
						"options:\n"
						"  -usePatches        = use bezier patches for collision detection.\n"
						"  -writeBrushMap     = write a brush map with the AAS geometry.\n"
						"  -playerFlood       = use player spawn points as valid AAS positions.\n" );
		return;
	}
	common->ClearWarnings( "compiling AAS" );
	
	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 );
			mapName = args.Argv( i );
			mapName.BackSlashesToSlashes();
			
			if( mapName.Icmpn( "maps/", 4 ) != 0 )
			{
				mapName = "maps/" + mapName;
			}
			aas.Build( mapName, &settings );
		}
		
		kv = dict->MatchPrefix( "type", kv );
		
		if( kv )
		{
			common->Printf( "=======================================================\n" );
		}
	}
	common->SetRefreshOnPrint( false );
	common->PrintWarnings();
}
开发者ID:revelator,项目名称:MHDoom,代码行数:65,代码来源:AASBuild.cpp

示例13: TestModel_f

/*
=================
idTestModel::TestModel_f

Creates a static modelDef in front of the current position, which
can then be moved around
=================
*/
void idTestModel::TestModel_f( const idCmdArgs &args ) {
	idVec3			offset;
	idStr			name;
	idPlayer *		player;
	const idDict *	entityDef;
	idDict			dict;

	player = gameLocal.GetLocalPlayer();
	if ( !player || !gameLocal.CheatsOk() ) {
		return;
	}

	// delete the testModel if active
	if ( gameLocal.testmodel ) {
		delete gameLocal.testmodel;
		gameLocal.testmodel = NULL;
	}

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

	name = args.Argv( 1 );

	entityDef = gameLocal.FindEntityDefDict( name, false );
	if ( entityDef ) {
		dict = *entityDef;
	} else {
		if ( declManager->FindType( DECL_MODELDEF, name, false ) ) {
			dict.Set( "model", name );
		} else {
			// allow map models with underscore prefixes to be tested during development
			// without appending an ase
			if ( name[ 0 ] != '_' ) {
				name.DefaultFileExtension( ".ase" );
			} 
			
			if ( strstr( name, ".ma" ) || strstr( name, ".mb" ) ) {
				idModelExport exporter;
				exporter.ExportModel( name );
				name.SetFileExtension( MD5_MESH_EXT );
			}

			if ( !renderModelManager->CheckModel( name ) ) {
				gameLocal.Printf( "Can't register model\n" );
				return;
			}
			dict.Set( "model", name );
		}
	}

	offset = player->GetPhysics()->GetOrigin() + player->viewAngles.ToForward() * 100.0f;

	dict.Set( "origin", offset.ToString() );
	dict.Set( "angle", va( "%f", player->viewAngles.yaw + 180.0f ) );
	dict.Set( "def_head", g_testModelHead.GetString());
	gameLocal.testmodel = ( idTestModel * )gameLocal.SpawnEntityType( idTestModel::Type, &dict );
	gameLocal.testmodel->renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
}
开发者ID:dolanor,项目名称:TheDarkMod,代码行数:67,代码来源:Anim_Testmodel.cpp

示例14: Echo_f

/*
===============
idCmdSystemLocal::Echo_f

Just prints the rest of the line to the console
===============
*/
void idCmdSystemLocal::Echo_f( const idCmdArgs &args ) {
	int		i;
	
	for ( i = 1; i < args.Argc(); i++ ) {
		common->Printf( "%s ", args.Argv( i ) );
	}
	common->Printf( "\n" );
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:15,代码来源:CmdSystem.cpp

示例15: void

/*
============
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 );
    common->FatalError("idCmdSystemLocal::ArgCompletion_FolderExtension TODO");
#ifdef TODO
    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:sbrown345,项目名称:doom3_emscripten,代码行数:62,代码来源:CmdSystem.cpp


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