Skip to content

refactor(ww3d2): Route transforms via Renderer - #3419

Merged
xezon merged 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-transforms
Nov 7, 2026
Merged

xezon merged 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-transforms

Conversation

@bobtista

@bobtista bobtista commented Oct 4, 2026 •

Copy link
Copy Markdown

Set_Transform and Get_Transform take a D3DTRANSFORMSTATETYPE, so every caller names a D3D enum.

Now Renderer has Set_Transform, Get_Transform, Set_World_Identity, Set_View_Identity and Set_Projection_Transform_With_Z_Bias, with a RenderBackendTransform enum for world, view and projection. DX8Backend.cpp maps it to the D3D value and asserts on an unknown one. The texture matrix calls in mapper.cpp and matrixmapper.cpp stay on DX8Wrapper, because they come together with texture stage state that is not routed. camera.cpp no longer uses DX8Wrapper and drops its include.

Todo:

  • Build win32, including W3DView and WorldBuilder
  • Load two skirmish saves and the shell map, open W3DView through its device dialog, and open WorldBuilder. Same result as main
  • Replicate to Generals

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

This change adds device, display, format, and transform operations to the renderer API and DX8 backend. WW3D, game rendering code, and WorldBuilder use the renderer for selected queries and transforms previously routed through DX8Wrapper.

Changes

Renderer backend migration

Layer / File(s) Summary
Renderer contract and DX8 forwarding
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp, Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
Renderer declares device, resolution, format, and transform operations. DX8Backend maps transform types and forwards the operations to DX8Wrapper.
WW3D device and display queries
Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
WW3D uses Renderer for selected device, resolution, window, swap-interval, and texture-bit-depth queries. Coordinate normalization uses device dimensions from Renderer.
WW3D transform call sites
Core/Libraries/Source/WWVegas/WW3D2/{dx8renderer,dynamesh,line3d,pointgr,ringobj,seglinerenderer,sortingrenderer,sphereobj,streakRender}.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/{boxrobj,camera,dazzle,decalmsh,linegrp,mapper,mesh,render2d}.cpp
Rendering objects and helpers use Renderer to set, retrieve, and restore world, view, and projection transforms.
Game and tool rendering call sites
Core/GameEngineDevice/Source/W3DDevice/GameClient/{BaseHeightMap,FlatHeightMap,HeightMap,W3DDebugIcons,W3DDisplay,W3DSmudge,W3DSnow,W3DTerrainTracks,W3DTreeBuffer}.cpp, Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/*.cpp, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/{Shadow/*.cpp,W3DInGameUI.cpp,W3DScene.cpp,W3DStatusCircle.cpp}, GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
Game rendering code uses Renderer for selected transforms, back-buffer-format checks, and stencil checks. WorldBuilder uses it for selected world-transform operations.

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

Change: Refactor

Suggested reviewers: xezon

Merge Risk: Minimal · up to f5dc6

No actionable issue remains identified for this renderer migration; it is mergeable after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 17b15

The inspected changes preserve existing rendering-state ownership and display controls. No introduced security weakness was established, but incomplete caller and runtime coverage leaves some uncertainty around the expanded interface.

Retained concerns
No architecture-level concerns identified.

Security review details


Security Blast Radius

  • observed — The gamma path can affect the local display through either the graphics-device gamma ramp or a desktop-device-context fallback. This display-wide sink is unchanged, and the changed W3DView dialog already reached it directly in the review base; the new dispatch route does not demonstrate increased display authority.

Trust Boundaries and Controls

  • inferred — For the inspected paths, the backend is an in-process rendering abstraction rather than a newly demonstrated authorization boundary. Existing device operations and gamma bounds remain in DX8Wrapper. This supports preserved controls for those paths, not a conclusion about all public callers or unsupported input states.
Pre-merge checks: Passed 4

Check name Status Explanation
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.
Title check Passed The title clearly describes the routing of transforms through Renderer.
Description check Passed The description describes the Renderer transform API and the DX8 backend mapping.

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

  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c71256d2-34f8-4666-a090-3622679495f0
📥 Commits

Reviewing files that changed from the base of the PR and between 17b15dab5ffbb207d54d814fddb0b978bf465867 and f5dc6c0ec4ccc2adf77e1fd2222ae721cb2b351b.

📒 Files selected for processing (38)

  • 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/W3DSmudge.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSnow.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/dx8renderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h
  • Core/Libraries/Source/WWVegas/WW3D2/dynamesh.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/line3d.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/streakRender.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3d.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/W3DInGameUI.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DStatusCircle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/boxrobj.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.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/mapper.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/mesh.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp

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

@bobtista
bobtista force-pushed the bobtista/refactor/route-transforms branch from 17b15da to 1787f93 Compare October 9, 2026 15:49
@bobtista bobtista changed the title refactor(ww3d2): Route transforms via IRenderBackend refactor(ww3d2): Route transforms via Renderer Oct 9, 2026
@bobtista
bobtista force-pushed the bobtista/refactor/route-transforms branch 3 times, most recently from f0c0f30 to f5dc6c0 Compare October 11, 2026 06:41
@bobtista
bobtista force-pushed the bobtista/refactor/route-transforms branch 2 times, most recently from 67d314e to b361541 Compare October 24, 2026 16:40
@bobtista
bobtista marked this pull request as ready for review October 24, 2026 16:56
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

Routes world, view, and projection transforms through Renderer.

  • Rendering callers now name transforms through Renderer.

Reviews (6) · Last reviewed commit: "refactor(terrainparticles): Route the wo..." · Reviewed by Greptile

@bobtista
bobtista force-pushed the bobtista/refactor/route-transforms branch from b361541 to e80eba5 Compare October 28, 2026 18:06
@xezon

xezon commented Nov 5, 2026

Copy link
Copy Markdown

Update not pushed.

@bobtista

bobtista commented Nov 5, 2026

Copy link
Copy Markdown
Author

Sorry, I replied before pushing.

@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing Rendering Is Rendering related labels Nov 7, 2026

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Needs replication to Generals.

@bobtista

bobtista commented Nov 7, 2026

Copy link
Copy Markdown
Author

Done

@bobtista
bobtista force-pushed the bobtista/refactor/route-transforms branch from 5a0b52c to be446b7 Compare November 7, 2026 18:04
@xezon
xezon merged commit 5fce8e7 into TheSuperHackers:main Nov 7, 2026
3 checks passed
gamezerve pushed a commit to gamezerve/Reborn-Omega that referenced this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing Rendering Is Rendering related ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants