From c3658ad122e62a787ef1bdeda8a3d6b33414f025 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Fri, 4 Oct 2024 01:49:15 -0700 Subject: [PATCH] feat: add dynres status to state --- src/State.cpp | 7 +++++++ src/State.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/State.cpp b/src/State.cpp index e6f8ee3d9..c04dbb734 100644 --- a/src/State.cpp +++ b/src/State.cpp @@ -398,6 +398,13 @@ void State::SetupResources() renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kMAIN].texture->GetDesc(&texDesc); isVR = REL::Module::IsVR(); + auto ini = RE::INISettingCollection::GetSingleton(); + if (ini) { + auto setting = ini->GetSetting("bEnableAutoDynamicResolution:Display"); + dynamicResolutionEnabled = setting ? setting->GetBool() : false; + } else { + dynamicResolutionEnabled = false; + } screenSize = { (float)texDesc.Width, (float)texDesc.Height }; context = reinterpret_cast(renderer->GetRuntimeData().context); device = reinterpret_cast(renderer->GetRuntimeData().forwarder); diff --git a/src/State.h b/src/State.h index 7d569010a..976136df8 100644 --- a/src/State.h +++ b/src/State.h @@ -150,6 +150,7 @@ class State // Skyrim constants bool isVR = false; + bool dynamicResolutionEnabled = false; float2 screenSize = {}; ID3D11DeviceContext* context = nullptr; ID3D11Device* device = nullptr;