本文整理汇总了C++中ConfigFile::GetFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::GetFloat方法的具体用法?C++ ConfigFile::GetFloat怎么用?C++ ConfigFile::GetFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::GetFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreInitialVolumes
void RestoreInitialVolumes()
{
OBSSetDesktopVolume(config.GetFloat(TEXT("General"), TEXT("PrevDesktopVolume")), true);
OBSSetMicVolume(config.GetFloat(TEXT("General"), TEXT("PrevMicVolume")), true);
if(config.GetInt(TEXT("General"), TEXT("PrevDesktopMuted")) == 1)
OBSToggleDesktopMute();
if(config.GetInt(TEXT("General"), TEXT("PrevMicMuted")) ==1)
OBSToggleMicMute();
}
示例2: LoadFromFile
BOOL Material::LoadFromFile(CTSTR lpFile)
{
traceIn(Material::LoadFromFile);
String path;
ConfigFile materialFile;
if(!materialFile.Open(lpFile))
{
AppWarning(TEXT("Couldn't load material file '%s'"), lpFile);
return FALSE;
}
effect = ::GetEffect(materialFile.GetString(TEXT("Material"), TEXT("Effect")));
if(!effect)
{
AppWarning(TEXT("Invalid effect in material file '%s'"), lpFile);
return FALSE;
}
String soundName = materialFile.GetString(TEXT("Material"), TEXT("SoftSound"));
if(soundName.IsValid()) SetSoftHitSound(soundName);
soundName = materialFile.GetString(TEXT("Material"), TEXT("HardSound"));
if(soundName.IsValid()) SetHardHitSound(soundName);
restitution = materialFile.GetFloat(TEXT("Material"), TEXT("Restitution"));
friction = materialFile.GetFloat(TEXT("Material"), TEXT("Friction"), 0.5f);
DWORD curParamID = 0;
HANDLE hCurParam;
while(hCurParam = effect->GetParameter(curParamID++))
{
EffectParameterInfo paramInfo;
effect->GetEffectParameterInfo(hCurParam, paramInfo);
if(paramInfo.propertyType != EffectProperty_None)
{
if(paramInfo.propertyType == EffectProperty_Texture)
{
MaterialParameter *param = Params.CreateNew();
param->type = Parameter_Texture;
param->handle = hCurParam;
*(BaseTexture**)param->data = GetTexture(materialFile.GetString(TEXT("Parameters"), paramInfo.name));
}
else if(paramInfo.propertyType == EffectProperty_Color)
{
MaterialParameter *param = Params.CreateNew();
param->type = Parameter_Vector3;
param->handle = hCurParam;
Vect chi = materialFile.GetColor3(TEXT("Parameters"), paramInfo.name);
mcpy(param->data, &chi, sizeof(Vect));
}
else if(paramInfo.propertyType == EffectProperty_Float)
{
MaterialParameter *param = Params.CreateNew();
param->type = Parameter_Float;
param->handle = hCurParam;
*(float*)param->data = materialFile.GetFloat(TEXT("Parameters"), paramInfo.name)*paramInfo.fMul;
}
}
}
return TRUE;
traceOut;
}