render parity unit I: 40250 PythonGraphic SetGamma, cooldown fan, up/down buttons

SetGamma, RenderCoolTimeBox, RenderUp/DownButton and GetAvailableMemory are
transliterated from 40250 in place of stubs. The cooldown fan is emitted as
untextured polygon UI commands (native_render + python_ui_surface.gd draw
Bar+quad as a polygon); D3D8 shim gains SetGammaRamp/D3DGAMMARAMP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-28 14:17:27 +09:00
co-authored by Claude Opus 5.5
parent d3fd5f8613
commit 0e8a1574cb
8 changed files with 298 additions and 21 deletions
+1
View File
@@ -566,3 +566,4 @@
{"date": "2026-09-28T04:53:55+00:00", "unit": "GameLib/MapOutdoorRenderSTP.cpp + UserInterface/PythonApplication.cpp Create (tiling) + RecordingDevice caps", "action": "unit G: STP file replaced by the full 40250 source (native-terrain gate only); Create gains the 40250 SOFTWARE_TILING/auto-tiling block and MinLOD for !IsFastTNL; RecordingDevice GetDeviceCaps reports VertexShaderVersion 1.1 + D3DPMISCCAPS_CLIPTLVERTS (40250 on a fast T&L card = HTP); native_render XYZRHW fixes: screen→NDC Y was inverted (drawn upside down and back-face culled), negative rhw forced w=1 (spikes), texture transform no longer applied to TL vertices, specular-alpha vertex fog plumbed (Render3DDraw.vertex_fog, capture v9)", "evidence": "ctest 35/35 (login_live excluded); default HTP frame 900 vs previous baseline mean abs diff ~0.6/255; STP forced (temporary edit, reverted) renders the spawn plaza/grass matching HTP layout, STP pixels NEEDS_LIVE"}
{"date": "2026-09-28T04:56:02+00:00", "unit": "GameLib/MapOutdoorRenderHTP.cpp", "action": "unit H1: platform rewrite replaced by the full 40250 source (native-terrain gate only); drops the invented texture-0 fallback splat, restores first-splat stage-1 ALPHAOP DISABLE, GetNumTextures() loop bound, shadow-pass FOGCOLOR white/restore, stage-0 ALPHAOP DISABLE + CLAMP, TEXTURE1 = m_matDynamicShadow, stage-1 SELECTARG1 restore, TEXTURE0 1/640 tiling", "evidence": "ctest (see commit); fake-server frame 900: white far band gone, terrain matches STP-path layout (mean abs diff vs STP ~20/255 from per-texture m_matTransform vs STP's fixed 1/640, as in 40250); HTP pixels NEEDS_LIVE"}
{"date": "2026-09-28T04:59:25+00:00", "unit": "GameLib/MapOutdoorWater.cpp", "action": "unit H2: platform rewrite replaced by the full 40250 source (native-terrain gate only): far-fog second water pass restored, invented LIGHTING=FALSE save/restore and empty-texture guard removed", "evidence": "build ok; fake-server spawn frame 900 unchanged (mean abs diff ~0.4/255, no water in view); water visuals NEEDS_LIVE"}
{"date": "2026-09-28T05:08:46+00:00", "unit": "EterPythonLib/PythonGraphic.cpp", "action": "unit I: SetGamma, RenderCoolTimeBox, RenderUp/DownButton, GetAvailableMemory ported from 40250 (stubs removed); cooldown fan drawn as polygon UI commands; SetViewport/RestoreViewport documented as ADAPTED (device viewport + UI clip)", "evidence": "port.app_loop drawing_primitives checks fan geometry at fTime 0.25/0.3/1.0 and viewport clip push/pop; cooldown visuals NEEDS_LIVE"}
@@ -11,13 +11,22 @@
"status": "TODO"
},
"CPythonGraphic::GetOrthoDepth": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::GetOrthoDepth"
]
},
"CPythonGraphic::SetInterfaceRenderState": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::SetInterfaceRenderState"
]
},
"CPythonGraphic::SetGameRenderState": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::SetGameRenderState"
]
},
"CPythonGraphic::SetCursorPosition": {
"status": "ADAPTED",
@@ -31,13 +40,27 @@
"status": "TODO"
},
"CPythonGraphic::SetViewport": {
"status": "TODO"
"status": "ADAPTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::SetViewport"
],
"test": "extension/tests/port_app_loop_test.cpp",
"note": "40250 device viewport set/backup kept (guarded for the device-less boot). The UI is drawn from UIRenderCommands, not the device, so the same rectangle is also pushed as the UI clip (UIRenderSetClip)."
},
"CPythonGraphic::RestoreViewport": {
"status": "TODO"
"status": "ADAPTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::RestoreViewport"
],
"test": "extension/tests/port_app_loop_test.cpp",
"note": "Restores the backup viewport as 40250 does and pops the UI clip pushed by SetViewport."
},
"CPythonGraphic::SetGamma": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::SetGamma"
],
"note": "Verbatim 40250. The recording device reports no D3DCAPS2_FULLSCREENGAMMA (windowed output, where D3D8 ignores the ramp as well), so it returns at the caps check; IDirect3DDevice8::SetGammaRamp added to the D3D8 shim."
},
"GenScreenShotTag": {
"status": "TODO"
@@ -49,10 +72,16 @@
"status": "TODO"
},
"CPythonGraphic::PushState": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::PushState"
]
},
"CPythonGraphic::PopState": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::PopState"
]
},
"CPythonGraphic::RenderImage": {
"status": "TODO"
@@ -61,25 +90,48 @@
"status": "TODO"
},
"CPythonGraphic::RenderCoolTimeBox": {
"status": "TODO"
"status": "ADAPTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::RenderCoolTimeBox"
],
"test": "extension/tests/port_app_loop_test.cpp",
"note": "Fan vertex build verbatim. 40250's D3DPT_TRIANGLEFAN (untextured, SELECTARG1 DIFFUSE colour/alpha, 0x80000000) is emitted as one untextured quad UIRenderCommand per fan triangle (centre, j, j+1, j+1); native_render and python_ui_surface.gd draw Bar+quad as a polygon. On-screen look NEEDS_LIVE against a skill cooldown."
},
"CPythonGraphic::GenerateColor": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::GenerateColor"
]
},
"CPythonGraphic::RenderDownButton": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::RenderDownButton"
]
},
"CPythonGraphic::RenderUpButton": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::RenderUpButton"
]
},
"CPythonGraphic::GetAvailableMemory": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::GetAvailableMemory"
]
},
"CPythonGraphic::CPythonGraphic": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::CPythonGraphic"
]
},
"CPythonGraphic::~CPythonGraphic": {
"status": "TODO"
"status": "PORTED",
"impl": [
"extension/src/platform/EterPythonLib/PythonGraphic.cpp:CPythonGraphic::~CPythonGraphic"
]
}
}
}