Skip to content

refactor(ww3d2): Route texture stage transforms via Renderer - #3700

Draft
bobtista wants to merge 17 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-texture-transforms
Draft

bobtista wants to merge 17 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-texture-transforms

Conversation

@bobtista

Copy link
Copy Markdown

Now texture stage transforms are on Renderer as Set_Texture_Transform. It forwards to DX8Wrapper::Set_Transform with D3DTS_TEXTURE0 + stage, as the mappers did before. The raw _Get_DX8_Transform and _Set_DX8_Transform calls in the terrain, water and shader manager code read the device matrix and stay as they are.

Todo:

  • Build win32, including W3DView and WorldBuilder
  • Load a skirmish save and the shell map. Same result as main

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds rendering and capability methods to Renderer, with forwarding implementations in DX8Backend. It updates WW3D, game-device, Generals, GeneralsMD, and tool rendering paths to call Renderer for the affected operations. Most existing rendering conditions and arguments remain unchanged.

Changes

Renderer API routing

Layer / File(s) Summary
Renderer interface and DX8 forwarding
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
Renderer adds capability and rendering methods. DX8Backend forwards them to DX8Wrapper; narrowing for 16-bit APIs is checked.
WW3D capability and state routing
Core/Libraries/Source/WWVegas/WW3D2/{dx8renderer.cpp,mapper.cpp,matrixmapper.cpp,matpass.cpp,meshmdl.cpp,meshmatdesc.cpp,statistics.cpp,texture.cpp,textureloader.cpp,ww3dformat.cpp}, Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp
Capability queries, texture transforms, texture format selection, and material-pass setup use Renderer. The GeneralsMD mesh material descriptor also comments out two bump-environment capability checks.
WW3D rendering call sites
Core/Libraries/Source/WWVegas/WW3D2/*
Geometry renderers, sorting, decals, 2D rendering, and scene lighting route affected state, buffer, and draw operations through Renderer.
Game-device terrain, water, and effects
Core/GameEngineDevice/Source/W3DDevice/GameClient/*
Terrain, water, shader, particle, track, and effect paths use Renderer for the affected capability, render-state, buffer, texture, target, and draw operations.
Generals rendering call sites
Generals/Code/{GameEngineDevice/Source/W3DDevice/GameClient, Libraries/Source/WWVegas/WW3D2}/*, GeneralsMD/Code/{GameEngineDevice/Source/W3DDevice/GameClient, Libraries/Source/WWVegas/WW3D2}/*
Shadow, bib, bridge, road, scene, status-circle, dazzle, decal, line-group, and 2D rendering paths use Renderer for the affected operations.
WorldBuilder and W3DView rendering
Core/Tools/W3DView/ScreenCursor.cpp, Generals/Code/Tools/WorldBuilder/src/{DrawObject.cpp,ObjectPreview.cpp}, GeneralsMD/Code/Tools/WorldBuilder/src/{DrawObject.cpp,ObjectPreview.cpp}
WorldBuilder feedback rendering and preview targets, plus W3DView cursor rendering, use Renderer for the affected calls.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Refactor

Sequence Diagram(s)

Possibly related PRs

Suggested reviewers: xezon, cryotherenegade, stephanmeesters

Merge Risk: Minimal · up to 80b54

This refactor routes rendering and capability calls through a common Renderer interface without intended behavior changes. No specific defect was found. Before merging, confirm that the build succeeds and run the skirmish-save and shell-map checks the author left unchecked.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: texture stage transforms are now routed through Renderer. The changeset adds Renderer::Set_Texture_Transform and updates the mapper Apply methods (mapper.cpp, matrixma…
Description check Passed The description is related to the changeset. It states that texture stage transforms moved to Renderer::Set_Texture_Transform, that this forwards to DX8Wrapper::Set_Transform with D3DTS_TEXTURE0 + sta…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: texture stage transforms are now routed through Renderer. The changeset adds Renderer::Set_Texture_Transform and updates the mapper Apply methods (mapper.cpp, matrixmapper.cpp) to use it. The title does not mention the wider Renderer routing in the summary, but it refers to a real and central part of the change.

Full details: Description check

Explanation

The description is related to the changeset. It states that texture stage transforms moved to Renderer::Set_Texture_Transform, that this forwards to DX8Wrapper::Set_Transform with D3DTS_TEXTURE0 + stage, and it lists build and runtime verification steps. It describes the mapper and transform work that the summary shows.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba71a943-89bf-4eac-a045-ba1268b6b9cd
Commits

Reviewing files that changed from the base of the PR and between ee27e89 and 80b5448.

Files selected for processing: 71

  • Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDebugIcons.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScorch.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSnow.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainParticles.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Renderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/dx8renderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/line3d.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/mapper.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/matpass.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/matrixmapper.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/mesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/meshmdl.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ringobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sphereobj.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/statistics.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/texture.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3dformat.cpp
  • Core/Tools/W3DView/ScreenCursor.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBibBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • Generals/Code/Tools/WorldBuilder/src/DrawObject.cpp
  • Generals/Code/Tools/WorldBuilder/src/ObjectPreview.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBibBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DBridgeBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DRoadBuffer.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/decalmsh.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/linegrp.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/ObjectPreview.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant