public override void OnRebuild(VoidPtr address, int length, bool force) { SHP0Entry *header = (SHP0Entry *)address; VoidPtr addr = _dataAddr; header->_numIndices = (short)Children.Count; header->_nameIndex = (short)((SHP0Node)Parent)._strings.IndexOf(Name); header->_flags = (int)(uint)_flags; header->_indiciesOffset = 0x14 + Children.Count * 4; uint fixedflags = 0; foreach (SHP0VertexSetNode p in Children) { p._dataAddr = addr; header->Indicies[p.Index] = (short)((SHP0Node)Parent)._strings.IndexOf(p.Name); if (p._isFixed) { KeyframeEntry kf; float value = 0; if ((kf = p.Keyframes.GetKeyframe(0)) != null) { value = kf._value; } ((bfloat *)header->EntryOffset)[p.Index] = value; fixedflags = (uint)(fixedflags & ((uint)0xFFFFFFFF - (uint)(1 << p.Index))) | (uint)(1 << p.Index); } else { header->EntryOffset[p.Index] = (int)(p._dataAddr - &header->EntryOffset[p.Index]); p.Rebuild(p._dataAddr, p._calcSize, true); } addr += p._dataLen; } header->_fixedFlags = (int)fixedflags; }
protected internal virtual void PostProcess(VoidPtr dataAddress, StringTable stringTable) { SHP0Entry *header = (SHP0Entry *)dataAddress; header->ResourceStringAddress = stringTable[Name] + 4; }