Exemplo n.º 1
0
        private static ColorChannelControl ReadChannelControl(EndianBinaryReader stream)
        {
            var retVal = new ColorChannelControl
            {
                LightingEnabled     = stream.ReadBoolean(),
                MaterialSrc         = (GXColorSrc)stream.ReadByte(),
                LitMask             = (GXLightMask)stream.ReadByte(),
                DiffuseFunction     = (GXDiffuseFunction)stream.ReadByte(),
                AttenuationFunction = (GXAttenuationFunction)stream.ReadByte(),
                AmbientSrc          = (GXColorSrc)stream.ReadByte()
            };

            switch ((int)retVal.AttenuationFunction)
            {
            case 0:
            case 2:
                break;

            case 1:
                retVal.AttenuationFunction = GXAttenuationFunction.Spec;
                break;

            case 3:
                retVal.AttenuationFunction = GXAttenuationFunction.Spot;
                break;
            }

            Trace.Assert(stream.ReadUInt16() == 0xFFFF); // Padding
            return(retVal);
        }
Exemplo n.º 2
0
        private static ColorChannelControl ReadChannelControl(EndianBinaryReader stream)
        {
            var retVal = new ColorChannelControl
            {
                LightingEnabled     = stream.ReadBoolean(),
                MaterialSrc         = (GXColorSrc)stream.ReadByte(),
                LitMask             = (GXLightMask)stream.ReadByte(),
                DiffuseFunction     = (GXDiffuseFunction)stream.ReadByte(),
                AttenuationFunction = (GXAttenuationFunction)stream.ReadByte(),
                AmbientSrc          = (GXColorSrc)stream.ReadByte()
            };

            Trace.Assert(stream.ReadUInt16() == 0xFFFF); // Padding
            return(retVal);
        }