Repository navigation
Conversation
49697d3 to
4afd60d
Compare
d0b9943 to
1fac15e
Compare
a2fa516 to
8c35ce1
Compare
8c35ce1 to
f199b80
Compare
a5d1f21 to
0131536
Compare
8217c3d to
2262bf0
Compare
[Medium impact] The routing change reaches shared rendering paths in both games and their graphics tools. The rendering changes appear sound, but the remaining brace-rule violation must be fixed before merging. Findings
|
| if (material_changed) Renderer::Set_Material(material_array[tris[next_tri_idx].I]); | ||
| if (shader_changed) Renderer::Set_Shader(shader_array[next_tri_idx]); |
There was a problem hiding this comment.
Conditional bodies remain inline. These two modified statements violate the repository rule that executable conditional bodies must start on a separate line. Move each
Renderer call below its if, keeping the existing indentation and leaving out braces. This lets developers place separate breakpoints on the condition and the call.
| if (material_changed) Renderer::Set_Material(material_array[tris[next_tri_idx].I]); | |
| if (shader_changed) Renderer::Set_Shader(shader_array[next_tri_idx]); | |
| if (material_changed) | |
| Renderer::Set_Material(material_array[tris[next_tri_idx].I]); | |
| if (shader_changed) | |
| Renderer::Set_Shader(shader_array[next_tri_idx]); |
Rule Used: Always place the body of if, else, else if, for, and while statements on a separate source line from the control-flow statement. Rules: - Never place an executable statement on the same line as its controlling condition or else keywo... (source)
Learned From
TheSuperHackers/GeneralsGameCode#2067
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
2262bf0 to
72d9435
Compare
|
This branch contains refactor(ww3d2): Route terrain particle shader and material state via Renderer Is it meant to be here? |
Now
Set_Shader,Set_MaterialandApply_Render_State_Changesare onRenderer, and the remainingInvalidate_Cached_Render_Statescallers use the existing method.DX8Backend.cppforwards each one toDX8Wrapper. This includes callers in the DX8 renderer classes, which are shared code and need the backend for anything other than DX8.Many of these functions still set texture stage and render state through
DX8Wrapperright after the routed calls. Those calls stay as they are.Zero Hour save at 60 seconds on top, Generals shell map below. Before on the left, after on the right.
Todo: