public override void Read(Stream source) { uint spriteFileEntriesCount = DataStream.ReadUInt32(source); uint spriteFileEntriesPosition = DataStream.ReadUInt32(source); uint spriteEntriesCount = DataStream.ReadUInt32(source); uint spriteEntriesPosition = DataStream.ReadUInt32(source); source.Seek(spriteFileEntriesPosition, SeekOrigin.Begin); for (int i = 0; i < spriteFileEntriesCount; i++) { var entry = new SpriteFileEntry(); entry.Id = DataStream.ReadUInt32(source); entry.Name = StringPool.Read(source); entry.FileName = StringPool.Read(source); entry.Index = DataStream.ReadUInt32(source); fileEntries.Add(entry); } source.Seek(spriteEntriesPosition, SeekOrigin.Begin); for (int i = 0; i < spriteEntriesCount; i++) { var entry = new SpriteEntry(); entry.Id = DataStream.ReadUInt32(source); entry.Name = StringPool.Read(source); entry.Index = DataStream.ReadUInt16(source); entry.GroupId = DataStream.ReadUInt16(source); entries.Add(entry); } }
public override void Read(Stream source) { uint position; while ((position = DataStream.ReadUInt32(source)) != 0) { strings.Add(StringPool.Read(source, position)); } }
public override void Read(Stream source) { uint textureCount = DataStream.ReadUInt32(source); uint texturesPosition = DataStream.ReadUInt32(source); source.Seek(texturesPosition, SeekOrigin.Begin); for (uint i = 0; i < textureCount; i++) { var entry = new TextureEntry(); entry.Id = DataStream.ReadUInt32(source); entry.Name = StringPool.Read(source); entries.Add(entry); } }
public void Read(SwfReader reader) { reader.ABC = this; int minor = reader.ReadUInt16(); int major = reader.ReadUInt16(); _version = new Version(major, minor); if (minor == CurrentMinor && major == CurrentMajor) { //NOTE: The "0" entry of each constant pool is not used. If the count for a given pool says there are //NOTE: "n" entries in the pool, there are "n-1" entries in the file, corresponding to indices 1..(n-1). IntPool.Read(reader); UIntPool.Read(reader); SwfReader.CheckU30 = true; DoublePool.Read(reader); StringPool.Read(reader); Namespaces.Read(reader); NamespaceSets.Read(reader); Multinames.Read(reader); Methods.Read(reader); Metadata.Read(reader); int n = (int)reader.ReadUIntEncoded(); Instances.Read(n, reader); Classes.Read(n, reader); for (int i = 0; i < n; ++i) { var klass = Classes[i]; var instance = Instances[i]; instance.Class = klass; klass.Instance = instance; klass.Initializer.Instance = instance; } Scripts.Read(reader); MethodBodies.Read(reader); SwfReader.CheckU30 = false; } else { throw new NotImplementedException(); } }
public override void Read(Stream source) { uint objectCount = DataStream.ReadUInt32(source); Unknown = DataStream.ReadUInt32(source); uint objectsPosition = DataStream.ReadUInt32(source); uint meshCount = DataStream.ReadUInt32(source); uint meshesPosition = DataStream.ReadUInt32(source); source.Seek(objectsPosition, SeekOrigin.Begin); Dictionary <uint, ObjectEntry> entryDictionary = new Dictionary <uint, ObjectEntry>(); for (uint i = 0; i < objectCount; i++) { var entry = new ObjectEntry { Name = StringPool.Read(source), Id = DataStream.ReadUInt32(source), FileName = StringPool.Read(source), TextureFileName = StringPool.Read(source), FarcName = StringPool.Read(source), }; entries.Add(entry); entryDictionary.Add(entry.Id, entry); source.Seek(16, SeekOrigin.Current); } source.Seek(meshesPosition, SeekOrigin.Begin); for (uint i = 0; i < meshCount; i++) { var mesh = new MeshEntry(); mesh.Id = DataStream.ReadUInt16(source); ushort parent = DataStream.ReadUInt16(source); mesh.Name = StringPool.Read(source); entryDictionary[parent].Meshes.Add(mesh); } }