Skip to content

Commit

Permalink
Fix log spam. #55
Browse files Browse the repository at this point in the history
This is what you get making commits in the middle of the night.
  • Loading branch information
Lyall committed Sep 11, 2024
1 parent 691a261 commit c9955ad
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HMODULE baseModule = GetModuleHandle(NULL);

// Version
std::string sFixName = "SMTVFix";
std::string sFixVer = "0.9.8a";
std::string sFixVer = "0.9.8b";
std::string sLogFile = sFixName + ".log";

// Logger
Expand Down Expand Up @@ -247,11 +247,6 @@ void Logging()

void ReadConfig()
{
// Log some messages
for (int i = 0; i < 1000000000; ++i) {
logger->info("This is log message number {}", i);
}

// Initialise config
std::ifstream iniFile(sExePath.string() + sConfigFile);
if (!iniFile) {
Expand Down Expand Up @@ -951,7 +946,7 @@ void GraphicalTweaks()

if (bScreenPercentage && ScreenPercentageCVAR->GetFloat() != fScreenPercentage) {
ScreenPercentageCVAR->Set(std::to_wstring(fScreenPercentage).c_str());
ScreenPercentageCVAR->SetFlags(SDK::ECVF_SetByCode);
ScreenPercentageCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.ScreenPercentage to {}", ScreenPercentageCVAR->GetFloat());
}

Expand All @@ -961,23 +956,23 @@ void GraphicalTweaks()
if (AntiAliasingCVAR && AntiAliasingCVAR->GetInt() != 2)
{
AntiAliasingCVAR->Set(L"2");
AntiAliasingCVAR->SetFlags(SDK::ECVF_SetByCode);
AntiAliasingCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.DefaultFeature.AntiAliasing to {}", AntiAliasingCVAR->GetInt());
}

SDK::IConsoleVariable* VertexMotionVectorsCVAR = Unreal::FindCVAR("r.VertexDeformationOutputsVelocity", ConsoleObjects);
if (VertexMotionVectorsCVAR && VertexMotionVectorsCVAR->GetInt() != 1)
{
VertexMotionVectorsCVAR->Set(L"1");
VertexMotionVectorsCVAR->SetFlags(SDK::ECVF_SetByCode);
VertexMotionVectorsCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.VertexDeformationOutputsVelocity to {}", VertexMotionVectorsCVAR->GetInt());
}

SDK::IConsoleVariable* HalfResAOCVAR = Unreal::FindCVAR("r.AmbientOcclusion.HalfRes", ConsoleObjects);
if (HalfResAOCVAR && HalfResAOCVAR->GetInt() != 0)
{
HalfResAOCVAR->Set(L"0");
HalfResAOCVAR->SetFlags(SDK::ECVF_SetByCode);
HalfResAOCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.AmbientOcclusion.HalfRes to {}", HalfResAOCVAR->GetInt());
}

Expand All @@ -987,7 +982,7 @@ void GraphicalTweaks()
if (TAAUAlgorithmCVAR && TAAUAlgorithmCVAR->GetInt() != 1)
{
TAAUAlgorithmCVAR->Set(L"1");
TAAUAlgorithmCVAR->SetFlags(SDK::ECVF_SetByCode);
TAAUAlgorithmCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.TemporalAA.Algorithm to {}", TAAUAlgorithmCVAR->GetInt());
}
}
Expand All @@ -999,7 +994,7 @@ void GraphicalTweaks()
if (AOMethodCVAR && AOMethodCVAR->GetInt() != 1)
{
AOMethodCVAR->Set(L"1");
AOMethodCVAR->SetFlags(SDK::ECVF_SetByCode);
AOMethodCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.AmbientOcclusion.Method to {}", AOMethodCVAR->GetInt());
}

Expand All @@ -1009,7 +1004,7 @@ void GraphicalTweaks()
if (HalfResGTAOCVAR && HalfResGTAOCVAR->GetInt() != 1)
{
HalfResGTAOCVAR->Set(L"1");
HalfResGTAOCVAR->SetFlags(SDK::ECVF_SetByCode);
HalfResGTAOCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.GTAO.Downsample to {}", HalfResGTAOCVAR->GetInt());
}
}
Expand All @@ -1021,23 +1016,23 @@ void GraphicalTweaks()
if (FoliageDistanceCVAR && FoliageDistanceCVAR->GetFloat() != fFoliageDistanceScale)
{
FoliageDistanceCVAR->Set(std::to_wstring(fFoliageDistanceScale).c_str());
FoliageDistanceCVAR->SetFlags(SDK::ECVF_SetByCode);
FoliageDistanceCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set foliage.LODDistanceScale to {}", FoliageDistanceCVAR->GetFloat());
}

SDK::IConsoleVariable* ViewDistanceCVAR = Unreal::FindCVAR("r.ViewDistanceScale", ConsoleObjects);
if (ViewDistanceCVAR && ViewDistanceCVAR->GetFloat() != fViewDistanceScale)
{
ViewDistanceCVAR->Set(std::to_wstring(fViewDistanceScale).c_str());
ViewDistanceCVAR->SetFlags(SDK::ECVF_SetByCode);
ViewDistanceCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.ViewDistanceScale to {}", ViewDistanceCVAR->GetFloat());
}

