chore(dx8fvf): Remove unused vertex_size parameter from FVFInfoClass#2615
Conversation
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8fvf.h | Removes vertex_size=0 default parameter from FVFInfoClass constructor declaration — clean and correct. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8fvf.cpp | Removes vertex_size parameter from constructor and simplifies fvf_size initializer to always call Get_FVF_Vertex_Size(FVF) directly, safe given callers now assert FVF != 0. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.h | Removes vertex_size=0 default parameter from both VertexBufferClass and DX8VertexBufferClass constructor declarations — consistent with implementation changes. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp | Removes vertex_size parameter from VertexBufferClass and DX8VertexBufferClass constructors, replaces the dual-condition assertion with a simple FVF != 0 guard. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp | Adds WWASSERT(FVF != 0) to the Generals version of VertexBufferClass constructor to match the invariant now enforced in ZH — the Generals build already had no vertex_size parameter. |
Sequence Diagram
sequenceDiagram
participant Caller
participant DX8VB as DX8VertexBufferClass
participant VB as VertexBufferClass
participant FVF as FVFInfoClass
Caller->>DX8VB: DX8VertexBufferClass(FVF, count, usage)
DX8VB->>VB: VertexBufferClass(BUFFER_TYPE_DX8, FVF, count)
VB->>VB: WWASSERT(FVF != 0)
VB->>FVF: FVFInfoClass(FVF)
FVF->>FVF: fvf_size = Get_FVF_Vertex_Size(FVF)
FVF-->>VB: fvf_info set
VB-->>DX8VB: base constructed
DX8VB-->>Caller: ready
Prompt To Fix All With AI
This is a comment left during a code review.
Path: GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8vertexbuffer.cpp
Line: 83-84
Comment:
**WWASSERT spacing inconsistency**
The new assertion uses `FVF != 0` with spaces around the operator, while the line immediately above (`type==BUFFER_TYPE_DX8 || type==BUFFER_TYPE_SORTING`) uses no spaces. Minor style inconsistency within the same block.
```suggestion
WWASSERT(FVF!=0);
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "Add defensive assert" | Re-trigger Greptile
No need as the code was introduced only in ZH so the current PR restores it exactly back to how it was in Generals. The assertion is not needed anymore with vertex_size gone. |
|
greptile has a complaint. Please check. |
This removes the
vertex_sizeparameter fromFVFInfoClasswhich was introduced in ZH but unused.It was added to support vertex buffer layouts not describable with existing FVF layouts, presumably to use for cube mapping or displacement mapping as the file header suggests.