Hide near trees drawn as PC blockers when trees are switched off

A tree close to the camera is drawn by RenderPCBlocker, not RenderTree,
so background.SetVisiblePart(PART_TREE, 0) left it on screen. Skip tree
blockers while PART_TREE is hidden. Live screenshots on the 203 test
core confirm the tree, the GM mark and the weapon glow now disappear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-15 21:24:53 +09:00
co-authored by Claude Opus 5.5
parent e546f91e03
commit aeb67f3c9c
3 changed files with 14 additions and 3 deletions
+7 -1
View File
@@ -640,7 +640,13 @@ void CMapOutdoor::RenderPCBlocker()
STATEMANAGER.SaveTransform(D3DTS_TEXTURE1, &m_matBuildingTransparent);
STATEMANAGER.SetTexture(1, m_BuildingTransparentImageInstance.GetTexturePointer()->GetD3DTexture());
std::for_each(m_PCBlockerVector.begin(), m_PCBlockerVector.end(), FRenderPCBlocker());
// PORT: a tree near the camera is drawn here as a PC blocker, outside RenderTree, so hiding
// PART_TREE (mt_display) left it on screen. Skip it the same way RenderTree does.
const bool bTreeVisible = IsVisiblePart(PART_TREE);
FRenderPCBlocker kRenderPCBlocker;
for (CGraphicObjectInstance * pInstance : m_PCBlockerVector)
if (bTreeVisible || TREE_OBJECT != pInstance->GetType())
kRenderPCBlocker(pInstance);
STATEMANAGER.SetTexture(1, NULL);
STATEMANAGER.RestoreTransform(D3DTS_TEXTURE1);