Exemple #1
0
        public void Read(EndianBinaryReader r)
        {
            r.AssertMagicText("skl" + AsciiUtil.GetChar(0x20));

            this.chunkSize = r.ReadUInt32();
            this.bones     = new Bone[r.ReadUInt32()];
            // M-1: Only value found is "2", possibly "IsTranslateAnimationEnabled"
            // flag (I can't find a change in-game)
            this.unkFlags = r.ReadUInt32();

            for (var i = 0; i < this.bones.Length; ++i)
            {
                var bone = new Bone();
                bone.Read(r);
                this.bones[i] = bone;
            }

            foreach (var bone in this.bones)
            {
                var parentId = bone.parentId;
                if (parentId != -1)
                {
                    var parent = this.bones[parentId];
                    bone.parent = parent;
                    parent.children.Add(bone);
                }
            }
        }
        public void Read(EndianBinaryReader r)
        {
            r.AssertMagicText("cmb" + AsciiUtil.GetChar(0x20));

            this.fileSize = r.ReadUInt32();

            this.version = CmbHeader.Version = (CmbVersion)r.ReadUInt32();


            Asserts.Equal(0, r.ReadInt32());
            this.name             = r.ReadString(16);
            this.faceIndicesCount = r.ReadUInt32();
            this.sklOffset        = r.ReadUInt32();

            if (CmbHeader.Version > CmbVersion.OCARINA_OF_TIME_3D)
            {
                this.qtrsOffset = r.ReadUInt32();
            }

            this.matsOffset        = r.ReadUInt32();
            this.texOffset         = r.ReadUInt32();
            this.sklmOffset        = r.ReadUInt32();
            this.lutsOffset        = r.ReadUInt32();
            this.vatrOffset        = r.ReadUInt32();
            this.faceIndicesOffset = r.ReadUInt32();
            this.textureDataOffset = r.ReadUInt32();

            if (this.version > CmbVersion.OCARINA_OF_TIME_3D)
            {
                this.unk0 = r.ReadUInt32();
            }
        }
Exemple #3
0
            public ZarHeader(EndianBinaryReader er)
            {
                er.AssertMagicText("ZAR" + AsciiUtil.GetChar(1));

                this.Size = er.ReadInt32();

                this.FileTypeCount = er.ReadInt16();
                this.FileCount     = er.ReadInt16();

                this.FileTypesOffset    = er.ReadInt32();
                this.FileMetadataOffset = er.ReadInt32();
                this.DataOffset         = er.ReadInt32();
            }
        public void Read(EndianBinaryReader r)
        {
            r.AssertMagicText("prm" + AsciiUtil.GetChar(0x20));

            this.chunkSize = r.ReadUInt32();
            this.isVisible = r.ReadUInt32() != 0;

            // Other modes don't exist in OoT3D's shader so we'd never know
            this.primitiveMode = (PrimitiveMode)r.ReadUInt32();
            this.dataType      = (DataType)r.ReadUInt32();

            this.indicesCount = r.ReadUInt16();

            this.offset = r.ReadUInt16();
        }
Exemple #5
0
        public void Read(EndianBinaryReader r)
        {
            r.AssertMagicText("shp" + AsciiUtil.GetChar(0x20));

            this.chunkSize = r.ReadUInt32();
            this.shapes    = new Sepd[r.ReadUInt32()];
            this.flags     = r.ReadUInt32();

            for (var i = 0; i < this.shapes.Length; ++i)
            {
                r.ReadInt16(); // ShapeOffset(s)
            }

            r.Align(4);

            for (var i = 0; i < this.shapes.Length; ++i)
            {
                var shape = new Sepd();
                shape.Read(r);
                this.shapes[i] = shape;
            }
        }