feat: complete native client rendering parity updates

This commit is contained in:
shen
2026-09-27 19:44:41 -07:00
parent 9a9dc6d224
commit 25dd65f2ce
99 changed files with 21121 additions and 921 deletions
@@ -25,8 +25,9 @@
//
// PORT: there is no CPythonApplication object yet (its members are the whole game: background,
// network stream, player, ...), so these functions only use the singletons PythonBoot owns
// (UI::CWindowManager, CTimer, CResourceManager) and never touch a data member.
CPythonApplication* CPythonApplication::ms_pInstance = nullptr;
alignas(alignof(CPythonApplication)) static char s_app_storage[sizeof(CPythonApplication)] = {};
CPythonApplication* CPythonApplication::ms_pInstance = reinterpret_cast<CPythonApplication*>(s_app_storage);
extern double g_specularSpd;
void CPythonApplication::ShowWebPage(const char*, const RECT&) { MT_PLATFORM_STUB(); }
void CPythonApplication::MoveWebPage(const RECT&) { MT_PLATFORM_STUB(); }
@@ -134,6 +135,16 @@ bool CPythonApplication::Create(PyObject*, const char*, int, int, int)
// 40250 PythonApplication.cpp:1260.
CPythonTextTail::Instance().Initialize();
if (IsNativeTerrainRenderEnabled())
{
const bool use_hardware_cursor = PythonBoot::HostHardwareCursorEnabled();
if (CPythonSystem::InstancePtr() && CPythonSystem::Instance().GetConfig())
CPythonSystem::Instance().GetConfig()->is_software_cursor = !use_hardware_cursor;
SetCursorMode(use_hardware_cursor ? CURSOR_MODE_HARDWARE : CURSOR_MODE_SOFTWARE);
CGrannyMaterial::CreateSphereMap(0, "d:/ymir work/special/spheremap.jpg");
CGrannyMaterial::CreateSphereMap(1, "d:/ymir work/special/spheremap01.jpg");
}
return true;
}
// 40250 PythonApplication.cpp:105
@@ -216,6 +227,7 @@ void CPythonApplication::UpdateGame()
s.SetPerspective(30.0f,fAspect, 100.0f, fFarClip);
s.BuildViewFrustum();
s.SetCursorPosition(ptMouse.x, ptMouse.y, UI::CWindowManager::Instance().GetScreenWidth(), UI::CWindowManager::Instance().GetScreenHeight());
}
TPixelPosition kPPosMainActor;
@@ -262,8 +274,13 @@ bool CPythonApplication::Process()
CResourceManager::Instance().Update();
OnCameraUpdate();
if (IsNativeTerrainRenderEnabled())
OnMouseUpdate();
OnUIUpdate();
if (IsNativeTerrainRenderEnabled())
CGrannyMaterial::TranslateSpecularMatrix(g_specularSpd, g_specularSpd, 0.0f);
// PORT: the render block without the lost-device restore, ClearDepthBuffer, Show and the render-time
// statistics (Godot clears and presents the frame). The frame's UI and 3D command lists restart here.
CCullingManager::Instance().Update();
@@ -275,6 +292,14 @@ bool CPythonApplication::Process()
rkGraphic.SetInterfaceRenderState();
OnUIRender();
if (IsNativeTerrainRenderEnabled())
{
rkGraphic.SetInterfaceRenderState();
unsigned cw = 0, ch = 0;
UIRenderGetSize(&cw, &ch);
UIRenderSetClip(0.0f, 0.0f, float(cw), float(ch));
OnMouseRender();
}
rkGraphic.End();
}