SDK::IConsoleVariable* SkeletalMeshLODBiasCVAR = Unreal::FindCVAR("r.SkeletalMeshLODBias", ConsoleObjects);
if (SkeletalMeshLODBiasCVAR && SkeletalMeshLODBiasCVAR->GetInt() != -1)
{
SkeletalMeshLODBiasCVAR->Set(L"-1");
SkeletalMeshLODBiasCVAR->SetFlags(SDK::ECVF_SetByCode);
SkeletalMeshLODBiasCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.SkeletalMeshLODBias to {}", SkeletalMeshLODBiasCVAR->GetInt());
}
}
Expand All @@ -1048,7 +1043,7 @@ void GraphicalTweaks()
if (SSAOLevelsCVAR && SSAOLevelsCVAR->GetInt() != iSSAOLevel)
{
SSAOLevelsCVAR->Set(std::to_wstring(iSSAOLevel).c_str());
SSAOLevelsCVAR->SetFlags(SDK::ECVF_SetByCode);
SSAOLevelsCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.AmbientOcclusionLevels to {}", SSAOLevelsCVAR->GetInt());
}
}
Expand All @@ -1059,15 +1054,15 @@ void GraphicalTweaks()
if (SSGIEnableCVAR && SSGIEnableCVAR->GetInt() != 1)
{
SSGIEnableCVAR->Set(L"1");
SSGIEnableCVAR->SetFlags(SDK::ECVF_SetByCode);
SSGIEnableCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.SSGI.Enable to {}", SSGIEnableCVAR->GetInt());
}

SDK::IConsoleVariable* SSGIQualityCVAR = Unreal::FindCVAR("r.SSGI.Quality", ConsoleObjects);
if (SSGIQualityCVAR && SSGIQualityCVAR->GetInt() != iSSGIQuality)
{
SSGIQualityCVAR->Set(std::to_wstring(iSSGIQuality).c_str());
SSGIQualityCVAR->SetFlags(SDK::ECVF_SetByCode);
SSGIQualityCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.SSGI.Quality to {}", SSGIQualityCVAR->GetInt());
}

Expand All @@ -1077,7 +1072,7 @@ void GraphicalTweaks()
if (SSGIHalfResCVAR && SSGIHalfResCVAR->GetInt() != 1)
{
SSGIHalfResCVAR->Set(L"1");
SSGIHalfResCVAR->SetFlags(SDK::ECVF_SetByCode);
SSGIHalfResCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.SSGI.HalfRes to {}", SSGIHalfResCVAR->GetInt());
}
}
Expand All @@ -1089,7 +1084,7 @@ void GraphicalTweaks()
if (TonemapperQualityCVAR && TonemapperQualityCVAR->GetInt() != 0)
{
TonemapperQualityCVAR->Set(L"0");
TonemapperQualityCVAR->SetFlags(SDK::ECVF_SetByCode);
TonemapperQualityCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.Tonemapper.Quality to {}", TonemapperQualityCVAR->GetInt());
}
}
Expand All @@ -1100,7 +1095,7 @@ void GraphicalTweaks()
if (UROEnableCVAR && UROEnableCVAR->GetInt() != 0)
{
UROEnableCVAR->Set(L"0");
UROEnableCVAR->SetFlags(SDK::ECVF_SetByCode);
UROEnableCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set a.URO.Enable to {}", UROEnableCVAR->GetInt());
}
}
Expand All @@ -1111,15 +1106,15 @@ void GraphicalTweaks()
if (MaxShadowCSMResolutionCVAR && MaxShadowCSMResolutionCVAR->GetInt() != iShadowResolution)
{
MaxShadowCSMResolutionCVAR->Set(std::to_wstring(iShadowResolution).c_str());
MaxShadowCSMResolutionCVAR->SetFlags(SDK::ECVF_SetByCode);
MaxShadowCSMResolutionCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.Shadow.MaxCSMResolution to {}", MaxShadowCSMResolutionCVAR->GetInt());
}

SDK::IConsoleVariable* MaxShadowResolutionCVAR = Unreal::FindCVAR("r.Shadow.MaxResolution", ConsoleObjects);
if (MaxShadowResolutionCVAR && MaxShadowResolutionCVAR->GetInt() != iShadowResolution)
{
MaxShadowResolutionCVAR->Set(std::to_wstring(iShadowResolution).c_str());
MaxShadowResolutionCVAR->SetFlags(SDK::ECVF_SetByCode);
MaxShadowResolutionCVAR->SetFlags(SDK::ECVF_SetByConstructor);
spdlog::info("Set CVARS: Set r.Shadow.MaxResolution to {}", MaxShadowResolutionCVAR->GetInt());
}
}
Expand Down

0 comments on commit c9955ad

Please sign in to comment.