public override void OnRebuild(VoidPtr address, int length, bool force) { RSTC *hdr = (RSTC *)address; *hdr = new RSTC(); hdr->_tag = _tag; hdr->_size = _size; hdr->_version = _version; hdr->_unknown0x0C = _unknown0x0C; hdr->_charNum = (byte)cssList.Children.Count; hdr->_unknown0x0E = _unknown0x0E; hdr->_randNum = (byte)randList.Children.Count; uint offset = 0x10; // Ensures no junk data got saved to the character list for (int i = 0; i < _charList.Length; i++) { hdr->_charList[i] = 0x00; } for (int i = 0; i < cssList.Children.Count; i++) { ResourceNode r = cssList.Children[i]; *(buint *)((byte *)address + 0x10 + i) = offset; r.Rebuild(address + offset, 0x01, true); offset += 0x01; } offset = 0x10 + 104; // Ensures no junk data got saved to the random list for (int i = 0; i < _randList.Length; i++) { hdr->_randList[i] = 0x00; } for (int i = 0; i < randList.Children.Count; i++) { ResourceNode r = randList.Children[i]; *(buint *)((byte *)address + 0x10 + (i + 104)) = offset; r.Rebuild(address + offset, 0x01, true); offset += 0x01; } // Clear all junk data from the end of the lists for (int i = cssList.Children.Count; i < _charList.Length; i++) { hdr->_charList[i] = 0x00; } for (int i = randList.Children.Count; i < _randList.Length; i++) { hdr->_randList[i] = 0x00; } }
public override void OnRebuild(VoidPtr address, int length, bool force) { Parameter *header = (Parameter *)address; * header = new Parameter(Parameter.TagMVPM, Children.Count); uint offset = (uint)(0x10 + Children.Count * 4); for (int i = 0; i < Children.Count; i++) { ResourceNode r = Children[i]; *(buint *)(address + 0x10 + i * 4) = offset; r.Rebuild(address + offset, _entrySize, true); offset += _entrySize; } }
public override void OnRebuild(VoidPtr address, int length, bool force) { SCLA *header = (SCLA *)address; * header = new SCLA(Children.Count); uint offset = (uint)(0x10 + (Children.Count * 4)); for (int i = 0; i < Children.Count; i++) { ResourceNode r = Children[i]; *(buint *)((VoidPtr)address + 0x10 + i * 4) = offset; r.Rebuild((VoidPtr)address + offset, _entrySize, true); offset += _entrySize; } }
public override void OnRebuild(VoidPtr address, int length, bool force) { uint offset = 0x00; for (int i = 0; i < Children.Count; i++) { ResourceNode r = Children[i]; r.Rebuild(address + offset, 2, true); offset += 2; } MasqueradeEntryNode end = new MasqueradeEntryNode(true); end.Rebuild(address + offset, 2, true); offset += 2; while (offset < Size) { MasqueradeEntryNode blank = new MasqueradeEntryNode(false); blank.Rebuild(address + offset, 2, true); offset += 2; } }