Skip to content
Permalink
Browse files

Add missing high_detail_peds setting that was supposed to be added in #…

…231 (#832)

* Add missing high_detail_peds setting that was supposed to be added in #231

* Reset LOD distances upon save/default

* Remove old comments

* Set maximum lod for vehs and peds and reset to the min of all sources

* Update make_uname.bat

* Fix autofixed whitespace
  • Loading branch information...
patrikjuvonen committed May 28, 2019
1 parent b970ccb commit 67447ca163691c3a5d8a729992d7d3e254ca86a5
@@ -328,6 +328,7 @@ void CClientVariables::LoadDefaults()
DEFAULT("heat_haze", 1); // Enable heat haze
DEFAULT("tyre_smoke_enabled", 1); // Enable tyre smoke
DEFAULT("high_detail_vehicles", 0); // Disable rendering high detail vehicles all the time
DEFAULT("high_detail_peds", 0); // Disable rendering high detail peds all the time
DEFAULT("fast_clothes_loading", 1); // 0-off 1-auto 2-on
DEFAULT("allow_screen_upload", 1); // 0-off 1-on
DEFAULT("max_clientscript_log_kb", 5000); // Max size in KB (0-No limit)
@@ -552,7 +552,8 @@ void CCore::ApplyGameSettings()
CVARS_GET("tyre_smoke_enabled", bVal);
m_pMultiplayer->SetTyreSmokeEnabled(bVal);
pGameSettings->UpdateFieldOfViewFromSettings();
pGameSettings->ResetVehiclesLODDistance();
pGameSettings->ResetVehiclesLODDistance(false);
pGameSettings->ResetPedsLODDistance(false);
pController->SetVerticalAimSensitivityRawValue(CVARS_GET_VALUE<float>("vertical_aim_sensitivity"));
CVARS_GET("mastervolume", fVal);
pGameSettings->SetRadioVolume(pGameSettings->GetRadioVolume() * fVal);
@@ -1,6 +1,6 @@
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* PROJECT: Multi Theft Auto
* LICENSE: See LICENSE in the top level directory
* FILE: core/CSettings.cpp
* PURPOSE: In-game settings window
@@ -14,11 +14,11 @@

using namespace std;

#define CORE_MTA_FILLER "cgui\\images\\mta_filler.png"
#define CORE_SETTINGS_UPDATE_INTERVAL 30 // Settings update interval in frames
#define CORE_SETTINGS_HEADERS 3
#define CORE_SETTINGS_HEADER_SPACER " "
#define CORE_SETTINGS_NO_KEY " "
#define CORE_MTA_FILLER "cgui\\images\\mta_filler.png"
#define CORE_SETTINGS_UPDATE_INTERVAL 30 // Settings update interval in frames
#define CORE_SETTINGS_HEADERS 3
#define CORE_SETTINGS_HEADER_SPACER " "
#define CORE_SETTINGS_NO_KEY " "

extern CCore* g_pCore;
extern SBindableGTAControl g_bcControls[];
@@ -662,7 +662,7 @@ void CSettings::CreateGUI()

vecTemp.fX = 11;
m_pDrawDistanceLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("Draw Distance:")));
m_pDrawDistanceLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
m_pDrawDistanceLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 26.0f));
m_pDrawDistanceLabel->GetPosition(vecTemp, false);
m_pDrawDistanceLabel->AutoSize();

@@ -680,7 +680,7 @@ void CSettings::CreateGUI()
vecTemp.fX = 11;

m_pBrightnessLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("Brightness:")));
m_pBrightnessLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f));
m_pBrightnessLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 26.0f));
m_pBrightnessLabel->GetPosition(vecTemp, false);
m_pBrightnessLabel->AutoSize();

@@ -698,7 +698,7 @@ void CSettings::CreateGUI()
vecTemp.fX = 11;

m_pFXQualityLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("FX Quality:")));
m_pFXQualityLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f));
m_pFXQualityLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
m_pFXQualityLabel->GetPosition(vecTemp, false);
m_pFXQualityLabel->AutoSize();

@@ -712,7 +712,7 @@ void CSettings::CreateGUI()
m_pComboFxQuality->SetReadOnly(true);

m_pAnisotropicLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("Anisotropic filtering:")));
m_pAnisotropicLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 29.0f));
m_pAnisotropicLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
m_pAnisotropicLabel->GetPosition(vecTemp, false);
m_pAnisotropicLabel->AutoSize();

@@ -753,7 +753,7 @@ void CSettings::CreateGUI()
m_pComboAntiAliasing->SetReadOnly(true);

m_pAspectRatioLabel = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(pTabVideo, _("Aspect Ratio:")));
m_pAspectRatioLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 30.0f));
m_pAspectRatioLabel->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 26.0f));
m_pAspectRatioLabel->GetPosition(vecTemp, false);
m_pAspectRatioLabel->AutoSize();

@@ -769,7 +769,7 @@ void CSettings::CreateGUI()
m_pComboAspectRatio->SetReadOnly(true);

m_pCheckBoxHudMatchAspectRatio = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("HUD Match Aspect Ratio"), true));
m_pCheckBoxHudMatchAspectRatio->SetPosition(CVector2D(vecTemp.fX + vecSize.fX + 10.0f, vecTemp.fY + 3.0f));
m_pCheckBoxHudMatchAspectRatio->SetPosition(CVector2D(vecTemp.fX + vecSize.fX + 10.0f, vecTemp.fY + 4.0f));
m_pCheckBoxHudMatchAspectRatio->AutoSize(NULL, 20.0f);

