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


C++ FConfigFile::GetString方法代码示例

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


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

示例1: CanCookForPlatformInThisProcess

bool CanCookForPlatformInThisProcess( const FString& PlatformName )
{
	////////////////////////////////////////
	// hack remove this hack when we properly support changing the mobileHDR setting 
	// check if our mobile hdr setting in memory is different from the one which is saved in the config file
	
	
	FConfigFile PlatformEngineIni;
	GConfig->LoadLocalIniFile(PlatformEngineIni, TEXT("Engine"), true, *PlatformName );

	FString IniValueString;
	bool ConfigSetting = false;
	if ( PlatformEngineIni.GetString( TEXT("/Script/Engine.RendererSettings"), TEXT("r.MobileHDR"), IniValueString ) == false )
	{
		// must always match the RSetting setting because we don't have a config setting
		return true; 
	}
	ConfigSetting = IniValueString.ToBool();

	// this was stolen from void IsMobileHDR()
	static auto* MobileHDRCvar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MobileHDR"));
	const bool CurrentRSetting = MobileHDRCvar->GetValueOnAnyThread() == 1;

	if ( CurrentRSetting != ConfigSetting )
	{
		UE_LOG(LogUnrealEdEngine, Warning, TEXT("Unable to use cook in editor because r.MobileHDR from Engine ini doesn't match console value r.MobileHDR"));
		return false;
	}
	////////////////////////////////////////
	return true;
}
开发者ID:johndpope,项目名称:UE4,代码行数:31,代码来源:UnrealEdEngine.cpp

示例2: ReadEntry

void FTextureLODSettings::ReadEntry( int32 GroupId, const TCHAR* GroupName, const FConfigFile& IniFile, const TCHAR* IniSection )
{
	// Look for string in filename/ section.
	FString Entry;
	if (IniFile.GetString(IniSection, GroupName, Entry))
	{
		// Trim whitespace at the beginning.
		Entry = Entry.Trim();
		// Remove brackets.
		Entry = Entry.Replace( TEXT("("), TEXT("") );
		Entry = Entry.Replace( TEXT(")"), TEXT("") );
		
		// Parse minimum LOD mip count.
		int32	MinLODSize = 0;
		if( FParse::Value( *Entry, TEXT("MinLODSize="), MinLODSize ) )
		{
			TextureLODGroups[GroupId].MinLODMipCount = FMath::CeilLogTwo( MinLODSize );
		}

		// Parse maximum LOD mip count.
		int32 MaxLODSize = 0;
		if( FParse::Value( *Entry, TEXT("MaxLODSize="), MaxLODSize ) )
		{
			TextureLODGroups[GroupId].MaxLODMipCount = FMath::CeilLogTwo( MaxLODSize );
		}

		// Parse LOD bias.
		int32 LODBias = 0;
		if( FParse::Value( *Entry, TEXT("LODBias="), LODBias ) )
		{
			TextureLODGroups[GroupId].LODBias = LODBias;
		}

		// Parse min/map/mip filter names.
		FName MinMagFilter = NAME_Aniso;
		FParse::Value( *Entry, TEXT("MinMagFilter="), MinMagFilter );
		FName MipFilter = NAME_Point;
		FParse::Value( *Entry, TEXT("MipFilter="), MipFilter );

		{
			FString MipGenSettings;
			FParse::Value( *Entry, TEXT("MipGenSettings="), MipGenSettings );
			TextureLODGroups[GroupId].MipGenSettings = UTexture::GetMipGenSettingsFromString(*MipGenSettings, true);
		}

		// Convert into single filter enum. The code is layed out such that invalid input will 
		// map to the default state of highest quality filtering.

		// Linear filtering
		if( MinMagFilter == NAME_Linear )
		{
			if( MipFilter == NAME_Point )
			{
				TextureLODGroups[GroupId].Filter = SF_Bilinear;
			}
			else
			{
				TextureLODGroups[GroupId].Filter = SF_Trilinear;
			}
		}
		// Point. Don't even care about mip filter.
		else if( MinMagFilter == NAME_Point )
		{
			TextureLODGroups[GroupId].Filter = SF_Point;
		}
		// Aniso or unknown.
		else
		{
			if( MipFilter == NAME_Point )
			{
				TextureLODGroups[GroupId].Filter = SF_AnisotropicPoint;
			}
			else
			{
				TextureLODGroups[GroupId].Filter = SF_AnisotropicLinear;
			}
		}

		// Parse NumStreamedMips
		int32 NumStreamedMips = -1;
		if( FParse::Value( *Entry, TEXT("NumStreamedMips="), NumStreamedMips ) )
		{
			TextureLODGroups[GroupId].NumStreamedMips = NumStreamedMips;
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:86,代码来源:Texture.cpp


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