public void Write(FileWriter writer)
            {
                var pos = writer.Position;

                writer.Write(uint.MaxValue);
                writer.Write(Type, true);
                writer.Write(Offset);
                ShaderData.Write(writer);
                SharcCommon.WriteSectionSize(writer, pos);
            }
Beispiel #2
0
        public void Write(FileWriter writer, uint Version)
        {
            var pos = writer.Position;

            writer.Write(uint.MaxValue);
            writer.Write(Name.Length + 1);
            writer.Write(Value.Length + 1);
            writer.WriteString(Name);
            writer.WriteString(Value);
            SharcCommon.WriteSectionSize(writer, pos);
        }
        public void Write(FileWriter writer)
        {
            var pos = writer.Position;

            writer.Write(uint.MaxValue);
            writer.Write(symbols.Count);
            for (int i = 0; i < symbols.Count; i++)
            {
                symbols[i].Write(writer);
            }

            SharcCommon.WriteSectionSize(writer, pos);
        }
Beispiel #4
0
        public void Write(FileWriter writer, uint Version = 12)
        {
            long pos = writer.Position;

            writer.Write(uint.MaxValue);
            writer.Write(macros.Count);

            for (int i = 0; i < macros.Count; i++)
            {
                macros[i].Write(writer, Version);
            }

            SharcCommon.WriteSectionSize(writer, pos);
        }
        public void Write(FileWriter writer)
        {
            var pos = writer.Position;

            writer.Write(Name.Length + 1);
            writer.Write(Values.Count + 1);
            writer.Write(SymbolName.Length + 1);
            writer.WriteString(Name);
            for (int i = 0; i < Values.Count; i++)
            {
                writer.WriteString(Values[i]);
            }
            writer.WriteString(SymbolName);
            SharcCommon.WriteSectionSize(writer, pos);
        }
Beispiel #6
0
        public void Write(FileWriter writer)
        {
            var pos = writer.Position;

            writer.Write(uint.MaxValue);
            writer.Write(Offset);
            writer.Write(Name.Length + 1);
            writer.Write(SymbolName.Length + 1);
            writer.Write(DefaultValue.Length);
            writer.Write(flags.Length);
            writer.WriteString(Name);
            writer.WriteString(SymbolName);
            writer.Write(DefaultValue);
            writer.Write(flags);
            SharcCommon.WriteSectionSize(writer, pos);
        }
Beispiel #7
0
        public void Write(System.IO.Stream stream)
        {
            using (var writer = new FileWriter(stream))
            {
                writer.SetByteOrder(ByteOrderMark != 1);
                writer.WriteSignature("AAHS");
                writer.Write(Version);
                writer.Write(uint.MaxValue); //fileSize
                writer.Write(ByteOrderMark);
                writer.Write(Name.Length + 1);
                writer.WriteString(Name);
                long programStartPos = writer.Position;
                writer.Write(uint.MaxValue);
                writer.Write(ShaderPrograms.Count);
                for (int i = 0; i < ShaderPrograms.Count; i++)
                {
                    long pos = writer.Position;
                    ShaderPrograms[i].Write(writer, Version);
                    SharcCommon.WriteSectionSize(writer, pos);
                }

                SharcCommon.WriteSectionSize(writer, programStartPos);

                long sourceArrayStart = writer.Position;
                writer.Write(uint.MaxValue);
                writer.Write(SourceDatas.Count);
                for (int i = 0; i < SourceDatas.Count; i++)
                {
                    long pos = writer.Position;
                    SourceDatas[i].Write(writer, Version);
                    SharcCommon.WriteSectionSize(writer, pos);
                }

                SharcCommon.WriteSectionSize(writer, sourceArrayStart);

                using (writer.TemporarySeek(8, System.IO.SeekOrigin.Begin))
                {
                    writer.Write((uint)writer.BaseStream.Length);
                };
            }
        }