1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Fixed case where texture is loaded for both additive and non-additive

This commit is contained in:
Brian Fiete 2025-01-14 10:14:35 -08:00
parent 96c0a44a7e
commit d1aa3de25e

View file

@ -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;
}