diff --git a/src/Layers/xrRender/r__dsgraph_build.cpp b/src/Layers/xrRender/r__dsgraph_build.cpp index 691c89b319a..e83680a62a9 100644 --- a/src/Layers/xrRender/r__dsgraph_build.cpp +++ b/src/Layers/xrRender/r__dsgraph_build.cpp @@ -89,7 +89,12 @@ void R_dsgraph_structure::insert_dynamic(IRenderable* root, dxRender_Visual* pVi if (!sh->passes[0]->ps->hud_disabled) { - HUDMask.insert_anyway(distSQ, _MatrixItemSSFX({ SSA, root, pVisual, xform, sh })); + auto hudMaskNode = HUDMask.insert_anyway(distSQ); + hudMaskNode->second.ssa = SSA; + hudMaskNode->second.pObject = root; + hudMaskNode->second.pVisual = pVisual; + hudMaskNode->second.Matrix = xform; + hudMaskNode->second.se = sh; } #if RENDER != R_R1 @@ -202,7 +207,12 @@ void R_dsgraph_structure::insert_static(dxRender_Visual* pVisual) // Water rendering if (sh->flags.isWater) { - mapWater.insert_anyway(distSQ, _MatrixItemSSFX({ SSA, NULL, pVisual, Fidentity, sh })); + auto waterNode = mapWater.insert_anyway(distSQ); + waterNode->second.ssa = SSA; + waterNode->second.pObject = NULL; + waterNode->second.pVisual = pVisual; + waterNode->second.Matrix = Fidentity; + waterNode->second.se = sh; return; } diff --git a/src/Layers/xrRender/r__dsgraph_structure.h b/src/Layers/xrRender/r__dsgraph_structure.h index 12b817c563d..a78a7699c47 100644 --- a/src/Layers/xrRender/r__dsgraph_structure.h +++ b/src/Layers/xrRender/r__dsgraph_structure.h @@ -141,8 +141,8 @@ struct R_dsgraph_structure mapLOD.destroy(); mapDistort.destroy(); mapHUDSorted.destroy(); - HUDMask.destroy(); - mapWater.destroy(); + //HUDMask.destroy(); + //mapWater.destroy(); #if RENDER != R_R1 mapWmark.destroy(); diff --git a/src/Layers/xrRender/r__dsgraph_types.h b/src/Layers/xrRender/r__dsgraph_types.h index 6d5d32f1e3a..2972b6851c9 100644 --- a/src/Layers/xrRender/r__dsgraph_types.h +++ b/src/Layers/xrRender/r__dsgraph_types.h @@ -28,7 +28,7 @@ struct _MatrixItemSSFX dxRender_Visual* pVisual; Fmatrix Matrix; // matrix (copy) ShaderElement* se; - Fmatrix PrevMatrix{}; + mutable Fmatrix PrevMatrix{}; }; struct _MatrixItemS