vecTemp.fX = 11;
@@ -794,6 +794,10 @@ void CSettings::CreateGUI()
m_pCheckBoxHighDetailVehicles->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 110.0f));
m_pCheckBoxHighDetailVehicles->AutoSize(NULL, 20.0f);

m_pCheckBoxHighDetailPeds = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Render peds always in high detail"), true));
m_pCheckBoxHighDetailPeds->SetPosition(CVector2D(vecTemp.fX, vecTemp.fY + 130.0f));
m_pCheckBoxHighDetailPeds->AutoSize(NULL, 20.0f);

float fPosY = vecTemp.fY;
m_pCheckBoxMinimize = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(pTabVideo, _("Full Screen Minimize"), true));
m_pCheckBoxMinimize->SetPosition(CVector2D(vecTemp.fX + 245.0f, fPosY + 30.0f));
@@ -1091,7 +1095,7 @@ void CSettings::CreateGUI()
// Hide if not Win8
if (atoi(GetApplicationSetting("real-os-version")) != 8)
{
#ifndef MTA_DEBUG // Don't hide when debugging
#ifndef MTA_DEBUG // Don't hide when debugging
m_pWin8Label->SetVisible(false);
m_pWin8ColorCheckBox->SetVisible(false);
m_pWin8MouseCheckBox->SetVisible(false);
@@ -1515,6 +1519,11 @@ void CSettings::UpdateVideoTab()
CVARS_GET("high_detail_vehicles", bHighDetailVehicles);
m_pCheckBoxHighDetailVehicles->SetSelected(bHighDetailVehicles);

// High detail peds
bool bHighDetailPeds;
CVARS_GET("high_detail_peds", bHighDetailPeds);
m_pCheckBoxHighDetailPeds->SetSelected(bHighDetailPeds);

PopulateResolutionComboBox();

// Fullscreen style
@@ -1738,11 +1747,14 @@ bool CSettings::OnVideoDefaultClick(CGUIElement* pElement)
CVARS_SET("heat_haze", true);
CVARS_SET("tyre_smoke_enabled", true);
CVARS_SET("high_detail_vehicles", false);
CVARS_SET("high_detail_peds", false);
gameSettings->UpdateFieldOfViewFromSettings();
gameSettings->SetDrawDistance(1.19625f); // All values taken from a default SA install, no gta_sa.set or coreconfig.xml modifications.
gameSettings->SetBrightness(253);
gameSettings->SetFXQuality(2);
gameSettings->SetAntiAliasing(1, true);
gameSettings->ResetVehiclesLODDistance(false);
gameSettings->ResetPedsLODDistance(false);

// change
bool bIsVideoModeChanged = GetVideoModeManager()->SetVideoMode(0, false, false, FULLSCREEN_STANDARD);
@@ -3315,9 +3327,15 @@ void CSettings::SaveData()
CVARS_SET("tyre_smoke_enabled", bTyreSmokeEnabled);
g_pCore->GetMultiplayer()->SetTyreSmokeEnabled(bTyreSmokeEnabled);

// High detail vehicles (just set cvar, real change occur on next connect)
// High detail vehicles
bool bHighDetailVehicles = m_pCheckBoxHighDetailVehicles->GetSelected();
CVARS_SET("high_detail_vehicles", bHighDetailVehicles);
gameSettings->ResetVehiclesLODDistance(false);

// High detail peds
bool bHighDetailPeds = m_pCheckBoxHighDetailPeds->GetSelected();
CVARS_SET("high_detail_peds", bHighDetailPeds);
gameSettings->ResetPedsLODDistance(false);

// Fast clothes loading
if (CGUIListItem* pSelected = m_pFastClothesCombo->GetSelectedItem())
@@ -156,6 +156,7 @@ class CSettings
CGUICheckBox* m_pCheckBoxHeatHaze;
CGUICheckBox* m_pCheckBoxTyreSmokeParticles;
CGUICheckBox* m_pCheckBoxHighDetailVehicles;
CGUICheckBox* m_pCheckBoxHighDetailPeds;
CGUILabel* m_pFieldOfViewLabel;
CGUIScrollBar* m_pFieldOfView;
CGUILabel* m_pFieldOfViewValueLabel;
@@ -755,6 +755,7 @@ void CRenderItemManager::GetDxStatus(SDxStatus& outStatus)
outStatus.settings.bHUDMatchAspectRatio = true;
outStatus.settings.fFieldOfView = 70;
outStatus.settings.bHighDetailVehicles = false;
outStatus.settings.bHighDetailPeds = false;

CVARS_GET("streaming_memory", outStatus.settings.iStreamingMemory);
CVARS_GET("volumetric_shadows", outStatus.settings.bVolumetricShadows);
@@ -765,6 +766,7 @@ void CRenderItemManager::GetDxStatus(SDxStatus& outStatus)
CVARS_GET("hud_match_aspect_ratio", outStatus.settings.bHUDMatchAspectRatio);
CVARS_GET("fov", outStatus.settings.fFieldOfView);
CVARS_GET("high_detail_vehicles", outStatus.settings.bHighDetailVehicles);
CVARS_GET("high_detail_peds", outStatus.settings.bHighDetailPeds);

if (outStatus.settings.iFXQuality == 0)
{

0 comments on commit 67447ca

Please sign in to comment.
You can’t perform that action at this time.