protected internal override void OnRebuild(VoidPtr address, int length, bool force) { int count = Children.Count; ResourceGroup *group; if (_version == 4) { VIS0v4 *header = (VIS0v4 *)address; * header = new VIS0v4(length, (ushort)_frameCount, (ushort)count, _loop); group = header->Group; } else { VIS0v3 *header = (VIS0v3 *)address; * header = new VIS0v3(length, (ushort)_frameCount, (ushort)count, _loop); group = header->Group; } *group = new ResourceGroup(count); ResourceEntry *entry = group->First; VoidPtr dataAddress = group->EndAddress; foreach (ResourceNode n in Children) { (entry++)->_dataOffset = (int)dataAddress - (int)group; int len = n._calcSize; n.Rebuild(dataAddress, len, force); dataAddress += len; } }
public override void OnRebuild(VoidPtr address, int length, bool force) { int count = Children.Count; ResourceGroup *group; if (_version == 4) { VIS0v4 *header = (VIS0v4 *)address; * header = new VIS0v4(length, (ushort)(_numFrames - ConversionBias), (ushort)count, _loop); group = header->Group; } else { VIS0v3 *header = (VIS0v3 *)address; * header = new VIS0v3(length, (ushort)(_numFrames - ConversionBias), (ushort)count, _loop); group = header->Group; } *group = new ResourceGroup(count); ResourceEntry *entry = group->First; VoidPtr dataAddress = group->EndAddress; foreach (ResourceNode n in Children) { (entry++)->_dataOffset = (int)dataAddress - (int)group; int len = n._calcSize; n.Rebuild(dataAddress, len, force); dataAddress += len; } if (_userEntries.Count > 0 && _version == 4) { VIS0v4 *header = (VIS0v4 *)address; header->UserData = dataAddress; _userEntries.Write(dataAddress); } }