bugfix(ww3d2): Fix mesh material color processing - #3246
Conversation
PR Summary by QodoInitialize WW3D2 mesh material colors safely
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
|
| Filename | Overview |
|---|---|
| Generals/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp | Adds null-safe per-material color processing and a valid early exit once all color channels are detected. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshmatdesc.cpp | Mirrors the material-color fix and makes the later lighting scan null-safe; the previous thread was manually resolved without explanation. |
Reviews (6): Last reviewed commit: "refactor(ww3d2): Stop material analysis ..." | Re-trigger Greptile
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
xezon
left a comment
There was a problem hiding this comment.
Code looks logical. I don't know how this will translate to the game.
xezon
left a comment
There was a problem hiding this comment.
Did you test in game? Does it look normal?
Prevents crashes on null mesh materials and incorrect vertex colors caused by reusing another material's ambient or emissive color. Skips null entries, applies each vertex's own material colors, and removes unused first-material baseline calculations in Generals and Zero Hour.
For example, with white input vertex colors and two ambient-only materials, green followed by red, the old code applies the last material's red color to both vertices:
This RGB example was reproduced in the CPU regression test. Emissive-only materials have the same problem.