コード例 #1
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
 public void Load(byte[] data, uint offset)
 {
     ArrayType    = (ArrayTypes)FSHelpers.Read32(data, (int)offset);
     ArrayCount   = (uint)FSHelpers.Read32(data, (int)offset + 4);
     DataType     = (DataTypes)FSHelpers.Read32(data, (int)offset + 8);
     DecimalPoint = FSHelpers.Read8(data, (int)offset + 12);
 }
コード例 #2
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
            public Vector4 GetColor0(int index)
            {
                Vector4 newColor = new Vector4();

                for (int i = 0; i < 4; i++)
                {
                    newColor[i] = FSHelpers.Read8(_dataCopy, (int)_color0DataOffset + (index * 4) + i) / 255f;
                }

                return(newColor);
            }
コード例 #3
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
            public void Load(byte[] data, uint offset)
            {
                MatrixType       = FSHelpers.Read8(data, (int)offset);
                Unknown0         = FSHelpers.Read8(data, (int)offset + 1);
                PacketCount      = (ushort)FSHelpers.Read16(data, (int)offset + 0x2);
                AttribOffset     = (ushort)FSHelpers.Read16(data, (int)offset + 0x4);
                FirstMatrixIndex = (ushort)FSHelpers.Read16(data, (int)offset + 0x6);
                PacketIndex      = (ushort)FSHelpers.Read16(data, (int)offset + 0x8);

                Unknown        = FSHelpers.ReadFloat(data, (int)offset + 0xC);
                BoundingBoxMin = FSHelpers.ReadVector3(data, (int)offset + 0x10);
                BoundingBoxMax = FSHelpers.ReadVector3(data, (int)offset + 0x1C);
            }
コード例 #4
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
            public ushort GetPrimitiveIndex(uint offset, BatchAttribute primitiveAttrib)
            {
                switch (primitiveAttrib.DataType)
                {
                case DataTypes.Signed16:
                    return((ushort)FSHelpers.Read16(_dataCopy, (int)(_primitiveDataOffset + offset)));

                case DataTypes.Signed8:
                    return(FSHelpers.Read8(_dataCopy, (int)(_primitiveDataOffset + offset)));

                default:
                    throw new Exception("Unknown datatype index.");
                }
            }
コード例 #5
0
            }                                                 //Relative to file header


            public void Load(byte[] data, uint offset)
            {
                Format = (TextureFormat)FSHelpers.Read8(data, (int)offset + 0x00);
                _alphaUnknownSetting = FSHelpers.Read8(data, (int)offset + 0x01);
                Width             = (ushort)FSHelpers.Read16(data, (int)offset + 0x02);
                Height            = (ushort)FSHelpers.Read16(data, (int)offset + 0x04);
                WrapS             = (WrapMode)FSHelpers.Read8(data, (int)offset + 0x06);
                WrapT             = (WrapMode)FSHelpers.Read8(data, (int)offset + 0x07);
                PaletteFormat     = (PaletteFormat)FSHelpers.Read8(data, (int)offset + 0x8);
                _unknown1         = FSHelpers.Read8(data, (int)offset + 0x09);
                PaletteEntryCount = (ushort)FSHelpers.Read16(data, (int)offset + 0xA);
                PaletteDataOffset = (uint)FSHelpers.Read32(data, (int)offset + 0xC);
                _unknown2         = (uint)FSHelpers.Read32(data, (int)offset + 0x10);
                FilterSettingMin  = (FilterMode)FSHelpers.Read8(data, (int)offset + 0x14);
                FilterSettingMag  = (FilterMode)FSHelpers.Read8(data, (int)offset + 0x15);
                _padding1         = (ushort)FSHelpers.Read16(data, (int)offset + 0x16);
                _imageCount       = FSHelpers.Read8(data, (int)offset + 0x18);
                _padding2         = FSHelpers.Read8(data, (int)offset + 0x19);
                _padding3         = (ushort)FSHelpers.Read16(data, (int)offset + 0x1A);
                ImageDataOffset   = (uint)FSHelpers.Read32(data, (int)offset + 0x1C);
            }
コード例 #6
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
 public void Load(byte[] data, uint offset)
 {
     Type        = (PrimitiveTypes)FSHelpers.Read8(data, (int)offset);
     VertexCount = (ushort)FSHelpers.Read16(data, (int)offset + 0x1);
 }
コード例 #7
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
 public bool IsWeighted(ushort index)
 {
     return(Convert.ToBoolean(FSHelpers.Read8(_dataCopy, (int)_isWeightedOffset + index)));
 }
コード例 #8
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
 public byte GetCount(uint index)
 {
     return(FSHelpers.Read8(_dataCopy, (int)(_countsArrayOffset + index)));
 }
コード例 #9
0
ファイル: J3DFormat.cs プロジェクト: vtsingaras/WindEditor
            private ushort[] _unconfirmedIndexes        = new ushort[16]; //16 of them!

            public void Load(byte[] data, uint offset)
            {
                _unknown1 = FSHelpers.Read8(data, (int)offset + 0x0);
                _unknown2 = FSHelpers.Read8(data, (int)offset + 0x1);
                _padding1 = (ushort)FSHelpers.Read16(data, (int)offset + 0x2);
                _indirectTexturingIndex = (ushort)FSHelpers.Read16(data, (int)offset + 0x4);
                _cullModeIndex          = (ushort)FSHelpers.Read16(data, (int)offset + 0x6);
                for (int i = 0; i < 2; i++)
                {
                    _ambientColorIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x8 + (i * 0x2));
                }
                for (int i = 0; i < 4; i++)
                {
                    _colorChannelIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0xC + (i * 0x2));
                }
                for (int i = 0; i < 2; i++)
                {
                    _materialColorIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x14 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _lightingIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x18 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _texCoordIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x28 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _texCoord2Index[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x38 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _texMatrixIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x48 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _texMatrix2Index[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x58 + (i * 0x2));
                }
                for (int i = 0; i < 8; i++)
                {
                    _textureIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x84 + (i * 0x2));
                }
                for (int i = 0; i < 4; i++)
                {
                    _tevConstantColorIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x94 + (i * 0x2));
                }
                for (int i = 0; i < 16; i++)
                {
                    _constColorSel[i] = FSHelpers.Read8(data, (int)offset + 0x9C + (i * 0x1));
                }
                for (int i = 0; i < 16; i++)
                {
                    _constAlphaSel[i] = FSHelpers.Read8(data, (int)offset + 0xAC + (i * 0x1));
                }
                for (int i = 0; i < 16; i++)
                {
                    _tevOrderIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0xBC + (i * 0x2));
                }
                for (int i = 0; i < 4; i++)
                {
                    _tevColorIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0xDC + (i * 0x2));
                }
                for (int i = 0; i < 16; i++)
                {
                    _tevStageInfoIndex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0xE4 + (i * 0x2));
                }
                for (int i = 0; i < 16; i++)
                {
                    _tevSwapModeInfoindex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x104 + (i * 0x2));
                }
                for (int i = 0; i < 4; i++)
                {
                    _tevSwapModeTableInfoindex[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x124 + (i * 0x2));
                }
                for (int i = 0; i < 16; i++)
                {
                    _unconfirmedIndexes[i] = (ushort)FSHelpers.Read16(data, (int)offset + 0x12C + (i * 0x2));
                }
            }