Repository navigation
refactor(ww3d2): Remove the unused black and white shadow renderer - #3670
CryoTheRenegade wants to merge 3 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. WalkthroughThe change removes ChangesBW renderer removal
Estimated code review effort: 2 (Simple) | ~15 minutes Change: Refactor Suggested reviewers: Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The reviewed changes appear safe to merge.
|
|
This needs a rebase. |
20d6253 to
7a5b0e1
Compare
Rebased |
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>
7a5b0e1 to
927cbfa
Compare
…BW renderer removal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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_SHADOWexception in the hidden-mesh check at the top ofMeshClass::Special_Render. It only let hidden meshes reach the removedShadow_Rendercall.WWMath/matrix4.h,rinfo.handcamera.hinmeshgeometry.cpp,RenderInfoClassinmeshgeometry.h, andSpecialRenderInfoClassinmeshmdl.h.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, and returns early for hidden meshes without checking the render type.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.
Council review
Rounds: 2