refactor(baseheightmap): Extract scorch rendering from BaseHeightMap into new W3DScorch - #3017
refactor(baseheightmap): Extract scorch rendering from BaseHeightMap into new W3DScorch#3017stephanmeesters wants to merge 1 commit into
Conversation
…into new W3DScorch
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DScorch.cpp | Implements the extracted scorch lifecycle, geometry generation, and draw submission. |
| Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DScorch.h | Defines the real and no-op scorch-rendering implementations. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp | Replaces embedded scorch state and behavior with delegation to the new renderer. |
| Core/GameEngineDevice/Include/W3DDevice/GameClient/BaseHeightMap.h | Removes embedded scorch data and exposes the delegated draw entry point. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp | Routes flat-terrain scorch drawing through BaseHeightMap. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp | Routes regular-terrain scorch drawing through BaseHeightMap. |
| Core/GameEngineDevice/CMakeLists.txt | Adds the extracted scorch implementation to the device-library sources. |
Sequence Diagram
sequenceDiagram
participant Terrain as HeightMap Render
participant Base as BaseHeightMap
participant Scorch as W3DScorch
participant Map as WorldHeightMap
participant DX8 as DX8Wrapper
Terrain->>Base: drawScorches()
Base->>Scorch: drawScorches(map)
Scorch->>Map: read terrain heights and flip state
Scorch->>Scorch: rebuild vertex/index buffers when invalidated
Scorch->>DX8: bind buffers, shader, and texture
Scorch->>DX8: Draw_Triangles()
Reviews (2): Last reviewed commit: "refactor(baseheightmap): Extract scorch ..." | Re-trigger Greptile
| { | ||
| public: | ||
| void allocateScorchBuffers() override {} | ||
| void freeBuffers() override {} |
There was a problem hiding this comment.
Here you removed "Scorch" from function name but not from the others. I suggest keep consistent either way.
| { | ||
| return; | ||
| } | ||
| if (!map) |
There was a problem hiding this comment.
Maybe test this outside of this function and pass WorldHeightMap as reference?
| m_shroud = nullptr; | ||
| #if ENABLE_CONFIGURABLE_SHROUD | ||
| if (TheGlobalData->m_shroudOn) | ||
| m_shroud = NEW W3DShroud; |
| Int m_scorchesInBuffer; ///< how many are in the buffers. If less than numScorches, we need to update | ||
| }; | ||
|
|
||
| class W3DScorchDummy : public W3DScorch |
There was a problem hiding this comment.
Maybe make a proper interface, then the dummy does not need to carry all the members of W3DScorch.
W3DScorchDO_SCORCHhave mostly been removedDO_SCORCHbefore didn't compile but this has been fixed. Scorches are now disabled usingW3DScorchDummywhen usingDO_SCORCH=0W3DScorchDummycould be used in headless mode (not part of this PR)N.B. some code was in
DO_SCORCHthat didn't actually belong inside the macro, for exampleReal m_curImpassableSlope;