/// <summary> /// Creates a color wheel with associated (A)RGB text boxes /// </summary> /// <param name="meta"></param> /// <param name="iEntName">Control display name</param> /// <param name="map"></param> /// <param name="iOffsetInChunk"></param> /// <param name="hasAlphaChannel">True if ARGB, False for RGB</param> /// <param name="valueType">Float for 0f-1f, Int for 0-255</param> /// <param name="iLineNumber"></param> public argb_color(Meta meta, string iEntName, Map map, int iOffsetInChunk, bool hasAlphaChannel, IFPIO.ObjectEnum valueType,int iLineNumber) { InitializeComponent(); this.meta = meta; this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = " " + iEntName + " "; this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; this.hasAlpha = hasAlphaChannel; this.ValueType = valueType; switch (valueType) { case IFPIO.ObjectEnum.Byte: this.eachSize = 1; break; case IFPIO.ObjectEnum.Short: case IFPIO.ObjectEnum.UShort: this.eachSize = 2; break; case IFPIO.ObjectEnum.Int: case IFPIO.ObjectEnum.UInt: case IFPIO.ObjectEnum.Float: case IFPIO.ObjectEnum.Unknown: this.eachSize = 4; break; } this.size = (hasAlpha ? eachSize * 4 : eachSize * 3); CW = new ColorWheel(); CW.Location = new Point(180, 5); Red = new DataValues(meta, "Red", map, iOffsetInChunk, valueType, iLineNumber); Red.BackColor = System.Drawing.Color.DarkRed; CW.setTextBox(Red.textBox1, Color.Red); Blue = new DataValues(meta, "Blue", map, iOffsetInChunk + eachSize, valueType, iLineNumber); Blue.BackColor = System.Drawing.Color.DarkBlue; CW.setTextBox(Blue.textBox1, Color.Blue); Green = new DataValues(meta, "Green", map, iOffsetInChunk + eachSize * 2, valueType, iLineNumber); Green.BackColor = System.Drawing.Color.FromArgb(10, 80, 35); CW.setTextBox(Green.textBox1, Color.Green); if (hasAlpha) { Alpha = new DataValues(meta, "Alpha", map, iOffsetInChunk + eachSize * 3, valueType, iLineNumber); Alpha.BackColor = System.Drawing.Color.Gray; CW.setTextBox(Alpha.textBox1, Color.White); gbRGBColor.Controls.Add(Alpha); } gbRGBColor.Controls.Add(CW); CW.BringToFront(); gbRGBColor.Controls.Add(Green); gbRGBColor.Controls.Add(Blue); gbRGBColor.Controls.Add(Red); }
/// <summary> /// The load variables. /// </summary> /// <param name="map">The map index.</param> /// <param name="entlineNumber">The entline number.</param> /// <remarks></remarks> public void LoadVariables(Map map, int entlineNumber) { this.map = map; this.lineNumber = entlineNumber; // FilterEntItems(); }
/// <summary> /// Initializes a new instance of the <see cref="ListEntItems"/> class. /// </summary> /// <param name="imap">The imap.</param> /// <param name="entItems">The ent items.</param> /// <remarks></remarks> public ListEntItems(Map imap, IFPIO entItems) { if (imap.SelectedMeta == null) { this.Close(); } this.Ent = entItems; this.map = imap; InitializeComponent(); this.EntItemsTreeView.Nodes.AddRange(LoadEntItemsIntoTreeView(0)); this.buttGoTo.Tag = this.Ent.ENTElements[0]; DialogResult DR = MessageBox.Show( "No N00bs Beyond This Point.....That Is IF You Want To Keep Working Plugins.....", string.Empty, MessageBoxButtons.OKCancel); if (DR == DialogResult.Cancel) { MessageBox.Show( "You have taken the first step in the NA (N00bs Anonymous) program. Please continue down the path to becoming 1337"); this.Close(); } this.combType.Items.AddRange(Enum.GetNames(typeof(IFPIO.ObjectEnum))); }
public DataValues(Meta meta, string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber) { this.meta = meta; this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; InitializeComponent(); this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; this.Controls[2].Text = type.ToString(); this.ValueType = type; switch (this.ValueType) { case IFPIO.ObjectEnum.Byte: this.size = 1; break; case IFPIO.ObjectEnum.Short: case IFPIO.ObjectEnum.UShort: this.size = 2; break; case IFPIO.ObjectEnum.Int: case IFPIO.ObjectEnum.UInt: case IFPIO.ObjectEnum.Float: case IFPIO.ObjectEnum.Unknown: this.size = 4; break; case IFPIO.ObjectEnum.Unused: this.size = 0; break; } this.AutoSize = false; }
/// <summary> /// Initializes a new instance of the <see cref="Sky"/> class. /// </summary> /// <param name="tag">The tag.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public Sky(int tag, Map map) { map.BR.BaseStream.Position = map.MetaInfo.Offset[tag] + 72; int tempc = map.BR.ReadInt32(); int tempr = map.BR.ReadInt32() - map.SecondaryMagic; if (tempc != 0) { fogenabled = true; map.BR.BaseStream.Position = tempr; fog.R = map.BR.ReadSingle(); fog.G = map.BR.ReadSingle(); fog.B = map.BR.ReadSingle(); fog.A = map.BR.ReadSingle(); fog.Start = map.BR.ReadSingle(); fog.End = map.BR.ReadSingle(); } map.BR.BaseStream.Position = map.MetaInfo.Offset[tag] + 96; tempc = map.BR.ReadInt32(); tempr = map.BR.ReadInt32() - map.SecondaryMagic; if (tempc != 0) { map.BR.BaseStream.Position = tempr + 24; fog.FogThickness = map.BR.ReadSingle(); fog.FogVisibility = map.BR.ReadSingle(); } }
public Enums(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iType, object[] ioptions, int iLineNumber) { this.meta = meta; this.LineNumber = iLineNumber; this.Options = ioptions; this.enumType = iType; this.size = iType / 8; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; InitializeComponent(); this.Size = this.PreferredSize; this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; switch (iType) { case 8: { this.Controls[2].Text = "Enum8"; break; } case 16: { this.Controls[2].Text = "Enum16"; break; } case 32: { this.Controls[2].Text = "Enum32"; break; } } this.AutoSize = false; }
public MetaEditorControlPage(Meta meta, MapForms.MapForm mapForm) { InitializeComponent(); // Try to draw treeview nodes to "hide" "disabled" nodes; fail. Still leaves space where node is //treeViewTagReflexives.DrawMode = TreeViewDrawMode.OwnerDrawAll; //treeViewTagReflexives.DrawNode += new DrawTreeNodeEventHandler(myTreeView_DrawNode); this.MapForm = mapForm; this.map = mapForm.map; this.meta = meta; this.BR = new BinaryReader(meta.MS); // Create a backup of the Tags memory stream, for restoring, comparing, etc msBackup = new MemoryStream(meta.MS.ToArray()); msDebug = new MemoryStream((int)meta.MS.Length); mainReflexive = createReflexiveList(); // Done refreshTreeListing(mainReflexive); // Done this.treeViewTagReflexives.Sort(); treeViewTagReflexives.SelectedNode = treeViewTagReflexives.Nodes[0]; // Default Peek/Poke to "Single Value" this.tscbApplyTo.SelectedIndex = 0; }
/// <summary> /// Initializes a new instance of the <see cref="BSPConvert"/> class. /// </summary> /// <param name="map">The map.</param> /// <param name="test">The test.</param> /// <remarks></remarks> public H1BSPConvert(Map map, ref PropertyGrid test) { switch (map.HaloVersion) { case HaloVersionEnum.Halo1: case HaloVersionEnum.HaloCE: map.OpenMap(MapTypes.Internal); H1SBSP h1bsp = new H1SBSP(map.BSP.sbsp[0].TagIndex, map); test.SelectedObject = h1bsp.Header; map.CloseMap(); break; case HaloVersionEnum.Halo2: case HaloVersionEnum.Halo2Vista: MessageBox.Show("Open an H1 Map first"); break; } // OpenFileDialog open = new OpenFileDialog(); // open.Filter = "*.map|*.map"; // if (open.ShowDialog() == DialogResult.Cancel) return; // int h2map=Maps.Add(open.FileName); // Halo2BSP h2bsp = new Halo2BSP(h2map); // Maps.Remove(h2map); }
/// <summary> /// Initializes a new instance of the <see cref="StringsInfo"/> class. /// </summary> /// <param name="BR">The BR.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public StringsInfo(ref BinaryReader BR, Map map) { Name = new string[map.MapHeader.scriptReferenceCount]; Length = new int[map.MapHeader.scriptReferenceCount]; Offset = new int[map.MapHeader.scriptReferenceCount]; // Reads In Offsets Of Meta Names BR.BaseStream.Position = map.MapHeader.offsetToStringIndex; for (int x = 0; x < map.MapHeader.scriptReferenceCount; x++) { Offset[x] = BR.ReadInt32(); } for (int x = 0; x < map.MapHeader.scriptReferenceCount; x++) { // figures out length of string int len; if (x != map.MapHeader.scriptReferenceCount - 1) { len = Offset[x + 1] - Offset[x]; } else { len = map.MapHeader.sizeOfScriptReference - Offset[x]; } Length[x] = len - 1; /// Reads in string BR.BaseStream.Position = map.MapHeader.offsetToStringNames2 + Offset[x]; Name[x] = new string(BR.ReadChars(len - 1)); } }
/// <summary> /// Initializes a new instance of the <see cref="HaloLight"/> class. /// </summary> /// <param name="tagIndex">Index of the tag.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public HaloLight(int tagIndex, Map map) { map.BR.BaseStream.Position = map.MetaInfo.Offset[tagIndex] + 72; range = map.BR.ReadInt32(); r = (int)(map.BR.ReadSingle() * 255); g = (int)(map.BR.ReadSingle() * 255); b = (int)(map.BR.ReadSingle() * 255); }
/// <summary> /// Initializes a new instance of the <see cref="MetaEditor"/> class. /// </summary> /// <param name="ifp">The ifp.</param> /// <param name="split">The split.</param> /// <param name="mapx">The mapx.</param> /// <remarks></remarks> public MetaEditor(IFPIO ifp, SplitContainer split, Map mapx) { map = mapx; ReflexiveContainer tempr = new ReflexiveContainer("Header"); MakeControls(0, ifp.items, ref tempr); Controls = tempr; DrawControls(ref split); }
/// <summary> /// Initializes a new instance of the <see cref="SpawnLoads"/> class. /// </summary> /// <param name="map">The map.</param> /// <param name="bsp">The BSP.</param> /// <param name="device">The device.</param> /// <remarks></remarks> public SpawnLoads(Map map, BSPModel bsp, Device device) { this.map = map; this.bsp = bsp; this.device = device; SpawnModel = new List<ParsedModel>(); spawnmodelindex = new int[bsp.Spawns.Spawn.Count]; BoundingBoxModel = new Mesh[bsp.Spawns.Spawn.Count]; }
/// <summary> /// The build meta. /// </summary> /// <param name="metasplit">The metasplit.</param> /// <param name="map">The map.</param> /// <returns></returns> /// <remarks></remarks> public static Meta BuildMeta(MetaSplitter metasplit, Map map) { metasize = 0; MetaStream = new MemoryStream(metasplit.Header.chunksize); BinaryWriter BW = new BinaryWriter(MetaStream); // BW.BaseStream.Position = 0; // BW.Write(metasplit.Header.MS.ToArray(), 0, metasplit.Header.chunksize); metasize += metasplit.Header.chunksize; TagIndex = metasplit.TagIndex; Meta m = new Meta(map); List<Meta.Item> NewItems = new List<Meta.Item>(); // Major error here! Size is not calculated right! RecursivelyAddPiecesToMeta(metasplit.Header, ref NewItems, ref BW); m.items = NewItems; if (MetaStream.Length % 4 != 0) { metasize += (int)MetaStream.Length % 4; MetaStream.SetLength(MetaStream.Length + MetaStream.Length % 4); } m.MS = MetaStream; m.size = metasize; m.type = metasplit.type; m.name = metasplit.name; m.rawType = metasplit.rawtype; m.raw = metasplit.raw; m.magic = metasplit.magic; m.offset = metasplit.offset; m.TagIndex = TagIndex; m.RelinkReferences(); m.WriteReferences(); // m.items.Clear(); // MetaScanner Ms = new MetaScanner(); if (m.rawType != RawDataContainerType.Empty) { map.OpenMap(MapTypes.Internal); m.raw = map.Functions.ForMeta.ReadRaw(m.TagIndex, false); map.CloseMap(); } // map.OpenMap(MapTypes.Internal); // IFPIO ifp=IFP.IFPHashMap.GetIfp(m.type); // m.parsed = true; // Ms.ScanWithIFP(ref ifp, ref m, map) ; // map.CloseMap(); return m; }
/// <summary> /// Initializes a new instance of the <see cref="Float"/> class. /// </summary> /// <param name="iEntName"> /// The i ent name. /// </param> /// <param name="map"> /// The map. /// </param> /// <param name="iOffsetInChunk"> /// The i offset in chunk. /// </param> public Float(string iEntName, Map map, int iOffsetInChunk) { this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; InitializeComponent(); this.Size = this.PreferredSize; this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; this.AutoSize = false; }
public StringBox(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iLineNumber, int chunkCount) { this.meta = meta; this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; this.size = chunkCount; InitializeComponent(); this.Size = this.PreferredSize; this.Dock = DockStyle.Top; this.label3.Text = EntName; this.AutoSize = false; }
/// <summary> /// Initializes a new instance of the <see cref="FileNamesInfo"/> class. /// </summary> /// <param name="BR">The BR.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public FileNamesInfo(ref BinaryReader BR, Map map) { switch (map.HaloVersion) { case HaloVersionEnum.Halo2: case HaloVersionEnum.Halo2Vista: Halo2FileNamesInfo(ref BR, map); break; case HaloVersionEnum.HaloCE: case HaloVersionEnum.Halo1: HaloCEFileNamesInfo(ref BR, map); break; } }
/// <summary> /// Initializes a new instance of the <see cref="TagBlock"/> class. /// </summary> /// <param name="iEntName"> /// The i ent name. /// </param> /// <param name="map"> /// The map. /// </param> /// <param name="iOffsetInChunk"> /// The i offset in chunk. /// </param> /// <param name="iLineNumber"> /// The i line number. /// </param> public TagBlock(string iEntName, Map map, int iOffsetInChunk, int iLineNumber) { this.LineNumber = iLineNumber; this.map = map; this.EntName = iEntName; this.chunkOffset = iOffsetInChunk; InitializeComponent(); this.Controls[0].Text = EntName; this.Dock = DockStyle.Top; this.Size = this.PreferredSize; this.AutoSize = false; this.Enter += TagBlock_Enter; this.Leave += TagBlock_Leave; }
/// <summary> /// Initializes a new instance of the <see cref="SpawnInfo"/> class. /// </summary> /// <param name="map">The map.</param> /// <remarks></remarks> public SpawnInfo(Map map) { switch (map.HaloVersion) { case HaloVersionEnum.HaloCE: case HaloVersionEnum.Halo1: H1SpawnInfo(map); break; case HaloVersionEnum.Halo2Vista: case HaloVersionEnum.Halo2: H2SpawnInfo(map); break; } }
/// <summary> /// Initializes a new instance of the <see cref="SID"/> class. /// </summary> /// <param name="iEntName"> /// The i ent name. /// </param> /// <param name="map"> /// The map. /// </param> /// <param name="iOffsetInChunk"> /// The i offset in chunk. /// </param> /// <param name="iLineNumber"> /// The i line number. /// </param> public SID(string iEntName, Map map, int iOffsetInChunk, int iLineNumber) { this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; InitializeComponent(); this.Size = this.PreferredSize; this.Dock = DockStyle.Top; this.label3.Text = EntName; this.AutoSize = false; this.Enter += SID_Enter; this.Leave += SID_Leave; }
/// <summary> /// Initializes a new instance of the <see cref="ParsedBitmap"/> class. /// </summary> /// <param name="meta">The meta.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public ParsedBitmap(ref Meta meta, Map map) { BitmapHeader = new HaloBitmapHeader(ref meta); switch (map.HaloVersion) { case HaloVersionEnum.Halo2: case HaloVersionEnum.Halo2Vista: ReadH2ParsedBitmap(ref meta); break; case HaloVersionEnum.HaloCE: case HaloVersionEnum.Halo1: ReadCEParsedBitmap(ref meta); break; } }
/// <summary> /// Initializes a new instance of the <see cref="DataValues"/> class. /// </summary> /// <param name="iEntName"> /// The i ent name. /// </param> /// <param name="map"> /// The map. /// </param> /// <param name="iOffsetInChunk"> /// The i offset in chunk. /// </param> /// <param name="type"> /// The type. /// </param> /// <param name="iLineNumber"> /// The i line number. /// </param> public DataValues(string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber) { this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; InitializeComponent(); this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; this.Controls[2].Text = type.ToString(); this.ValueType = type; this.AutoSize = false; this.Enter += DataValues_GotFocus; this.Leave += DataValues_LostFocus; }
/// <summary> /// Initializes a new instance of the <see cref="Scripts"/> class. /// </summary> /// <param name="map">The map.</param> /// <remarks></remarks> public Scripts(Map map) { map.OpenMap(MapTypes.Internal); map.BR.BaseStream.Position = map.MetaInfo.Offset[3] + 568; int tempc = map.BR.ReadInt32(); int tempr = map.BR.ReadInt32() - map.SecondaryMagic; syntaxes = new Syntax[tempc]; map.BR.BaseStream.Position = tempr; for (int x = 0; x < tempc; x++) { syntaxes[x] = new Syntax(ref map.BR); } map.CloseMap(); }
/// <summary> /// Initializes a new instance of the <see cref="EntStrings"/> class. /// </summary> /// <param name="iEntName"> /// The i ent name. /// </param> /// <param name="map"> /// The map. /// </param> /// <param name="iOffsetInChunk"> /// The i offset in chunk. /// </param> /// <param name="ilength"> /// The ilength. /// </param> /// <param name="itype"> /// The itype. /// </param> /// <param name="iLineNumber"> /// The i line number. /// </param> public EntStrings(string iEntName, Map map, int iOffsetInChunk, int ilength, bool itype, int iLineNumber) { this.LineNumber = iLineNumber; this.entUnicode = itype; this.length = ilength; this.map = map; this.EntName = iEntName; this.chunkOffset = iOffsetInChunk; InitializeComponent(); this.Controls[1].Text = EntName; this.Dock = DockStyle.Top; this.Size = this.PreferredSize; this.AutoSize = false; this.Enter += EntStrings_Enter; this.Leave += String_Leave; }
/// <summary> /// Initializes a new instance of the <see cref="ChunkClonerWindow"/> class. /// </summary> /// <param name="tagIndex">Index of the tag.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public ChunkClonerWindow(int tagIndex, Map map) { this.map = map; TagNumber = tagIndex; // Draws all components on Form InitializeComponent(); SplitIFP(); TreeNode tn = new TreeNode("Header"); // Adds nodes to tree in Chunk Cloner Window DisplaySplit(metasplit.Header, tn); tn.Expand(); tn.Nodes[0].Expand(); treeView1.Nodes.Add(tn); }
public MetaEditorControlPage(Meta meta, MapForms.MapForm mapForm) { InitializeComponent(); this.MapForm = mapForm; this.map = mapForm.map; this.meta = meta; this.BR = new BinaryReader(meta.MS); // Create a backup of the Tags memory stream, for restoring, comparing, etc msBackup = new MemoryStream(meta.MS.ToArray()); msDebug = new MemoryStream((int)meta.MS.Length); createTreeListing(); this.treeViewTagReflexives.Sort(); treeViewTagReflexives.SelectedNode = treeViewTagReflexives.Nodes[0]; }
public SID(Meta meta, string iEntName, Map map, int iOffsetInChunk,int iLineNumber) { this.meta = meta; this.LineNumber = iLineNumber; this.chunkOffset = iOffsetInChunk; this.map = map; this.EntName = iEntName; this.size = 4; InitializeComponent(); this.Size = this.PreferredSize; this.Dock = DockStyle.Top; this.Controls[0].Text = EntName; this.AutoSize = false; //this.comboBox1.DataSource = map.Strings.Name; this.comboBox1.DataSource = null; // Loading data source takes a long time. Only do it when needed. }
/// <summary> /// Creates a new EntStrings class for a set-length unicode or ASCII string. /// </summary> /// <param name="meta">The controls meta data</param> /// <param name="iEntName">The identifying name of the meta string</param> /// <param name="map">The metas map file</param> /// <param name="iOffsetInChunk">The offset to the string in the memory stream</param> /// <param name="ilength">The set length of the string (usually 32, 64 or 256, but will handle any length strings)</param> /// <param name="itype">Set to false for ASCII strings, true for Unicode (UTF-8) strings</param> /// <param name="iLineNumber">The associated line number</param> public EntStrings(Meta meta, string iEntName, Map map, int iOffsetInChunk, int ilength, bool itype, int iLineNumber) { this.meta = meta; this.LineNumber = iLineNumber; this._entUnicode = itype; this._length = ilength; this.size = this._length; this.map = map; this.EntName = iEntName; this.chunkOffset = iOffsetInChunk; InitializeComponent(); this.label2.Text = EntName; this.Dock = DockStyle.Top; this.Size = this.PreferredSize; this.AutoSize = false; this.Leave += new EventHandler(String_Leave); }
/// <summary> /// The split with ifp. /// </summary> /// <param name="ifp">The ifp.</param> /// <param name="meta">The meta.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public void SplitWithIFP(ref IFPIO ifp, ref Meta meta, Map map) { this.type = meta.type; this.TagIndex = meta.TagIndex; this.name = meta.name; this.offset = meta.offset; this.magic = meta.magic; this.raw = meta.raw; this.rawtype = meta.rawType; map.OpenMap(MapTypes.Internal); if (ifp.items != null) { map.BR.BaseStream.Position = meta.offset; Header = new SplitReflexive(); Header.offset = 0; Header.Chunks = new List<SplitReflexive>(); Header.translation = 0; // Header.MS = new MemoryStream(ifp.headerSize); // Header.MS.Write(map.BR.ReadBytes(ifp.headerSize), 0, ifp.headerSize); Header.chunksize = ifp.headerSize; Header.chunkcount = 1; Header.splitReflexiveType = SplitReflexive.SplitReflexiveType.Container; Header.realtranslation = meta.offset; if (meta.type == "sbsp") { int p = map.BSP.FindBSPNumberByBSPIdent(meta.ident); CycleElements( ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic); } else if (meta.type == "ltmp") { int p = map.BSP.FindBSPNumberByLightMapIdent(meta.ident); CycleElements( ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic); } else { // not "sbsp" or "ltmp" CycleElements(ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.SecondaryMagic); } } map.CloseMap(); }
/// <summary> /// Initializes a new instance of the <see cref="BitmapControl"/> class. /// </summary> /// <param name="map">The map.</param> /// <remarks></remarks> public BitmapControl(Map map) { InitializeComponent(); this.map = map; map.OpenMap(MapTypes.Internal); pm = new ParsedBitmap(ref map.SelectedMeta, map); for (int x = 0; x < pm.Properties.Length; x++) { TreeNode tn = new TreeNode("Bitmap #" + x); tn.Tag = "BITMAP"; for (int i = 0; i < map.SelectedMeta.raw.rawChunks.Count; i++) { int count = pm.Properties[x].mipMapCount; BitmapRawDataChunk bmRaw = (BitmapRawDataChunk)map.SelectedMeta.raw.rawChunks[i]; if (bmRaw.inchunk == x) { TreeNode chunknode = new TreeNode("Chunk #" + bmRaw.num); chunknode.Tag = "CHUNK"; int chunkWidth = pm.Properties[x].width >> bmRaw.num; int mipcount = 0; while (chunkWidth > 1 && count > 0) { TreeNode mipnode = new TreeNode("Mipmap #" + (mipcount++)); mipnode.Tag = "MIPMAP"; chunknode.Nodes.Add(mipnode); chunkWidth >>= 1; count--; } tn.Nodes.Add(chunknode); } } treeView1.Nodes.Add(tn); } map.CloseMap(); DisplayBitmap(0, 0, 0); }
/// <summary> /// Initializes a new instance of the <see cref="IndexHeaderInfo"/> class. /// </summary> /// <param name="BR">The BR.</param> /// <param name="map">The map.</param> /// <remarks></remarks> public IndexHeaderInfo(ref BinaryReader BR, Map map) { switch (map.HaloVersion) { case HaloVersionEnum.Halo2: LoadHalo2IndexHeaderInfo(ref BR, map); break; case HaloVersionEnum.Halo2Vista: LoadHalo2IndexHeaderInfo(ref BR, map); break; case HaloVersionEnum.HaloCE: LoadHaloCEIndexHeaderInfo(ref BR, map); break; case HaloVersionEnum.Halo1: LoadHalo1IndexHeaderInfo(ref BR, map); break; } }