예제 #1
0
        protected override void ReadV8(ByteReader reader)
        {
            base.ReadV8(reader);

            DataFlags = reader.ReadU16();
            if (( DataFlags & 0x0001 ) == 0x0001) {
                // Pattern bits are valid
                if (( DataFlags & 0x0002 ) == 0x0002) {
                    float c = reader.ReadF32();
                    AmbientColor = new[] {c, c, c, 1.0f};
                } else {
                    AmbientColor = reader.ReadRGBA();
                }
                DiffuseColor = reader.ReadRGBA();
                if ( ( DataFlags & 0x0004 ) == 0x0004 ) {
                    float c = reader.ReadF32();
                    SpecularColor = new[] { c, c, c, 1.0f };
                } else {
                    SpecularColor = reader.ReadRGBA();
                }
                if ( ( DataFlags & 0x0008 ) == 0x0008 ) {
                    float c = reader.ReadF32();
                    EmissionColor = new[] { c, c, c, 1.0f };
                } else {
                    EmissionColor = reader.ReadRGBA();
                }
            } else {
                AmbientColor = reader.ReadRGBA();
                DiffuseColor = reader.ReadRGBA();
                SpecularColor = reader.ReadRGBA();
                EmissionColor = reader.ReadRGBA();
            }
            Shininess = reader.ReadF32();
        }
예제 #2
0
파일: BaseLight.cs 프로젝트: doug8679/libJT
 protected override void ReadV8(ByteReader reader)
 {
     base.ReadV8(reader);
     ObjectID = reader.ReadI32();
     AmbientColor = reader.ReadRGBA();
     DiffuseColor = reader.ReadRGBA();
     SpecularColor = reader.ReadRGBA();
     Brightness = reader.ReadF32();
 }
예제 #3
0
        public Vers1ImageFormat(ByteReader reader)
        {
            ImageTexelData = new List<byte>();
            _numBytes = reader.ReadI32();
            if ( _numBytes > 0 ) {
                PixelFormat = reader.ReadU32();
                PixelDataType = reader.ReadU32();
                Dimensionality = reader.ReadI16();
                Width = reader.ReadI32();
                Height = reader.ReadI32();
                MipmapsFlag = reader.ReadU32();
                SharedImageFlag = reader.ReadU32();

                for ( int i = 0; i < _numBytes; i++ ) {
                    ImageTexelData.Add( reader.ReadByte() );
                }

                MipmapMagnificationFilter = reader.ReadI32();
                MipmapMinificationFilter = reader.ReadI32();
                SDimenWrapMode = reader.ReadI32();
                TDimenWrapMode = reader.ReadI32();
                TextureFunctionData = reader.ReadI32();
                BlendColor = reader.ReadRGBA();
                TextureTransform = reader.ReadMx4F32();
            }
        }
예제 #4
0
        public Vers2ImageFormat(ByteReader reader)
        {
            TexCoordGenMode = new int[4];
            TexCoordRefPlane = new float[4][];

            TextureType = reader.ReadI32();

            BorderMode = reader.ReadI32();
            MipmapMagnificationFilter = reader.ReadI32();
            MipmapMinificationFilter = reader.ReadI32();
            SDimenWrapMode = reader.ReadI32();
            TDimenWrapMode = reader.ReadI32();
            RDimenWrapMode = reader.ReadI32();
            BlendType = reader.ReadI32();
            InternalCompressionLevel = reader.ReadI32();
            BlendColor = reader.ReadRGBA();
            BorderColor = reader.ReadRGBA();
            TextureTransform = reader.ReadMx4F32();

            for ( int i = 0; i < 4; i++ ) {
                TexCoordGenMode[i] = reader.ReadI32();
            }
            for ( int i = 0; i < 4; i++ ) {
                TexCoordRefPlane[i] = reader.ReadPlaneF32();
            }

            TextureChannel = reader.ReadI32();
            _reserved = reader.ReadU32();
            InlineImageStorageFlag = reader.ReadU32();
            ImageCount = reader.ReadI32();
        }