Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly Scale Menu Assets (RenderTexture2D scaling) #23

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update src/dllmain.cpp
Co-authored-by: Lyall <[email protected]>
  • Loading branch information
Drahsid and Lyall authored Feb 15, 2024
commit a16bf4ba666e2be529a8b834f67abdf60838f98b
18 changes: 15 additions & 3 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,21 @@ void GraphicalTweaks()

if (iRenTexSizeX == 1920 && iRenTexSizeY == 1080) {
// Seems to affect pause menu screens, has some minor bugs in transitions
float fRenderScale = fScreenPercentage / 100.0f;
iRenTexSizeX = iCustomResX * fRenderScale;
iRenTexSizeY = iCustomResY * fRenderScale;
float fRenderScale = fScreenPercentage / 100.0f;
iRenTexSizeX = iCustomResX * fRenderScale;
iRenTexSizeY = iCustomResY * fRenderScale;

if (fAspectRatio > fNativeAspect)
{
iRenTexSizeX = fHUDWidth * fRenderScale;
iRenTexSizeY = iCustomResY * fRenderScale;
}

if (fAspectRatio < fNativeAspect)
{
iRenTexSizeX = iCustomResX * fRenderScale;
iRenTexSizeY = fHUDHeight * fRenderScale;
}
spdlog::info("Render Texture 2D screen percent: {:f}, {:d}x{:d}", fRenderScale, iCustomResX, iCustomResY);
}
else if (iRenTexSizeX > iRenTexSizeY) {
Expand Down