Esempio n. 1
0
            public Material(FileReader reader, Header header) : base()
            {
                ParentLayout = header;

                TextureMaps       = new List <TextureRef>();
                TextureTransforms = new List <TextureTransform>();

                Name              = reader.ReadString(0x1C).Replace("\0", string.Empty);
                TevColor          = reader.ReadColor8RGBA();
                TevConstantColors = reader.ReadColor8sRGBA(8);
                flags             = reader.ReadUInt32();

                uint texCount = Convert.ToUInt32(flags & 3);
                uint mtxCount = Convert.ToUInt32(flags >> 2) & 3;

                for (int i = 0; i < texCount; i++)
                {
                    TextureMaps.Add(new TextureRef(reader));
                }

                for (int i = 0; i < mtxCount; i++)
                {
                    TextureTransforms.Add(new TextureTransform(reader));
                }
            }
Esempio n. 2
0
            public PIC1(FileReader reader, BCLYT.Header header) : base(reader)
            {
                ParentLayout = header;

                ColorTopLeft     = STColor8.FromBytes(reader.ReadBytes(4));
                ColorTopRight    = STColor8.FromBytes(reader.ReadBytes(4));
                ColorBottomLeft  = STColor8.FromBytes(reader.ReadBytes(4));
                ColorBottomRight = STColor8.FromBytes(reader.ReadBytes(4));
                MaterialIndex    = reader.ReadUInt16();
                byte numUVs = reader.ReadByte();

                reader.Seek(1); //padding

                TexCoords = new TexCoord[numUVs];
                for (int i = 0; i < numUVs; i++)
                {
                    TexCoords[i] = new TexCoord()
                    {
                        TopLeft     = reader.ReadVec2SY(),
                        TopRight    = reader.ReadVec2SY(),
                        BottomLeft  = reader.ReadVec2SY(),
                        BottomRight = reader.ReadVec2SY(),
                    };
                }
            }
Esempio n. 3
0
            public Material(FileReader reader, Header header) : base()
            {
                ParentLayout = header;

                Name              = reader.ReadString(20, true);
                TevColor          = reader.ReadColor8RGBA();
                TevConstantColors = reader.ReadColor8sRGBA(6);
                flags             = reader.ReadUInt32();

                uint texCount     = flags & 3;
                uint mtxCount     = (flags >> 2) & 3;
                uint texCoordGens = (flags >> 4) & 3;
                uint tevStages    = (flags >> 6) & 7;

                TextureMaps       = new TextureRef[texCount];
                TextureTransforms = new TextureTransform[mtxCount];

                for (int i = 0; i < texCount; i++)
                {
                    TextureMaps[i] = new TextureRef(reader, header);
                }

                for (int i = 0; i < mtxCount; i++)
                {
                    TextureTransforms[i] = new TextureTransform(reader);
                }
            }