From 76dc02ab42b2e25b2d8073d8450bd16b5de895e4 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Sat, 5 Oct 2024 00:22:40 -0700 Subject: [PATCH] feat: add Util::IsDynamicResolution --- src/Util.cpp | 7 +++++++ src/Util.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Util.cpp b/src/Util.cpp index d00fed6fd..b1afc8715 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -423,6 +423,13 @@ namespace Util ImGui::EndTooltip(); } } + + bool IsDynamicResolution() + { + const auto address = REL::RelocationID{ 508794, 380760 }.address(); + bool* bDynamicResolution = reinterpret_cast(address); + return *bDynamicResolution; + } } namespace nlohmann diff --git a/src/Util.h b/src/Util.h index 8f11c58ec..dfa0e8359 100644 --- a/src/Util.h +++ b/src/Util.h @@ -125,6 +125,14 @@ namespace Util } inline bool isNewFrame() { return isNewFrame(RE::BSGraphics::State::GetSingleton()->frameCount); } }; + + /** + * @brief Checks if dynamic resolution is currently enabled. + * + * @return true if dynamic resolution is enabled, false otherwise. + */ + bool IsDynamicResolution(); + } namespace nlohmann