Refresh rate fixes, restore timers

This commit is contained in:
=
2024-04-01 12:48:41 -04:00
parent c5eb0ea3cf
commit ea22635dff
2 changed files with 10 additions and 6 deletions
+7 -1
View File
@@ -67,9 +67,10 @@ using namespace winrt::Windows::Storage;
#include "SDL2/SDL.h"
// Track width/height for SDL window creation
// Window state vars
static int width, height;
static double refreshRate;
static float scale;
@@ -91,6 +92,10 @@ int WinInfo::getHostHeight() {
return height;
}
double WinInfo::getHostRefresh() {
return refreshRate;
}
std::string WinInfo::getSavePath() {
return winrt::to_string(ApplicationData::Current().LocalFolder().Path());
}
@@ -103,6 +108,7 @@ int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
width = hdi.GetCurrentDisplayMode().ResolutionWidthInRawPixels();
height = hdi.GetCurrentDisplayMode().ResolutionHeightInRawPixels();
refreshRate = hdi.GetCurrentDisplayMode().RefreshRate();
scale = ((float)width / 1920.0f) * 1.75f;
}
else {
+3 -5
View File
@@ -59,6 +59,7 @@
#include <Fast3D/gfx_pc.h>
#include <Fast3D/gfx_rendering_api.h>
#include "../graphic/Fast3D/wininfo.h"
#ifdef __APPLE__
#include <SDL_scancode.h>
@@ -442,18 +443,15 @@ bool OTRGlobals::HasOriginal() {
}
uint32_t OTRGlobals::GetInterpolationFPS() {
// Locked to panel refresh for now
return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) {
return CVarGetInteger("gInterpolationFPS", 20);
}
if (CVarGetInteger("gMatchRefreshRate", 0)) {
return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
return (int) WinInfo::getHostRefresh();
}
return std::min<uint32_t>(LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20));
return std::min<uint32_t>((int)WinInfo::getHostRefresh(), CVarGetInteger("gInterpolationFPS", 20));
}
struct ExtensionEntry {