示例#1
0
 public bool Equals(MapColorArgb other)
 {
     return(A == other.A &&
            R == other.R &&
            G == other.G &&
            B == other.B);
 }
示例#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, 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
                };
            }));
        }
示例#3
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
                };
            }));
        }