mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-04-28 12:27:59 +03:00
revert whatever happened here
Some checks failed
GenerateBuilds / generate-port-o2r (push) Has been cancelled
GenerateBuilds / build-windows (push) Has been cancelled
GenerateBuilds / build-macos (push) Has been cancelled
GenerateBuilds / build-linux (push) Has been cancelled
GenerateBuilds / build-switch (push) Has been cancelled
Some checks failed
GenerateBuilds / generate-port-o2r (push) Has been cancelled
GenerateBuilds / build-windows (push) Has been cancelled
GenerateBuilds / build-macos (push) Has been cancelled
GenerateBuilds / build-linux (push) Has been cancelled
GenerateBuilds / build-switch (push) Has been cancelled
This commit is contained in:
parent
a535383703
commit
b23ad8adf0
2 changed files with 46 additions and 19 deletions
|
@ -480,7 +480,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) {
|
||||||
wnd->SetRendererUCode(UcodeHandlers::ucode_f3dex);
|
wnd->SetRendererUCode(UcodeHandlers::ucode_f3dex);
|
||||||
|
|
||||||
std::vector<std::unordered_map<Mtx*, MtxF>> mtx_replacements;
|
std::vector<std::unordered_map<Mtx*, MtxF>> mtx_replacements;
|
||||||
int target_fps = GameEngine::Instance->GetInterpolationFPS();
|
int target_fps = CVarGetInteger("gInterpolationFPS", 60);
|
||||||
static int last_fps;
|
static int last_fps;
|
||||||
static int last_update_rate;
|
static int last_update_rate;
|
||||||
static int time;
|
static int time;
|
||||||
|
@ -509,8 +509,11 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) {
|
||||||
|
|
||||||
time -= fps;
|
time -= fps;
|
||||||
|
|
||||||
|
int threshold = CVarGetInteger("gExtraLatencyThreshold", 80);
|
||||||
|
|
||||||
if (wnd != nullptr) {
|
if (wnd != nullptr) {
|
||||||
wnd->SetTargetFps(fps);
|
wnd->SetTargetFps(fps);
|
||||||
|
wnd->SetMaximumFrameLatency(threshold > 0 && target_fps >= threshold ? 2 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the gfx debugger is active, only run with the final mtx
|
// When the gfx debugger is active, only run with the final mtx
|
||||||
|
@ -526,16 +529,16 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GameEngine::GetInterpolationFPS() {
|
uint32_t GameEngine::GetInterpolationFPS() {
|
||||||
if (CVarGetInteger("gMatchRefreshRate", 0)) {
|
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
||||||
return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
return CVarGetInteger("gInterpolationFPS", 60);
|
||||||
|
|
||||||
} else if (CVarGetInteger("gVsyncEnabled", 1) ||
|
|
||||||
!Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
|
||||||
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(),
|
|
||||||
CVarGetInteger("gInterpolationFPS", 60));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CVarGetInteger("gInterpolationFPS", 60);
|
if (CVarGetInteger("gMatchRefreshRate", 0)) {
|
||||||
|
return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(),
|
||||||
|
CVarGetInteger("gInterpolationFPS", 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GameEngine::GetInterpolationFrameCount()
|
uint32_t GameEngine::GetInterpolationFrameCount()
|
||||||
|
|
|
@ -246,7 +246,12 @@ void DrawSettingsMenu(){
|
||||||
|
|
||||||
{ // FPS Slider
|
{ // FPS Slider
|
||||||
const int minFps = 30;
|
const int minFps = 30;
|
||||||
static int maxFps = 360;
|
static int maxFps;
|
||||||
|
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
||||||
|
maxFps = 360;
|
||||||
|
} else {
|
||||||
|
maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||||
|
}
|
||||||
int currentFps = 0;
|
int currentFps = 0;
|
||||||
#ifdef __WIIU__
|
#ifdef __WIIU__
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
|
@ -309,20 +314,40 @@ void DrawSettingsMenu(){
|
||||||
CVarSetInteger("gInterpolationFPS", currentFps);
|
CVarSetInteger("gInterpolationFPS", currentFps);
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
#else
|
#else
|
||||||
bool matchingRefreshRate = CVarGetInteger("gMatchRefreshRate", 0);
|
bool matchingRefreshRate =
|
||||||
|
CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11;
|
||||||
UIWidgets::CVarSliderInt((currentFps == 30) ? "FPS: Original (30)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 60, {
|
UIWidgets::CVarSliderInt((currentFps == 30) ? "FPS: Original (30)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 60, {
|
||||||
.disabled = matchingRefreshRate
|
.disabled = matchingRefreshRate
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
UIWidgets::Tooltip(
|
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
||||||
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely "
|
UIWidgets::Tooltip(
|
||||||
"visual and does not impact game logic, execution of glitches etc.\n\n"
|
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely "
|
||||||
"A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse result."
|
"visual and does not impact game logic, execution of glitches etc.\n\n"
|
||||||
);
|
"A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse result."
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
UIWidgets::Tooltip(
|
||||||
|
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely "
|
||||||
|
"visual and does not impact game logic, execution of glitches etc."
|
||||||
|
);
|
||||||
|
}
|
||||||
} // END FPS Slider
|
} // END FPS Slider
|
||||||
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false);
|
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
||||||
UIWidgets::Tooltip("Matches interpolation value to the refresh rate of your display.");
|
UIWidgets::Spacer(0);
|
||||||
|
if (ImGui::Button("Match Refresh Rate")) {
|
||||||
|
int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
|
||||||
|
if (hz >= 30 && hz <= 360) {
|
||||||
|
CVarSetInteger("gInterpolationFPS", hz);
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate");
|
||||||
|
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) {
|
||||||
UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 0) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS",
|
UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 0) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS",
|
||||||
|
@ -369,7 +394,6 @@ void DrawSettingsMenu(){
|
||||||
|
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
|
||||||
UIWidgets::Tooltip("Removes tearing, but clamps your max FPS to your displays refresh rate.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) {
|
if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue