mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-22 17:19:53 +01:00
fixes
This commit is contained in:
@@ -5608,12 +5608,15 @@ void opengl46_renderer::Update(double const Deltatime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_updateaccumulator = 0.0;
|
m_updateaccumulator = 0.0;
|
||||||
m_framerate = 1000.f / ( Timer::subsystem.mainloop_total.average() );
|
// the frames actually shown, the wait for fpslimit included (eu07/maszyna#416)
|
||||||
|
m_framerate = 1000.f / ( Timer::subsystem.mainloop_period.average() );
|
||||||
|
// the frames the work alone would allow, so a frame rate held down by fpslimit doesn't cut the draw ranges
|
||||||
|
auto const workframerate{1000.f / Timer::subsystem.mainloop_total.average()};
|
||||||
|
|
||||||
// adjust draw ranges etc, based on recent performance
|
// adjust draw ranges etc, based on recent performance
|
||||||
|
|
||||||
if (Global.targetfps != 0.0f) {
|
if (Global.targetfps != 0.0f) {
|
||||||
float fps_diff = Global.targetfps - m_framerate;
|
float fps_diff = Global.targetfps - workframerate;
|
||||||
if (fps_diff > 0.0f)
|
if (fps_diff > 0.0f)
|
||||||
Global.fDistanceFactor = std::max(0.5f, Global.fDistanceFactor - 0.05f);
|
Global.fDistanceFactor = std::max(0.5f, Global.fDistanceFactor - 0.05f);
|
||||||
else
|
else
|
||||||
@@ -5621,7 +5624,7 @@ void opengl46_renderer::Update(double const Deltatime)
|
|||||||
}
|
}
|
||||||
// legacy framerate parameters
|
// legacy framerate parameters
|
||||||
else if (Global.fFpsAverage != 0.f) {
|
else if (Global.fFpsAverage != 0.f) {
|
||||||
auto const fps_diff = m_framerate - Global.fFpsAverage;
|
auto const fps_diff = workframerate - Global.fFpsAverage;
|
||||||
if (fps_diff < -Global.fFpsDeviation) {
|
if (fps_diff < -Global.fFpsDeviation) {
|
||||||
Global.fDistanceFactor = std::min(std::max(1.0f, Global.fDistanceFactor - 0.05f), Global.gfx_distance_factor_max);
|
Global.fDistanceFactor = std::min(std::max(1.0f, Global.fDistanceFactor - 0.05f), Global.gfx_distance_factor_max);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1107,12 +1107,15 @@ void vulkan14_renderer::Update(double const Deltatime)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_updateaccumulator = 0.0;
|
m_updateaccumulator = 0.0;
|
||||||
m_framerate = 1000.f / Timer::subsystem.mainloop_total.average();
|
// the frames actually shown, the wait for fpslimit included (eu07/maszyna#416)
|
||||||
|
m_framerate = 1000.f / ( Timer::subsystem.mainloop_period.average() );
|
||||||
|
// the frames the work alone would allow, so a frame rate held down by fpslimit doesn't cut the draw ranges
|
||||||
|
auto const workframerate{1000.f / Timer::subsystem.mainloop_total.average()};
|
||||||
|
|
||||||
// adjust draw ranges etc, based on recent performance (opengl46_renderer::Update())
|
// adjust draw ranges etc, based on recent performance (opengl46_renderer::Update())
|
||||||
if (Global.targetfps != 0.0f)
|
if (Global.targetfps != 0.0f)
|
||||||
{
|
{
|
||||||
float fps_diff = Global.targetfps - m_framerate;
|
float fps_diff = Global.targetfps - workframerate;
|
||||||
if (fps_diff > 0.0f)
|
if (fps_diff > 0.0f)
|
||||||
Global.fDistanceFactor = std::max(0.5f, Global.fDistanceFactor - 0.05f);
|
Global.fDistanceFactor = std::max(0.5f, Global.fDistanceFactor - 0.05f);
|
||||||
else
|
else
|
||||||
@@ -1121,7 +1124,7 @@ void vulkan14_renderer::Update(double const Deltatime)
|
|||||||
// legacy framerate parameters
|
// legacy framerate parameters
|
||||||
else if (Global.fFpsAverage != 0.f)
|
else if (Global.fFpsAverage != 0.f)
|
||||||
{
|
{
|
||||||
auto const fps_diff = m_framerate - Global.fFpsAverage;
|
auto const fps_diff = workframerate - Global.fFpsAverage;
|
||||||
if (fps_diff < -Global.fFpsDeviation)
|
if (fps_diff < -Global.fFpsDeviation)
|
||||||
{
|
{
|
||||||
Global.fDistanceFactor = std::min(std::max(1.0f, Global.fDistanceFactor - 0.05f), Global.gfx_distance_factor_max);
|
Global.fDistanceFactor = std::min(std::max(1.0f, Global.fDistanceFactor - 0.05f), Global.gfx_distance_factor_max);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ void apply_test_mode_settings()
|
|||||||
Global.editor_session = false;
|
Global.editor_session = false;
|
||||||
Global.local_start_vehicle = "ghostview";
|
Global.local_start_vehicle = "ghostview";
|
||||||
Global.GfxRenderer = "null";
|
Global.GfxRenderer = "null";
|
||||||
Global.NvRenderer = false;
|
|
||||||
Global.bSoundEnabled = false;
|
Global.bSoundEnabled = false;
|
||||||
Global.python_enabled = false;
|
Global.python_enabled = false;
|
||||||
Global.bInactivePause = false;
|
Global.bInactivePause = false;
|
||||||
@@ -68,7 +67,6 @@ void apply_test_mode_settings()
|
|||||||
Global.fullscreen_windowed = false;
|
Global.fullscreen_windowed = false;
|
||||||
Global.VSync = false;
|
Global.VSync = false;
|
||||||
Global.iMultisampling = 0;
|
Global.iMultisampling = 0;
|
||||||
Global.gfx_usegles = false;
|
|
||||||
Global.minframetime = std::chrono::duration<float>(0.0f);
|
Global.minframetime = std::chrono::duration<float>(0.0f);
|
||||||
Global.extra_viewports.clear();
|
Global.extra_viewports.clear();
|
||||||
Global.headtrack_conf.joy.clear();
|
Global.headtrack_conf.joy.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user