From 4307603bc2720a63497600f366ef25316bc41f86 Mon Sep 17 00:00:00 2001 From: XProger Date: Thu, 15 Nov 2018 06:43:53 +0300 Subject: [PATCH] #138 fix transparency for animated textures --- src/format.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/format.h b/src/format.h index 9ba4912..2ca73c5 100644 --- a/src/format.h +++ b/src/format.h @@ -5161,9 +5161,22 @@ namespace TR { } void initAnimTex() { - for (int i = 0; i < animTexturesCount; i++) - for (int j = 0; j < animTextures[i].count; j++) - objectTextures[animTextures[i].textures[j]].animated = true; + for (int i = 0; i < animTexturesCount; i++) { + bool transp = false; + for (int j = 0; j < animTextures[i].count; j++) { + TextureInfo &t = objectTextures[animTextures[i].textures[j]]; + t.animated = true; + if (t.attribute != 0) + transp = 1; + } + + if (transp) { + for (int j = 0; j < animTextures[i].count; j++) { + TextureInfo &t = objectTextures[animTextures[i].textures[j]]; + t.attribute = 1; + } + } + } } void shiftAnimTex() {