Exemplo n.º 1
0
        internal static GlobalLighting Parse(BinaryReader reader, MapParseContext context)
        {
            return(ParseAsset(reader, context, version =>
            {
                var time = reader.ReadUInt32AsEnum <TimeOfDay>();

                var lightingConfigurations = new Dictionary <TimeOfDay, GlobalLightingConfiguration>();

                for (var i = 0; i < TimeOfDayValues.Length; i++)
                {
                    lightingConfigurations[TimeOfDayValues[i]] = GlobalLightingConfiguration.Parse(reader, version);
                }

                var shadowColor = MapColorArgb.Parse(reader);

                // TODO: BFME. Overbright? Bloom?
                byte[] unknown = null;
                if (version >= 7 && version < 11)
                {
                    unknown = reader.ReadBytes(version >= 9 ? 4 : 44);
                }

                Vector3?unknown2 = null;
                MapColorArgb?unknown3 = null;
                if (version >= 12)
                {
                    unknown2 = reader.ReadVector3();
                    unknown3 = MapColorArgb.Parse(reader);
                }

                ColorRgbF?noCloudFactor = null;
                if (version >= 8)
                {
                    noCloudFactor = reader.ReadColorRgbF();
                }

                return new GlobalLighting
                {
                    Time = time,
                    LightingConfigurations = lightingConfigurations,
                    ShadowColor = shadowColor,
                    Unknown = unknown,
                    Unknown2 = unknown2,
                    Unknown3 = unknown3,
                    NoCloudFactor = noCloudFactor
                };
            }));
        }
Exemplo n.º 2
0
        internal static GlobalLighting Parse(BinaryReader reader, MapParseContext context)
        {
            return(ParseAsset(reader, context, version =>
            {
                var time = reader.ReadUInt32AsEnum <TimeOfDay>();

                var lightingConfigurations = new Dictionary <TimeOfDay, GlobalLightingConfiguration>();

                for (var i = 0; i < TimeOfDayValues.Length; i++)
                {
                    lightingConfigurations[TimeOfDayValues[i]] = GlobalLightingConfiguration.Parse(reader);
                }

                var shadowColor = MapColorArgb.Parse(reader);

                return new GlobalLighting
                {
                    Time = time,
                    LightingConfigurations = lightingConfigurations,
                    ShadowColor = shadowColor
                };
            }));
        }