Skip to content

refactor(ww3d2): Route buffers and draw calls via Renderer - #3423

Draft
bobtista wants to merge 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-buffers-draws
Draft

bobtista wants to merge 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-buffers-draws

Conversation

@bobtista

@bobtista bobtista commented Oct 4, 2026 •

Copy link
Copy Markdown

Now Set_Vertex_Buffer, Set_Index_Buffer, Set_Index_Buffer_Index_Offset, Draw_Triangles and Draw_Strip are on Renderer. The signatures match DX8Wrapper, including the 16-bit draw arguments. Widening them is a separate change. The second Draw_Strip argument is named polygon_count, as in the DX8Wrapper implementation, because it is a primitive count and not an index count. dx8polygonrenderer.h now includes ww3d.h and Renderer.h for its inline draw calls. Three files no longer use DX8Wrapper and drop 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 →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change expands the WW3D Renderer interface and adds a DX8 backend implementation. Rendering and device-query call sites across WW3D2, game code, W3DView, and WorldBuilder now use the interface for selected operations. Existing rendering conditions and arguments remain unchanged in the described migrations.

Changes

Renderer interface and device integration

Layer / File(s) Summary
Renderer API and device integration
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp, Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp, Generals/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp, Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp
Renderer adds device queries, render-state, buffer, draw, transform, lighting, and fog methods. DX8Backend forwards these operations to DX8Wrapper. WW3D device queries and camera and 2D viewport setup now use the interface.
WW3D2 render-object and mesh paths
Core/Libraries/Source/WWVegas/WW3D2/*, Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp
Mesh, object, particle, line, polygon, scene, and 2D rendering paths use Renderer for selected state, transform, buffer, viewport, and draw operations. Sorting paths remain in place where described.
Terrain, water, and environment rendering
Core/GameEngineDevice/Source/W3DDevice/GameClient/*, Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/*
Terrain, shoreline, tree, water, snow, scorch, and shader paths use Renderer for selected render-state, resource-binding, transform, format-query, and draw operations.
Game scenes, objects, and shadows
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/*, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/*
Scene, bridge, road, bib, status-circle, and shadow paths use Renderer for selected rendering operations and capability checks.
Display and editor integrations
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp, Core/Tools/W3DView/*, GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
Gamma updates use WW3D APIs. W3DView cursor rendering and WorldBuilder drawing use Renderer for selected operations.

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

Change: Refactor

Merge Risk: Minimal · previous review ce726

No concrete issue remains that would prevent merging after the planned checks.

Pre-merge checks | Passed 4

✅ Passed checks (4 passed)

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: routing buffer binding and draw calls through the Renderer API.
Description check Passed The description directly explains the Renderer API changes, signature decisions, follow-up dependencies, testing completed, and remaining validation work.
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.
ℹ️ Recent review info

⚙️ Run configuration

  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 370c7873-8c31-44bf-96ba-7834cd8e7397
📥 Commits

Reviewing files that changed from the base of the PR and between 71431437ecbc293274bb2521a31c77376998eb2c and ce7268df2a33ca88ed9e4927d064ade9ec44e4c2.

📒 Files selected for processing (3)

  • Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/Renderer.h
  • Core/Libraries/Source/WWVegas/WW3D2/ww3d.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.

@bobtista
bobtista force-pushed the bobtista/refactor/route-buffers-draws branch 2 times, most recently from 98f8419 to 032917c Compare October 9, 2026 15:49
@bobtista bobtista changed the title refactor(ww3d2): Route buffers and draw calls via IRenderBackend refactor(ww3d2): Route buffers and draw calls via Renderer Oct 9, 2026
@bobtista
bobtista force-pushed the bobtista/refactor/route-buffers-draws branch 3 times, most recently from ce7268d to f70769f Compare October 11, 2026 06:41
@bobtista
bobtista force-pushed the bobtista/refactor/route-buffers-draws branch 2 times, most recently from a453e2b to 470fadb Compare October 24, 2026 16:40
@bobtista
bobtista force-pushed the bobtista/refactor/route-buffers-draws branch from 470fadb to 9861b01 Compare October 28, 2026 18:06
@bobtista
bobtista force-pushed the bobtista/refactor/route-buffers-draws branch from 9861b01 to 8f76332 Compare November 9, 2026 03:05
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