From 588b484128f40da98050601c75326d4bed1842e8 Mon Sep 17 00:00:00 2001 From: Drombeys Date: Wed, 11 Dec 2024 12:14:18 +0300 Subject: [PATCH] Fix wallmark render --- src/Layers/xrRender/Blender_Screen_SET.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Layers/xrRender/Blender_Screen_SET.cpp b/src/Layers/xrRender/Blender_Screen_SET.cpp index 16ac5e1cd7..0189c3c04d 100644 --- a/src/Layers/xrRender/Blender_Screen_SET.cpp +++ b/src/Layers/xrRender/Blender_Screen_SET.cpp @@ -247,9 +247,19 @@ void CBlender_Screen_SET::Compile (CBlender_Compile& C) C.StageBegin (); C.StageSET_Address (oClamp.value?D3DTADDRESS_CLAMP:D3DTADDRESS_WRAP); - C.StageSET_Color (D3DTA_TEXTURE, D3DTOP_BLENDDIFFUSEALPHA, D3DTA_DIFFUSE); - C.StageSET_Alpha (D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - C.Stage_Texture (oT_Name); + + // This code fixes the rendering of wallmarks in editors, + // but breaks dynamic wallmarks in the game, so here ifdef + #ifdef _EDITOR + C.StageSET_Color(D3DTA_TEXTURE, D3DTOP_BLENDDIFFUSEALPHA, D3DTA_DIFFUSE); + C.StageSET_Alpha(D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); + C.Stage_Texture(oT_Name); + #else + C.StageSET_Color(D3DTA_DIFFUSE, D3DTOP_BLENDDIFFUSEALPHA, D3DTA_CURRENT); + C.StageSET_Alpha(D3DTA_DIFFUSE, D3DTOP_MODULATE, D3DTA_CURRENT); + C.Stage_Texture("$null"); + #endif + C.Stage_Matrix ("$null", 0); C.Stage_Constant ("$null"); C.StageEnd ();