added fg rectangle option

This commit is contained in:
cdozdil
2024-10-29 22:30:54 +03:00
parent 912d8b4189
commit a4fa927ba5
3 changed files with 52 additions and 0 deletions
+8
View File
@@ -57,6 +57,10 @@ bool Config::Reload(std::filesystem::path iniPath)
FGHUDFix = readBool("FrameGen", "HUDFix");
FGHUDLimit = readInt("FrameGen", "HUDLimit");
FGHUDFixExtended = readBool("FrameGen", "HUDFixExtended");
FGRectLeft = readInt("FrameGen", "RectLeft");
FGRectTop = readInt("FrameGen", "RectTop");
FGRectWidth = readInt("FrameGen", "RectWidth");
FGRectHeight = readInt("FrameGen", "RectHeight");
}
// FSR
@@ -480,6 +484,10 @@ bool Config::SaveIni()
ini.SetValue("FrameGen", "HUDFix", GetBoolValue(Instance()->FGHUDFix).c_str());
ini.SetValue("FrameGen", "HUDLimit", GetIntValue(Instance()->FGHUDLimit).c_str());
ini.SetValue("FrameGen", "HUDFixExtended", GetBoolValue(Instance()->FGHUDFixExtended).c_str());
ini.SetValue("FrameGen", "RectLeft", GetIntValue(Instance()->FGRectLeft).c_str());
ini.SetValue("FrameGen", "RectTop", GetIntValue(Instance()->FGRectTop).c_str());
ini.SetValue("FrameGen", "RectWidth", GetIntValue(Instance()->FGRectWidth).c_str());
ini.SetValue("FrameGen", "RectHeight", GetIntValue(Instance()->FGRectHeight).c_str());
}
// Output Scaling
+4
View File
@@ -167,6 +167,10 @@ public:
std::optional<bool> FGHUDFix;
std::optional<bool> FGHUDFixExtended;
std::optional<int> FGHUDLimit;
std::optional<int> FGRectLeft;
std::optional<int> FGRectTop;
std::optional<int> FGRectWidth;
std::optional<int> FGRectHeight;
bool FGOnlyGenerated = false;
bool FGChanged = false;
bool SCChanged = false;
+40
View File
@@ -964,6 +964,46 @@ void ImGuiCommon::RenderMenu()
ImGui::Checkbox("FG Only Generated", &Config::Instance()->FGOnlyGenerated);
ShowHelpMarker("Display only FSR 3.1 generated frames");
if (Config::Instance()->AdvancedSettings.value_or(false))
{
ImGui::PushItemWidth(95.0);
int rectLeft = Config::Instance()->FGRectLeft.value_or(0);
if (ImGui::InputInt("Rect Left", &rectLeft))
Config::Instance()->FGRectLeft = rectLeft;
ImGui::SameLine(0.0f, 16.0f);
int rectTop = Config::Instance()->FGRectTop.value_or(0);
if (ImGui::InputInt("Rect Top", &rectTop))
Config::Instance()->FGRectTop = rectTop;
int rectWidth = Config::Instance()->FGRectWidth.value_or(0);
if (ImGui::InputInt("Rect Width", &rectWidth))
Config::Instance()->FGRectWidth = rectWidth;
ImGui::SameLine(0.0f, 16.0f);
int rectHeight = Config::Instance()->FGRectHeight.value_or(0);
if (ImGui::InputInt("Rect Height", &rectHeight))
Config::Instance()->FGRectHeight = rectHeight;
ImGui::PopItemWidth();
ShowHelpMarker("Frame generation rectangle, adjust for letterboxed content");
ImGui::BeginDisabled(!Config::Instance()->FGRectLeft.has_value() && !Config::Instance()->FGRectTop.has_value() &&
!Config::Instance()->FGRectWidth.has_value() && !Config::Instance()->FGRectHeight.has_value());
if (ImGui::Button("Reset FG Rect"))
{
Config::Instance()->FGRectLeft.reset();
Config::Instance()->FGRectTop.reset();
Config::Instance()->FGRectWidth.reset();
Config::Instance()->FGRectHeight.reset();
}
ShowHelpMarker("Resets frame generation rectangle");
ImGui::EndDisabled();
}
}
// Dx11 with Dx12