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


C++ ConfigFile::GetFloat方法代码示例

本文整理汇总了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();
}
开发者ID:Alucard014,项目名称:OBS,代码行数:12,代码来源:psvplugin.cpp

示例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;
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:68,代码来源:Material.cpp


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