예제 #1
0
			public TagGroup(Import.TagGroup def) { tagGroup = def; }
예제 #2
0
			public Struct(Import.Struct def) { tagStruct = def; }
예제 #3
0
			public void Reset(Import.TagGroup def) { tagGroup = def; }
예제 #4
0
			public TagBlock(Import.TagBlock def) { tagBlock = def; }
예제 #5
0
			public void Reset(Import.Struct def) { tagStruct = def; }
예제 #6
0
			public FieldSet(Import.FieldSet def) { fieldSet = def; }
예제 #7
0
			public void Reset(Import.TagBlock def) { tagBlock = def; }
예제 #8
0
		internal override IField ConstructField(Import.Field def)
		{
			return new Field(def);
		}
예제 #9
0
			public void Reset(Import.FieldSet def) { fieldSet = def; }
예제 #10
0
			public Field(Import.Field def) { field = def; }
예제 #11
0
			public void Reset(Import.Field def) { field = def; }
예제 #12
0
			public TagData(Import.TagData def) : base(def) { }
예제 #13
0
			/// <summary>
			/// Implementation constructor
			/// </summary>
			/// <param name="proj">Project which this state will work with</param>
			public ProjectState(BlamLib.CheApe.Project proj) : base(BlamVersion.Halo2_PC, proj)
			{
				importer = new Import();
				compiler = new Compiler(this);
			}
예제 #14
0
        public override void Write(IO.EndianWriter stream)
        {
            const int k_alignment = Compiler.kDefaultAlignment;
            int       align;

            using (var mem = InitializeMemoryStream())
            {
                DynamicTagGroups.Write(MemoryStream);                   // write the data array to the stream
                MemoryStream.Write((int)0); MemoryStream.Write((int)0); // alignment

                StringPoolToMemoryStream();

                Import import = OwnerState.Importer as Import;

                FixupsToMemoryStream();

                #region Scripting
                {
                }
                #endregion

                EnumerationsToMemoryStream();

                TagReferencesToMemoryStream();

                TagDataToMemoryStream();

                #region TagBlock
                TagBlock tb = new TagBlock();
                foreach (Import.TagBlock tagb in import.Blocks.Values)
                {
                    tb.Reset(tagb);
                    tb.Write(MemoryStream);
                }
                #endregion

                #region Struct
                Struct strct = new Struct();
                foreach (Import.Struct tags in import.Structs.Values)
                {
                    strct.Reset(tags);
                    strct.Write(MemoryStream);
                }
                #endregion

                #region TagGroup
                TagGroup tg = new TagGroup();
                foreach (Import.TagGroup tagg in import.Groups.Values)
                {
                    tg.Reset(tagg);
                    tg.Write(MemoryStream);
                }
                #endregion

                PostprocessWritebacks();

                // Create header
                PostprocessHeaderThenStream(stream, CalculateStringPoolBaseAddress());

                mem.WriteTo(stream.BaseStream);                 // write all the data that will be read into memory from a tool to the file
            }

            align = k_alignment - (stream.Length % k_alignment);
            if (align != k_alignment)
            {
                stream.Write(new byte[align]);
            }
        }