You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ww3d2): Route blend state via Renderer - #3705
This change routes the blend state set by game code through Renderer.
Renderer gets Set_Alpha_Blend_Enable, Set_Blend_Factors and Set_Blend_Op. Source and destination factors are set in one call. The backend translates RenderBlend and RenderBlendOp to the D3D8 values explicitly.
Routed call sites are the stenciled player color pass in W3DScene and the script fade in W3DStatusCircle. The calls and values are the same as before.
Blend states in the shader manager, terrain, water and shadows are left for the effect pass changes. ShaderClass::Apply stays in WW3D2.
Golden Replay #1 is pixel identical to #3700 at 120, 150 and 180 seconds.
No actionable comments were generated in the recent review.
Walkthrough
The pull request expands the Renderer interface, adds DX8Backend implementations, and migrates rendering operations and capability checks from DX8Wrapper to Renderer across WW3D, game-client, and tool code. Existing rendering conditions, arguments, and selected direct DX8 operations remain.
Changes
Renderer interface and backend
Layer / File(s)
Summary
Renderer contract and DX8 backend Core/Libraries/Source/WWVegas/WW3D2/Renderer.h, Core/Libraries/Source/WWVegas/WW3D2/Backend/DX8Backend.cpp
Renderer adds capability queries and methods for render targets, render state, buffers, drawing, texture transforms, lights, and fog. DX8Backend forwards these operations to DX8Wrapper and maps blend values.
Capability checks and render targets Core/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp, Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp, Core/Libraries/Source/WWVegas/WW3D2/{texture*,textureloader.cpp,ww3dformat.cpp,meshmdl.cpp,statistics.cpp,meshmatdesc.cpp}, Core/Libraries/Source/WWVegas/WW3D2/texproject.cpp, Generals*/Code/Tools/WorldBuilder/src/ObjectPreview.cpp
Texture-format and feature checks now call Renderer. Render-target setup and restoration in texture projection and WorldBuilder previews now use Renderer. Existing format fallback sequences remain.
WW3D rendering and scene paths Core/Libraries/Source/WWVegas/WW3D2/*, Generals/Code/Libraries/Source/WWVegas/WW3D2/{dazzle.cpp,decalmsh.cpp}, GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/{dazzle.cpp,decalmsh.cpp,linegrp.cpp,scene.cpp}
Geometry, material, mapper, decal, particle, and scene paths use Renderer for applicable state, buffer, and draw operations. Existing sorting paths remain in place.
Terrain, weather, and water rendering Core/GameEngineDevice/Source/W3DDevice/GameClient/{BaseHeightMap.cpp,FlatHeightMap.cpp,HeightMap.cpp,W3D*.cpp,Water/*}
Terrain, weather, shoreline, and water paths use Renderer for supported state, buffer, texture, and draw operations. Direct DX8 operations that were not changed remain.
Game-client effects and scene rendering Generals*/Code/GameEngineDevice/Source/W3DDevice/GameClient/{Shadow/*,W3D*.cpp}
Shadow, bridge, road, bib, status-circle, UI, and scene paths use Renderer for the changed rendering operations. Existing draw branches and arguments remain.
Editor and view rendering Core/Tools/W3DView/ScreenCursor.cpp, Generals*/Code/Tools/WorldBuilder/src/{DrawObject.cpp,ObjectPreview.cpp}
WorldBuilder drawing and preview paths, plus W3DView cursor rendering, use Renderer for applicable state, buffer, render-target, and draw operations.
This refactor routes rendering state, buffer, draw, and capability calls through Renderer while keeping the same arguments and conditions. No concrete regression was found, and the author reports pixel-identical replay output. The change appears safe to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the refactor that routes blend state through Renderer. The changeset adds Set_Alpha_Blend_Enable, Set_Blend_Factors and Set_Blend_Op to Renderer, along with the RenderBlend and RenderB…
Description check
The description states that the PR routes game-code blend state through Renderer. It names the new Set_Alpha_Blend_Enable, Set_Blend_Factors and Set_Blend_Op methods and the affected call sites in W3D…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the refactor that routes blend state through Renderer. The changeset adds Set_Alpha_Blend_Enable, Set_Blend_Factors and Set_Blend_Op to Renderer, along with the RenderBlend and RenderBlendOp enums. The title is specific and matches the main change, although the raw summary also covers many unrelated Renderer routing changes.
Full details: Description check
Explanation
The description states that the PR routes game-code blend state through Renderer. It names the new Set_Alpha_Blend_Enable, Set_Blend_Factors and Set_Blend_Op methods and the affected call sites in W3DScene and W3DStatusCircle. It is on-topic and specific 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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up for #2613
Merge after #3700
This change routes the blend state set by game code through
Renderer.RenderergetsSet_Alpha_Blend_Enable,Set_Blend_FactorsandSet_Blend_Op. Source and destination factors are set in one call. The backend translatesRenderBlendandRenderBlendOpto the D3D8 values explicitly.Routed call sites are the stenciled player color pass in
W3DSceneand the script fade inW3DStatusCircle. The calls and values are the same as before.Blend states in the shader manager, terrain, water and shadows are left for the effect pass changes.
ShaderClass::Applystays in WW3D2.Golden Replay #1 is pixel identical to #3700 at 120, 150 and 180 seconds.