private void Disassemble() { int offset; ushort offsetStart = 0; ushort offsetEnd = 0; Overlap tOverlap; int pointerOffset = (index * 2) + 0x1D4905; offsetStart = Bits.GetShort(rom, pointerOffset); pointerOffset += 2; offsetEnd = Bits.GetShort(rom, pointerOffset); if (index == 0x1FF) { offsetEnd = 0; } if (offsetStart >= offsetEnd) { return; // no overlaps for level } offset = offsetStart + 0x1D0000; while (offset < offsetEnd + 0x1D0000) { tOverlap = new Overlap(); tOverlap.Disassemble(offset); overlaps.Add(tOverlap); offset += 4; } }
// private void overlapFieldCopy_Click(object sender, EventArgs e) { if (overlapFieldTree.SelectedNode != null) { copyOverlap = overlaps.Overlap.Copy(); } }
public void New(int index, Overlap copy) { if (index < overlaps.Count) { overlaps.Insert(index, copy); } else { overlaps.Add(copy); } }
// spawning public Overlap Copy() { Overlap copy = new Overlap(); copy.B0b7 = b0b7; copy.B1b7 = b1b7; copy.B2b5 = b2b5; copy.B2b6 = b2b6; copy.B2b7 = b2b7; copy.X = x; copy.Y = y; copy.Z = z; copy.Type = type; return(copy); }
public void New(int index, Point p) { Overlap e = new Overlap(); e.Clear(); e.X = (byte)p.X; e.Y = (byte)p.Y; if (index < overlaps.Count) { overlaps.Insert(index, e); } else { overlaps.Add(e); } }
private void AddNewOverlap(Overlap overlap) { if (CalculateFreeOverlapSpace() >= 4) { this.overlapFieldTree.Focus(); if (overlaps.Count < 28) { if (overlapFieldTree.Nodes.Count > 0) { overlaps.New(overlapFieldTree.SelectedNode.Index + 1, overlap); } else { overlaps.New(0, overlap); } int reselect; if (overlapFieldTree.Nodes.Count > 0) { reselect = overlapFieldTree.SelectedNode.Index; } else { reselect = -1; } overlapFieldTree.BeginUpdate(); this.overlapFieldTree.Nodes.Clear(); for (int i = 0; i < overlaps.Count; i++) { this.overlapFieldTree.Nodes.Add(new TreeNode("OVERLAP #" + i.ToString())); } this.overlapFieldTree.SelectedNode = this.overlapFieldTree.Nodes[reselect + 1]; overlapFieldTree.EndUpdate(); } else { MessageBox.Show("Could not insert any more overlaps. The maximum number of overlaps allowed per level is 28.", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Could not insert the field. " + MaximumSpaceExceeded("overlaps"), "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Information); } }