mirror of
https://github.com/izzy2lost/shipdev.git
synced 2026-07-05 15:19:25 -07:00
Refresh rate fixes, restore timers
This commit is contained in:
+7
-1
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user