Ejemplo n.º 1
0
			public TagGroup(Import.TagGroup def) { tagGroup = def; }
Ejemplo n.º 2
0
			public Struct(Import.Struct def) { tagStruct = def; }
Ejemplo n.º 3
0
			public void Reset(Import.TagGroup def) { tagGroup = def; }
Ejemplo n.º 4
0
			public TagBlock(Import.TagBlock def) { tagBlock = def; }
Ejemplo n.º 5
0
			public void Reset(Import.Struct def) { tagStruct = def; }
Ejemplo n.º 6
0
			public FieldSet(Import.FieldSet def) { fieldSet = def; }
Ejemplo n.º 7
0
			public void Reset(Import.TagBlock def) { tagBlock = def; }
Ejemplo n.º 8
0
		internal override IField ConstructField(Import.Field def)
		{
			return new Field(def);
		}
Ejemplo n.º 9
0
			public void Reset(Import.FieldSet def) { fieldSet = def; }
Ejemplo n.º 10
0
			public Field(Import.Field def) { field = def; }
Ejemplo n.º 11
0
			public void Reset(Import.Field def) { field = def; }
Ejemplo n.º 12
0
			public TagData(Import.TagData def) : base(def) { }
Ejemplo n.º 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);
			}
Ejemplo n.º 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]);
            }
        }