From af7c2fb4e9b6eb14985145e6109ab51ad2ef8826 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 9 Jun 2020 22:06:19 +0200 Subject: [PATCH] - fixed the burn shader. --- src/common/textures/gametexture.cpp | 2 +- src/common/textures/hw_material.h | 5 +++++ src/rendering/2d/f_wipe.cpp | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/textures/gametexture.cpp b/src/common/textures/gametexture.cpp index 66775d1e26b..29d1ee2dd42 100644 --- a/src/common/textures/gametexture.cpp +++ b/src/common/textures/gametexture.cpp @@ -389,7 +389,7 @@ void FGameTexture::SetSpriteRect() void FGameTexture::CleanHardwareData(bool full) { - Base->CleanHardwareTextures(); + if (full) Base->CleanHardwareTextures(); for (auto mat : Material) if (mat) mat->DeleteDescriptors(); } diff --git a/src/common/textures/hw_material.h b/src/common/textures/hw_material.h index e8c013d2b18..75a77e35a10 100644 --- a/src/common/textures/hw_material.h +++ b/src/common/textures/hw_material.h @@ -48,6 +48,11 @@ class FMaterial return sourcetex; } + void ClearLayers() + { + mTextureLayers.Resize(1); + } + void AddTextureLayer(FTexture *tex, bool allowscale) { mTextureLayers.Push({ tex, allowscale }); diff --git a/src/rendering/2d/f_wipe.cpp b/src/rendering/2d/f_wipe.cpp index 6109cb3d620..320bb869dd5 100644 --- a/src/rendering/2d/f_wipe.cpp +++ b/src/rendering/2d/f_wipe.cpp @@ -338,6 +338,7 @@ void Wiper_Burn::SetTextures(FGameTexture *startscreen, FGameTexture *endscreen) endScreen = endscreen; BurnTexture = new FBurnTexture(WIDTH, HEIGHT); auto mat = FMaterial::ValidateTexture(endScreen, false); + mat->ClearLayers(); mat->AddTextureLayer(BurnTexture, false); }