|
|
@ -38,16 +38,19 @@ void CDisplaySettingsDetailsWidget::load()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
|
|
|
|
|
|
|
|
landscapeSlider->setValue( getQuality( qualityToLandscapeThreshold, s.config.getFloat( "LandscapeThreshold" ) ) );
|
|
|
|
// landscape
|
|
|
|
landscapeSlider->setValue( std::min( landscapeSlider->value(), getQuality( qualityToZFar, s.config.getFloat( "Vision" ) ) ) );
|
|
|
|
landscapeSlider->setValue(getQualityPresetFloat("LandscapeTileNear"));
|
|
|
|
landscapeSlider->setValue( std::min( landscapeSlider->value(), getQuality( qualityToLandscapeTileNear, s.config.getFloat( "LandscapeTileNear" ) ) ) );
|
|
|
|
landscapeSlider->setValue(std::min(landscapeSlider->value(), getQualityPresetFloat("LandscapeThreshold")));
|
|
|
|
landscapeSlider->setValue( std::min( landscapeSlider->value(), getQuality( qualityToMicrovegetDensity, s.config.getFloat( "MicroVegetDensity" ) ) ) );
|
|
|
|
landscapeSlider->setValue(std::min(landscapeSlider->value(), getQualityPresetFloat("Vision")));
|
|
|
|
|
|
|
|
landscapeSlider->setValue(std::min(landscapeSlider->value(), getQualityPresetFloat("MicroVegetDensity")));
|
|
|
|
|
|
|
|
|
|
|
|
charactersSlider->setValue( getQuality( qualityToSkinNbMaxPoly, s.config.getInt( "SkinNbMaxPoly" ) ) );
|
|
|
|
// FX
|
|
|
|
charactersSlider->setValue( std::min( charactersSlider->value(), getQuality( qualityToNbMaxSkeletonNotCLod, s.config.getInt( "NbMaxSkeletonNotCLod" ) ) ) );
|
|
|
|
fxSlider->setValue(getQualityPresetInteger("FxNbMaxPoly"));
|
|
|
|
charactersSlider->setValue( std::min( charactersSlider->value(), getQuality( qualityToCharacterFarClip, s.config.getFloat( "CharacterFarClip" ) ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fxSlider->setValue( getQuality( qualityToFxNbMaxPoly, s.config.getInt( "FxNbMaxPoly" ) ) );
|
|
|
|
// characters
|
|
|
|
|
|
|
|
charactersSlider->setValue(getQualityPresetInteger("SkinNbMaxPoly"));
|
|
|
|
|
|
|
|
charactersSlider->setValue(std::min(charactersSlider->value(), getQualityPresetInteger("NbMaxSkeletonNotCLod")));
|
|
|
|
|
|
|
|
charactersSlider->setValue(std::min(charactersSlider->value(), getQualityPresetFloat("CharacterFarClip")));
|
|
|
|
|
|
|
|
|
|
|
|
int hdTextureInstalled = s.config.getInt("HDTextureInstalled");
|
|
|
|
int hdTextureInstalled = s.config.getInt("HDTextureInstalled");
|
|
|
|
if (hdTextureInstalled == 1)
|
|
|
|
if (hdTextureInstalled == 1)
|
|
|
@ -70,38 +73,30 @@ void CDisplaySettingsDetailsWidget::save()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
|
|
|
|
|
|
|
|
s.config.setFloat( "Vision", qualityToZFar[ landscapeSlider->value() ] );
|
|
|
|
// landscape
|
|
|
|
s.config.setFloat( "LandscapeTileNear", qualityToLandscapeTileNear[ landscapeSlider->value() ] );
|
|
|
|
setFloatPreset("LandscapeTileNear", landscapeSlider->value());
|
|
|
|
s.config.setFloat( "LandscapeThreshold", qualityToLandscapeThreshold[ landscapeSlider->value() ] );
|
|
|
|
setFloatPreset("LandscapeThreshold", landscapeSlider->value());
|
|
|
|
|
|
|
|
setFloatPreset("Vision", landscapeSlider->value());
|
|
|
|
if( landscapeSlider->value() > QUALITY_LOW )
|
|
|
|
setIntegerPreset("MicroVeget", landscapeSlider->value());
|
|
|
|
s.config.setInt( "MicroVeget", 1 );
|
|
|
|
setFloatPreset("MicroVegetDensity", landscapeSlider->value());
|
|
|
|
else
|
|
|
|
|
|
|
|
s.config.setInt( "MicroVeget", 0 );
|
|
|
|
// FX
|
|
|
|
|
|
|
|
setIntegerPreset("FxNbMaxPoly", fxSlider->value());
|
|
|
|
s.config.setFloat( "MicroVegetDensity", qualityToMicrovegetDensity[ landscapeSlider->value() ] );
|
|
|
|
setIntegerPreset("Cloud", fxSlider->value());
|
|
|
|
|
|
|
|
setFloatPreset("CloudQuality", fxSlider->value());
|
|
|
|
|
|
|
|
setIntegerPreset("CloudUpdate", fxSlider->value());
|
|
|
|
s.config.setInt( "SkinNbMaxPoly", qualityToSkinNbMaxPoly[ charactersSlider->value() ] );
|
|
|
|
setIntegerPreset("Shadows", fxSlider->value());
|
|
|
|
s.config.setInt( "NbMaxSkeletonNotCLod", qualityToNbMaxSkeletonNotCLod[ charactersSlider->value() ] );
|
|
|
|
setIntegerPreset("FXAA", fxSlider->value());
|
|
|
|
s.config.setFloat( "CharacterFarClip", qualityToCharacterFarClip[ charactersSlider->value() ] );
|
|
|
|
setIntegerPreset("Bloom", fxSlider->value());
|
|
|
|
|
|
|
|
setIntegerPreset("SquareBloom", fxSlider->value());
|
|
|
|
|
|
|
|
setFloatPreset("DensityBloom", fxSlider->value());
|
|
|
|
s.config.setInt( "FxNbMaxPoly", qualityToFxNbMaxPoly[ fxSlider->value() ] );
|
|
|
|
|
|
|
|
if( fxSlider->value() > QUALITY_LOW )
|
|
|
|
// characters
|
|
|
|
{
|
|
|
|
setIntegerPreset("SkinNbMaxPoly", charactersSlider->value());
|
|
|
|
s.config.setInt( "Shadows", 1 );
|
|
|
|
setIntegerPreset("NbMaxSkeletonNotCLod", charactersSlider->value());
|
|
|
|
s.config.setInt( "Bloom", 1 );
|
|
|
|
setFloatPreset("CharacterFarClip", charactersSlider->value());
|
|
|
|
s.config.setInt( "SquareBloom", 1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
// misc
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
s.config.setInt( "Shadows", 0 );
|
|
|
|
|
|
|
|
s.config.setInt( "Bloom", 0 );
|
|
|
|
|
|
|
|
s.config.setInt( "SquareBloom", 0 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( texturesSlider->value() == QUALITY_NORMAL )
|
|
|
|
if( texturesSlider->value() == QUALITY_NORMAL )
|
|
|
|
s.config.setInt( "HDEntityTexture", 1 );
|
|
|
|
s.config.setInt( "HDEntityTexture", 1 );
|
|
|
|
else if( texturesSlider->value() == QUALITY_LOW )
|
|
|
|
else if( texturesSlider->value() == QUALITY_LOW )
|
|
|
@ -144,71 +139,89 @@ void CDisplaySettingsDetailsWidget::onTexturesSliderChange( int value )
|
|
|
|
emit changed();
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const float CDisplaySettingsDetailsWidget::qualityToZFar[ QUALITY_STEP ] =
|
|
|
|
float CDisplaySettingsDetailsWidget::getPresetFloat(const std::string &variable, sint preset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
200.0f,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
400.0f,
|
|
|
|
|
|
|
|
500.0f,
|
|
|
|
|
|
|
|
800.0f
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float CDisplaySettingsDetailsWidget::qualityToLandscapeTileNear[ QUALITY_STEP ] =
|
|
|
|
// preset name
|
|
|
|
|
|
|
|
std::string varName = variable + NLMISC::toString("_ps%d", preset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return s.config.getFloat(varName.c_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CDisplaySettingsDetailsWidget::getPresetInteger(const std::string &variable, sint preset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
20.0f,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
100.0f,
|
|
|
|
|
|
|
|
150.0f,
|
|
|
|
// preset name
|
|
|
|
200.0f
|
|
|
|
std::string varName = variable + NLMISC::toString("_ps%d", preset);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float CDisplaySettingsDetailsWidget::qualityToLandscapeThreshold[ QUALITY_STEP ] =
|
|
|
|
return s.config.getInt(varName.c_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CDisplaySettingsDetailsWidget::setFloatPreset(const std::string &variable, int preset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
100.0f,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
1000.0f,
|
|
|
|
|
|
|
|
2000.0f,
|
|
|
|
|
|
|
|
3000.0f
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// take value of the preset and set it to variable
|
|
|
|
|
|
|
|
s.config.setFloat(variable.c_str(), getPresetFloat(variable, preset));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const float CDisplaySettingsDetailsWidget::qualityToMicrovegetDensity[ QUALITY_STEP ] =
|
|
|
|
void CDisplaySettingsDetailsWidget::setIntegerPreset(const std::string &variable, int preset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
10.0f,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
30.0f,
|
|
|
|
|
|
|
|
80.0f,
|
|
|
|
|
|
|
|
100.0f
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// take value of the preset and set it to variable
|
|
|
|
|
|
|
|
s.config.setInt(variable.c_str(), getPresetInteger(variable, preset));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const sint32 CDisplaySettingsDetailsWidget::qualityToSkinNbMaxPoly[ QUALITY_STEP ] =
|
|
|
|
int CDisplaySettingsDetailsWidget::getQualityPresetFloat(const std::string &variable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
10000,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
70000,
|
|
|
|
|
|
|
|
100000,
|
|
|
|
float value = s.config.getFloat(variable.c_str());
|
|
|
|
200000
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sint32 CDisplaySettingsDetailsWidget::qualityToNbMaxSkeletonNotCLod[ QUALITY_STEP ] =
|
|
|
|
// ascending order
|
|
|
|
|
|
|
|
if (getPresetFloat(variable, 0) < getPresetFloat(variable, QUALITY_STEP-1))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32 i = 0;
|
|
|
|
|
|
|
|
while((i < QUALITY_STEP) && (getPresetFloat(variable, i) < value) )
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// descending order
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
10,
|
|
|
|
uint32 i = 0;
|
|
|
|
50,
|
|
|
|
while((i < QUALITY_STEP) && (getPresetFloat(variable, i) > value))
|
|
|
|
125,
|
|
|
|
i++;
|
|
|
|
255
|
|
|
|
return i;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const float CDisplaySettingsDetailsWidget::qualityToCharacterFarClip[ QUALITY_STEP ] =
|
|
|
|
int CDisplaySettingsDetailsWidget::getQualityPresetInteger(const std::string &variable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
50.0f,
|
|
|
|
CSystem &s = CSystem::GetInstance();
|
|
|
|
100.0f,
|
|
|
|
|
|
|
|
200.0f,
|
|
|
|
float value = s.config.getFloat(variable.c_str());
|
|
|
|
500.0f
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sint32 CDisplaySettingsDetailsWidget::qualityToFxNbMaxPoly[ QUALITY_STEP ] =
|
|
|
|
// ascending order
|
|
|
|
|
|
|
|
if (getPresetFloat(variable, 0) < getPresetFloat(variable, QUALITY_STEP-1))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
2000,
|
|
|
|
uint32 i = 0;
|
|
|
|
10000,
|
|
|
|
while((i < QUALITY_STEP) && (getPresetFloat(variable, i) < value) )
|
|
|
|
20000,
|
|
|
|
i++;
|
|
|
|
50000
|
|
|
|
return i;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// descending order
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32 i = 0;
|
|
|
|
|
|
|
|
while((i < QUALITY_STEP) && (getPresetFloat(variable, i) > value))
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString CDisplaySettingsDetailsWidget::getQualityString( uint32 quality )
|
|
|
|
QString CDisplaySettingsDetailsWidget::getQualityString( uint32 quality )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -245,7 +258,7 @@ QString CDisplaySettingsDetailsWidget::getTextureQualityString( uint32 quality )
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case TEXQUALITY_HIGH:
|
|
|
|
case TEXQUALITY_HIGH:
|
|
|
|
return tr( "High (128 MB)" );
|
|
|
|
return tr( "High (more than 128 MB)" );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|