Skip to content

refactor(ww3d2): Widen IRenderBackend draw arguments to 32 bits - #3425

Draft
bobtista wants to merge 9 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/widen-draw-arguments
Draft

bobtista wants to merge 9 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/refactor/widen-draw-arguments

Conversation

@bobtista

@bobtista bobtista commented Oct 4, 2026 •

Copy link
Copy Markdown

Draw_Triangles, Draw_Strip and Set_Index_Buffer on IRenderBackend take 16-bit start index, counts, vertex range and index base offset, because that is what the DX8Wrapper signatures take.

Now the interface takes 32-bit values. DX8Backend narrows them to 16 bits and asserts that nothing was lost. Release builds narrow exactly as before. Debug builds now assert where a caller passes a value above 65535, which the old implicit conversion truncated silently.

Todo:

  • Build win32 and vc6, 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
  • Load two skirmish saves in a debug build. No assertion from the backend
  • Replicate to Generals

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b1cc432-3b27-42b5-bec1-3027fb3ec543
📥 Commits

Reviewing files that changed from the base of the PR and between f8ba7eb and 6799d9d.

📒 Files selected for processing (54)
  • 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/W3DTerrainTracks.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.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/Backend/DX8Backend.h
  • Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h
  • Core/Libraries/Source/WWVegas/WW3D2/dx8polygonrenderer.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/matpass.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/texproject.cpp
  • Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
  • Core/Tools/W3DView/GammaDialog.cpp
  • Core/Tools/W3DView/MainFrm.cpp
  • Core/Tools/W3DView/ScreenCursor.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/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/Libraries/Source/WWVegas/WW3D2/scene.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/DrawObject.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/ObjectPreview.cpp
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@bobtista
bobtista force-pushed the bobtista/refactor/widen-draw-arguments branch from d13ea40 to 6799d9d Compare October 4, 2026 16:18
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