From ee175c8170b7740d49aebf3a0ca5a8303144e43f Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 10 Aug 2019 23:28:04 +0300 Subject: [PATCH] fixed #201 --- src/format.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/format.h b/src/format.h index 8a76b15..0502f7e 100644 --- a/src/format.h +++ b/src/format.h @@ -1902,7 +1902,7 @@ namespace TR { int32 x, y, z; uint32 radius; int32 intensity; - Color32 color; + Color24 color; float in, out; float length, cutoff; vec3 dir; @@ -4189,7 +4189,6 @@ namespace TR { ASSERTV(intensity == intensity2); int value = clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255); light.color.r = light.color.g = light.color.b = value; - light.color.a = 0; light.intensity = intensity; light.radius = stream.readBE32() * 2; @@ -5394,10 +5393,13 @@ namespace TR { if (version & (VER_TR3 | VER_TR4)) { stream.read(light.color); + stream.read(light.type); } if (version & VER_TR4) { - stream.read(light.type); + uint8 unknown; + stream.read(unknown); + ASSERT(unknown == 0x00 || unknown == 0xFF); uint8 byteIntensity; intensity = stream.read(byteIntensity); stream.read(light.in); @@ -5429,7 +5431,6 @@ namespace TR { if ((version & VER_VERSION) < VER_TR3) { int value = clamp((intensity > 0x1FFF) ? 0 : (intensity >> 5), 0, 255); light.color.r = light.color.g = light.color.b = value; - light.color.a = 0; } light.intensity = intensity;