Skip to content

refactor(ww3d2): Route capability queries via Renderer - #3699

Draft
bobtista wants to merge 6 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-caps-queries
Draft

bobtista wants to merge 6 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/route-caps-queries

Conversation

@bobtista

Copy link
Copy Markdown

Now the capability queries game code uses are on Renderer: Supports_Texture_Format, Supports_DXTC, Supports_Dot3, Supports_Point_Sprites, Supports_NPatches, Supports_Bump_Envmap, Supports_Bump_Envmap_Luminance, Supports_ZBias and Get_Max_Textures_Per_Pass. Each forwards to DX8Caps. shader.cpp, the DX8 buffer classes and the raw D3DCAPS8 reads stay on DX8Wrapper.

Todo:

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

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Renderer gains capability, render-target, buffer, and draw methods with DX8 backend forwarding. WW3D, game, Generals, and tool call sites use the interface. GeneralsMD also comments out two bump-environment checks, and GameText.cpp resets debug macros before defining no-op versions.

Changes

Renderer Interface Migration

Layer / File(s) Summary
Renderer API and DX8 backend
Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp, Core/Libraries/Source/Lib/Include/Lib/BaseFunctions.h
Renderer declares capability, render-target, buffer, and draw methods. DX8Backend forwards these methods to DX8Wrapper, and check_cast checks integer conversions.
Capability and resource queries
Core/Libraries/Source/WWVegas/WW3D2/*, Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp, Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp, Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp
Texture-format, compression, N-patch, DOT3, Z-bias, and texture-stage queries use Renderer. GeneralsMD comments out two bump-environment checks in pass processing.
WW3D rendering call sites
Core/Libraries/Source/WWVegas/WW3D2/*
WW3D renderers use Renderer for texture and buffer binding, index offsets, render-target changes, and draw calls. Sorted-triangle paths remain with SortingRendererClass.
Game terrain and effects
Core/GameEngineDevice/Source/W3DDevice/GameClient/*
Terrain, snow, shader, particle, track, tree, and debug-icon paths use Renderer for capability checks, texture and buffer operations, and draws.
Water and water tracks
Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/*
Water paths use Renderer for reflection targets, buffer binding, and draw calls across sky, water meshes, rivers, trapezoid water, and tracks.
Generals and GeneralsMD rendering
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/*, Generals/Code/Libraries/Source/WWVegas/WW3D2/*, GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/*, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/*
Shadows, decals, dazzle, lines, 2D rendering, bridges, bibs, roads, UI, and status circles use Renderer for rendering operations.
Rendering tools
Core/Tools/W3DView/ScreenCursor.cpp, Generals/Code/Tools/WorldBuilder/src/*, GeneralsMD/Code/Tools/WorldBuilder/src/*
W3DView and both WorldBuilder variants use Renderer for cursor and object rendering, buffer operations, and preview render-target selection.

Autorun debug macros

Layer / File(s) Summary
Debug macro definitions
Core/Tools/Autorun/GameText.cpp
The file undefines DEBUG_LOG and DEBUG_ASSERTCRASH before defining the no-op macros.

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

Change: Refactor

Suggested reviewers: xezon, stephanmeesters

Merge Risk: Minimal · previous review fdb21

The change routes rendering calls through the Renderer interface without a visible behavior change. No concrete merge-blocking issue was identified. The skirmish-save and shell-map checks in the PR remain unchecked.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: capability queries used by game code are routed through the new Renderer class. The changeset matches this. Many files switch from DX8Wrapper to Renderer, and the Rend…
Description check Passed The description states the change: game code capability queries move to Renderer (Supports_Texture_Format, Supports_DXTC, Supports_Dot3, and others), and each forwards to DX8Caps. It also names what s…
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: capability queries used by game code are routed through the new Renderer class. The changeset matches this. Many files switch from DX8Wrapper to Renderer, and the Renderer.h diff adds the Supports_* and Get_Max_Textures_Per_Pass methods. The title is specific and omits the broader buffer and draw-call routing, which the commit history and objectives describe as preceding work.

Full details: Description check

Explanation

The description states the change: game code capability queries move to Renderer (Supports_Texture_Format, Supports_DXTC, Supports_Dot3, and others), and each forwards to DX8Caps. It also names what stays on DX8Wrapper and lists the build and replication todo items. It relates directly to the changeset.

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: bec06a5f-754e-4700-8e72-3123e052d2b2
Commits

Reviewing files that changed from the base of the PR and between df5c10f and fdb2102.

Files selected for processing: 29

  • Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScorch.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DSmudge.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainTracks.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.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/matpass.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/seglinerenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/streakRender.cpp
  • Core/Tools/W3DView/ScreenCursor.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.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/W3DStatusCircle.cpp
  • Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.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/W3DStatusCircle.cpp
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.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; 1 remain after this review.

@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 21, 2026
@bobtista
bobtista force-pushed the bobtista/refactor/route-caps-queries branch from d8c9710 to 1312c0b Compare November 22, 2026 14:24
@bobtista
bobtista force-pushed the bobtista/refactor/route-caps-queries branch 2 times, most recently from df5c10f to fdb2102 Compare November 27, 2026 15:36
@bobtista
bobtista force-pushed the bobtista/refactor/route-caps-queries branch from fdb2102 to f4f7c4f Compare November 27, 2026 16:26
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