Repository navigation
refactor(ww3d2): Remove the unused black and white shadow renderer - #3670
CryoTheRenegade wants to merge 1 commit into
Conversation
TexProjectClass only rendered with BWRenderClass inside an #if 0 block, so SpecialRenderInfoClass::BWRenderer was always null and MeshModelClass::Shadow_Render returned without drawing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe change removes the black-and-white triangle renderer and its mesh shadow-rendering integration from WW3D2. The active texproject render-target path remains unchanged. ChangesBW renderer removal
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested labels: Suggested reviewers: Merge Risk:
|
Found while looking for more type-punning casts after xezon's "Are there more of these?" on #3580.
MeshModelClass::Shadow_RenderpacksVector2values over itsVector4buffer through areinterpret_cast, and passes the triangle indices toBWRenderClassasconst unsigned long*. In Zero Hour the indices areVector3i16, so that cast would read two 16-bit indices as one 32-bit index. The code never runs, though, so this PR removes it instead of fixing it.The only place that sets
SpecialRenderInfoClass::BWRendereris inside an#if 0block inTexProjectClass::Compute_Texture.BWRendereris therefore always null, andShadow_Renderreturns without drawing. Projected shadows use the hardware render target path above that block.Removed, in both games where the code is per game:
bwrender.cppandbwrender.hin Core, with their entries in the Core CMake list and the commented-out entries in the game lists.#if 0block and thebwrender.hinclude intexproject.cpp.SpecialRenderInfoClass::BWRendererand its forward declaration.MeshModelClass::Shadow_Render, itsRENDER_SHADOWcall inMeshClass::Special_Render, and the_TempTransformedVertexBufferit used.MeshGeometryClass::get_deformed_screenspace_vertices, which onlyShadow_Rendercalled.RENDER_SHADOWitself stays, sinceW3DProjectedShadowManagerstill renders with it.Evidence
mesh.obj,meshmdl.obj,meshgeometry.obj,rinfo.obj,hlod.obj,texproject.objandW3DProjectedShadow.objfor both games, with VS 2026 (ClangCL) and VC6 Release, against a build ofmain. Apart from the removed functions and the static initializer of the removed buffer:MeshClass::Special_Renderno longer callsGet_HTreeandShadow_RenderforRENDER_SHADOW.SpecialRenderInfoClassconstructor no longer storesBWRenderer, andW3DProjectedShadowManager::initallocates the class with 4 fewer bytes.AI Disclosure
Claude Opus 5.5 was used to aid in implementation and to compare the disassembly.