render and server locale parity fixes

This commit is contained in:
shen
2026-09-28 00:18:37 -07:00
parent b776fd071f
commit d3cf586849
20 changed files with 7853 additions and 4 deletions
@@ -72,6 +72,8 @@ float CPythonApplication::GetGlobalElapsedTime() { return CTimer::Instance().Get
static bool s_isFrameSkipDisable = false;
// m_iForceSightRange (the 40250 constructor sets -1: automatic sight range).
static int s_iForceSightRange = -1;
static float s_nativeRenderFrameTime = 0.0f;
void PythonBoot::SetNativeRenderFrameTime(float milliseconds) { s_nativeRenderFrameTime = milliseconds; }
void CPythonApplication::SetFrameSkip(bool isEnable) { s_isFrameSkipDisable = !isEnable; }
// PORT: 40250 creates the Win32 window, the D3D8 device, cursors, sound, keyboard, the net device,
// fonts and the IME here. The Godot window and its canvas already exist when the host starts the
@@ -350,7 +352,11 @@ bool CPythonApplication::Process()
static DWORD s_dwRenderRangeTime = 0;
static DWORD s_dwRenderRangeFrame = 0;
m_dwCurRenderTime = dwRenderEndTime - dwRenderStartTime;
// The native host completes Vulkan work after this command-recording pass.
// Use its last completed frame, including presentation, for automatic sight range.
m_dwCurRenderTime = s_nativeRenderFrameTime > 0.0f
? static_cast<DWORD>(s_nativeRenderFrameTime + 0.5f)
: dwRenderEndTime - dwRenderStartTime;
s_dwRenderRangeTime += m_dwCurRenderTime;
++s_dwRenderRangeFrame;