SpeedTree: read the .spt collision and composite texcoord blocks

The CSpeedTreeRT stand-in now returns the collision objects stored in
the .spt (12000 section: spheres and cylinders) instead of one fixed trunk
cylinder, and takes leaf texture rects from the 10000 section instead of
hand-picked atlas rects (trees without leaf maps use the frond rect).
SpeedGrass/BoundaryShapeManager are N_A (no 40250 caller).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 12:20:34 +09:00
co-authored by Claude Opus 5.5
parent 17cb7326c1
commit ed61b2d20f
8 changed files with 529 additions and 55 deletions
+2
View File
@@ -571,3 +571,5 @@
{"date": "2026-09-28T05:29:23+00:00", "unit": "EterLib/GrpImageTexture.cpp", "action": "unit K: DXT DDS textures upload the file's own mip levels (40250 CreateDDSTexture: max(1,dwMipMapCount), dwLinearSize>>2i Copy) instead of a regenerated chain; non-DDS keep the D3DX_DEFAULT full chain; mem: textures one level; invented is_ui_tex no-mip rule (icon/ui/locale/<=128px) deleted; dxt_decode_test registered in ctest with mip-level cases", "evidence": "ctest -j3 36/36; fake-server spawn frame 900: near terrain diff 0.00, far terrain 2.7/255 (minified levels now from the file), rest is UI timing (area title/chat); far-terrain look NEEDS_LIVE"}
{"date": "2026-09-28T05:33:21+00:00", "unit": "SpeedTreeLib/SpeedTreeWrapper.cpp", "action": "SpeedTree follow-up closed without code change: .spt 0x4E25 is one composite rect per file (87/87, independent of 1-3 leaf maps) and overlays on the atlases put it on the billboard tree image for most species, so it is not the leaf-map texcoords; the hand-picked leaf rects stay DIVERGENT, note updated", "evidence": "byte dump of b1_baobab_rt.spt tail (0x4E20/0x4E22 name/0x4E23 b/0x4E24 b/0x4E25 8f/0x4E21); count over 87 .spt files; atlas overlays of 9 species"}
{"date": "2026-09-30T03:07:37+00:00", "unit": "MilesLib/*", "action": "MilesLib platform port: 40250 SoundBase/SoundData/SoundInstance2D/3D/Stream/SoundManager*/Type copied verbatim (only includes + one unused QPC local differ) over an AIL_* software mixer (MilesAil.cpp: 2D balance pan, 3D inverse distance min 1/max 200 + listener pan, threaded stream decode, loop counts, decompress_ASI/ADPCM to float WAV); host NativeAudioEngine drains MtMilesMix; CSoundManager Create/Destroy in PythonBoot (IsNoSoundCard), listener+Update from PythonApplicationCamera, Save/RestoreVolume on window focus, CSoundData::SetPackMode in PackInitialize; old AudioCommands/SoundInstance bridge deleted; 142/142 PORTED", "evidence": "port_miles_test ok (2D/3D/stream fades/DataToInstance); ctest all pass except pre-existing flaky login_flow; desktop live client MT_AUDIO_TRACE peaks 1.17/0.70 at login and ~0.02 in game; Android device not attached, NEEDS device run"}
{"date": "2026-09-30T03:19:50+00:00", "unit": "SpeedTreeLib/SpeedTreeWrapper.cpp", "action": "CSpeedTreeRT stand-in reads the .spt collision block (12000: 12002 sphere, 12003 cylinder) and the composite texcoord block (10000: 10002 leaf maps, 10003 frond, 10004 billboard) instead of a fixed trunk cylinder and hand-picked leaf rects; GetCollisionObjectCount/GetCollisionObject DIVERGENT -> PORTED; SetupLeafBuffers note updated (earlier 'no per-leaf-map texcoords' conclusion was wrong, the rects are in section 10000)", "evidence": "port_speedtree_test ok; token layout checked over 118 .spt extracted from the 40250 packs; fake-server Yongan view (camera 4500/3/0): tree crown now drawn from its own leaf-map cells, the wrong fruit/autumn cell is gone"}
{"date": "2026-09-30T03:19:50+00:00", "unit": "SpeedTreeLib/SpeedGrassRT.cpp", "action": "SpeedGrassRT/SpeedGrassWrapper/BoundaryShapeManager N_A: compiled (USE_SPEEDGRASS) but no caller outside those files", "evidence": "LC_ALL=C grep over ClientVS22/source for CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager"}
@@ -0,0 +1,32 @@
{
"reference": "SpeedTreeLib/BoundaryShapeManager.cpp",
"reference_sha256": "6fdfc42ca249991740567658bc0dced8dedddb387e2f4e1dcbad53b0d38fc964",
"priority": "P4",
"contracts": [],
"functions": {
"CBoundaryShapeManager::CBoundaryShapeManager": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::~CBoundaryShapeManager": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::LoadBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::PointInside": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::PointInShape": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CBoundaryShapeManager::RandomPoint": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -0,0 +1,100 @@
{
"reference": "SpeedTreeLib/SpeedGrassRT.cpp",
"reference_sha256": "1fbd873c76a7aa57935035ea45a720527b9fd8ee478352806934fbb5f9c86d42",
"priority": "P4",
"contracts": [],
"functions": {
"VecInterpolate": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SBlade::SBlade": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SRegion::SRegion": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CSpeedGrassRT": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::~CSpeedGrassRT": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::DeleteRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ParseBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CustomPlacement": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetLodParams": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetLodParams": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::Cull": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetWindDirection": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetWindDirection": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::GetCameraPos": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetCamera": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::SetPerspective": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::CreateRegions": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::RotateAxisFromIdentity": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ComputeFrustum": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ComputeUnitBillboard": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::ConvertCoordsToCell": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassRT::OutsideFrustum": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -0,0 +1,36 @@
{
"reference": "SpeedTreeLib/SpeedGrassWrapper.cpp",
"reference_sha256": "c737f71f0115acabec0eb1ba4cf4a0ec9a169c8ac5f9ac32a789d2194ac00f53",
"priority": "P4",
"contracts": [],
"functions": {
"CSpeedGrassWrapper::CSpeedGrassWrapper": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::~CSpeedGrassWrapper": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Draw": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::InitFromBsfFile": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Color": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::Height": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
},
"CSpeedGrassWrapper::InitGraphics": {
"status": "N_A",
"note": "compiled in 40250 (Constants.h defines USE_SPEEDGRASS) but unreachable: CSpeedGrassRT/CSpeedGrassWrapper/CBoundaryShapeManager are referenced only inside SpeedGrass*/BoundaryShapeManager* (grep over ClientVS22/source); nothing to port"
}
}
}
@@ -68,7 +68,8 @@
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::SetupLeafBuffers"
],
"note": "verbatim. DIVERGENT input: the stand-in's leaf clusters and composite-atlas rects are hand-picked (the .spt stores no per-leaf-map texcoords: leaf entries 0x0FA0-0x0FA7 carry colour/path/origin/size only, and the single 8-float 0x4E25 rect in the 0x4E20 composite block, one per file for 1-3 leaf maps, frames the billboard cell in most atlases; billboards never render in 40250 since SetLodLevel(1.0)); NEEDS_LIVE"
"note": "verbatim. Leaf texture coordinates are the .spt composite-atlas rects (10000 section: 10002 leaf maps, 10003 frond map, 10004 billboard, 8 floats per card, v flipped under SetTextureFlip), replacing the hand-picked rects; a tree without leaf maps (palms, ferns, bare winter trees) draws the proxy clusters with its frond rect. DIVERGENT input remains: cluster positions/sizes are the stand-in's procedural proxy, not the closed engine's; NEEDS_LIVE",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::Advance": {
"status": "PORTED",
@@ -196,18 +197,20 @@
]
},
"CSpeedTreeWrapper::GetCollisionObjectCount": {
"status": "DIVERGENT",
"status": "PORTED",
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::GetCollisionObjectCount"
],
"note": "verbatim; the stand-in returns one trunk CO_CYLINDER (radius 35, height 750), not the .spt collision objects"
"note": "verbatim; the CSpeedTreeRT stand-in returns the .spt collision block as stored (12000 section: 12002 sphere x y z r, 12003 cylinder x y z r h; 1-5 objects, none for aloe/fern ground plants, checked on all 118 pack .spt); the wrapper passes no size override (LoadTree fSize -1), so no SetTreeSize rescale applies",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::GetCollisionObject": {
"status": "DIVERGENT",
"status": "PORTED",
"impl": [
"src/port/SpeedTreeLib/SpeedTreeWrapper.cpp:CSpeedTreeWrapper::GetCollisionObject"
],
"note": "verbatim; the stand-in returns one trunk CO_CYLINDER (radius 35, height 750), not the .spt collision objects"
"note": "verbatim; the CSpeedTreeRT stand-in returns the .spt collision block as stored (12000 section: 12002 sphere x y z r, 12003 cylinder x y z r h; 1-5 objects, none for aloe/fern ground plants, checked on all 118 pack .spt); the wrapper passes no size override (LoadTree fSize -1), so no SetTreeSize rescale applies",
"test": "tests/port/port_speedtree_test.cpp"
},
"CSpeedTreeWrapper::GetPosition": {
"status": "PORTED",