From d1aa3de25e488bf8326d3f359429616999182ddb Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 14 Jan 2025 10:14:35 -0800 Subject: [PATCH] Fixed case where texture is loaded for both additive and non-additive --- BeefySysLib/platform/win/DXRenderDevice.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BeefySysLib/platform/win/DXRenderDevice.cpp b/BeefySysLib/platform/win/DXRenderDevice.cpp index 4a3e1ecc..ed539a18 100644 --- a/BeefySysLib/platform/win/DXRenderDevice.cpp +++ b/BeefySysLib/platform/win/DXRenderDevice.cpp @@ -2106,8 +2106,12 @@ Texture* DXRenderDevice::LoadTexture(const StringImpl& fileName, int flags) return aTexture; } + String pathEx = fileName; + if ((flags & TextureFlag_Additive) != 0) + pathEx += ":add"; + DXTexture* aTexture = NULL; - if (mTextureMap.TryGetValue(fileName, &aTexture)) + if (mTextureMap.TryGetValue(pathEx, &aTexture)) { aTexture->AddRef(); return aTexture; @@ -2251,7 +2255,7 @@ Texture* DXRenderDevice::LoadTexture(const StringImpl& fileName, int flags) aTexture = (DXTexture*)RenderDevice::LoadTexture(fileName, flags); if (aTexture != NULL) { - aTexture->mPath = fileName; + aTexture->mPath = pathEx; mTextureMap[aTexture->mPath] = aTexture; }