예제 #1
0
            internal void Write(BinaryWriterEx bw)
            {
                bw.WriteInt32(0);
                bw.WriteInt32(Unk04);
                bw.WriteInt32(0x2000);
                bw.WriteInt32(Extended ? 5 : 3);
                WriteMarker(bw, 0xA3);
                bw.WriteShiftJISLengthPrefixed(Type, 0x35);
                bw.WriteInt32(UVNumber);
                WriteMarker(bw, 0x35);
                bw.WriteInt32(ShaderDataIndex);

                if (Extended)
                {
                    bw.WriteInt32(0xA3);
                    bw.WriteShiftJISLengthPrefixed(Path, 0xBA);
                    bw.WriteInt32(UnkFloats.Length);
                    bw.WriteSingles(UnkFloats);
                }
            }
예제 #2
0
            internal void Write(BinaryWriterEx bw)
            {
                var textureBlock = Block.Write(bw, 0x2000, Extended ? 5 : 3, 0xA3);

                {
                    WriteMarkedString(bw, 0x35, Type);
                    bw.WriteInt32(UVNumber);
                    WriteMarker(bw, 0x35);
                    bw.WriteInt32(ShaderDataIndex);

                    if (Extended)
                    {
                        bw.WriteInt32(0xA3);
                        WriteMarkedString(bw, 0xBA, Path);
                        bw.WriteInt32(UnkFloats.Count);
                        bw.WriteSingles(UnkFloats);
                    }
                }
                textureBlock.Finish(bw);
            }
예제 #3
0
 internal void Write(BinaryWriterEx bw)
 {
     bw.WriteVector3(Position);
     bw.WriteSingles(GrassDensities);
 }
예제 #4
0
 internal void Write(BinaryWriterEx bw)
 {
     bw.WriteInt32(Unk00);
     bw.WriteInt32(Values.Count * 4);
     bw.WriteSingles(Values);
 }
예제 #5
0
            internal void Write(BinaryWriterEx bw)
            {
                bw.WriteInt32(0);
                bw.WriteInt32(Unk04);
                bw.WriteInt32(4);
                bw.WriteInt32(4);
                WriteMarker(bw, 0xA3);
                bw.WriteShiftJISLengthPrefixed(Name, 0xA3);
                bw.WriteShiftJISLengthPrefixed(Type.ToString().ToLower(), 0x04);
                bw.WriteInt32(1);
                bw.WriteInt32(0);
                bw.ReserveInt32("ValueSize");
                int valueStart = (int)bw.Position;

                if (Type == ParamType.Bool)
                {
                    bw.WriteByte(0);
                }
                else if (Type == ParamType.Int || Type == ParamType.Int2)
                {
                    bw.WriteByte(1);
                }
                else if (Type == ParamType.Float || Type == ParamType.Float2 || Type == ParamType.Float3 || Type == ParamType.Float4)
                {
                    bw.WriteByte(2);
                }
                bw.WriteByte(0x10);
                bw.WriteByte(0);
                bw.WriteByte(0);

                bw.WriteInt32(1);
                if (Type == ParamType.Bool)
                {
                    WriteMarker(bw, 0xC0);
                }
                else if (Type == ParamType.Int || Type == ParamType.Int2)
                {
                    WriteMarker(bw, 0xC5);
                }
                else if (Type == ParamType.Float || Type == ParamType.Float2 || Type == ParamType.Float3 || Type == ParamType.Float4)
                {
                    WriteMarker(bw, 0xCA);
                }

                if (Type == ParamType.Bool || Type == ParamType.Float || Type == ParamType.Int)
                {
                    bw.WriteInt32(1);
                }
                else if (Type == ParamType.Float2 || Type == ParamType.Int2)
                {
                    bw.WriteInt32(2);
                }
                else if (Type == ParamType.Float3)
                {
                    bw.WriteInt32(3);
                }
                else if (Type == ParamType.Float4)
                {
                    bw.WriteInt32(4);
                }

                if (Type == ParamType.Int)
                {
                    bw.WriteInt32((int)Value);
                }
                else if (Type == ParamType.Int2)
                {
                    bw.WriteInt32s((int[])Value);
                }
                else if (Type == ParamType.Bool)
                {
                    bw.WriteBoolean((bool)Value);
                }
                else if (Type == ParamType.Float)
                {
                    bw.WriteSingle((float)Value);
                }
                else if (Type == ParamType.Float2)
                {
                    bw.WriteSingles((float[])Value);
                }
                else if (Type == ParamType.Float3)
                {
                    bw.WriteSingles((float[])Value);
                }
                else if (Type == ParamType.Float4)
                {
                    bw.WriteSingles((float[])Value);
                }

                bw.FillInt32("ValueSize", (int)bw.Position - valueStart);
                bw.WriteByte(4);
                bw.Pad(4);
                bw.WriteInt32(0);
            }
예제 #6
0
            internal void Write(BinaryWriterEx bw)
            {
                var paramBlock = Block.Write(bw, 4, 4, 0xA3);

                {
                    WriteMarkedString(bw, 0xA3, Name);
                    WriteMarkedString(bw, 0x04, Type.ToString().ToLower());
                    bw.WriteInt32(1);

                    int  valueBlockType   = -1;
                    byte valueBlockMarker = 0xFF;
                    if (Type == ParamType.Bool)
                    {
                        valueBlockType   = 0x1000;
                        valueBlockMarker = 0xC0;
                    }
                    else if (Type == ParamType.Int || Type == ParamType.Int2)
                    {
                        valueBlockType   = 0x1001;
                        valueBlockMarker = 0xC5;
                    }
                    else if (Type == ParamType.Float || Type == ParamType.Float2 || Type == ParamType.Float3 || Type == ParamType.Float4)
                    {
                        valueBlockType   = 0x1002;
                        valueBlockMarker = 0xCA;
                    }

                    var valueBlock = Block.Write(bw, valueBlockType, 1, valueBlockMarker);
                    {
                        int valueCount = -1;
                        if (Type == ParamType.Bool || Type == ParamType.Int || Type == ParamType.Float)
                        {
                            valueCount = 1;
                        }
                        else if (Type == ParamType.Int2 || Type == ParamType.Float2)
                        {
                            valueCount = 2;
                        }
                        else if (Type == ParamType.Float3)
                        {
                            valueCount = 3;
                        }
                        else if (Type == ParamType.Float4)
                        {
                            valueCount = 4;
                        }
                        bw.WriteInt32(valueCount);

                        if (Type == ParamType.Int)
                        {
                            bw.WriteInt32((int)Value);
                        }
                        else if (Type == ParamType.Int2)
                        {
                            bw.WriteInt32s((int[])Value);
                        }
                        else if (Type == ParamType.Bool)
                        {
                            bw.WriteBoolean((bool)Value);
                        }
                        else if (Type == ParamType.Float)
                        {
                            bw.WriteSingle((float)Value);
                        }
                        else if (Type == ParamType.Float2)
                        {
                            bw.WriteSingles((float[])Value);
                        }
                        else if (Type == ParamType.Float3)
                        {
                            bw.WriteSingles((float[])Value);
                        }
                        else if (Type == ParamType.Float4)
                        {
                            bw.WriteSingles((float[])Value);
                        }
                    }
                    valueBlock.Finish(bw);
                    WriteMarker(bw, 0x04);
                    bw.WriteInt32(0);
                }
                paramBlock.Finish(bw);
            }