Fix particle glow transparency for textures without alpha

This commit is contained in:
Kelsi 2026-02-14 22:32:12 -08:00
parent 567e1f95d1
commit a0a327c96c
3 changed files with 29 additions and 9 deletions

View file

@ -167,13 +167,8 @@ BLPImage BLPLoader::loadBLP2(const uint8_t* data, size_t size) {
return BLPImage();
}
// DXT1 with alphaDepth=0 has no meaningful alpha channel, but the DXT1
// color-key mode can produce alpha=0 pixels. Force all alpha to 255.
if (header->alphaDepth == 0) {
for (int i = 0; i < pixelCount; i++) {
image.data[i * 4 + 3] = 255;
}
}
// Note: DXT1 may encode 1-bit transparency via the color-key mode (c0 <= c1).
// Do not override alpha based on alphaDepth; preserve whatever the DXT decompressor produced.
return image;
}