Skip to content

Commit

Permalink
feat: add Util::IsDynamicResolution
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Oct 5, 2024
1 parent a3e2adf commit 76dc02a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ namespace Util
ImGui::EndTooltip();
}
}

bool IsDynamicResolution()
{
const auto address = REL::RelocationID{ 508794, 380760 }.address();
bool* bDynamicResolution = reinterpret_cast<bool*>(address);
return *bDynamicResolution;
}
}

namespace nlohmann
Expand Down
8 changes: 8 additions & 0 deletions src/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76dc02a

Please sign in to comment.