Exemplo n.º 1
0
        public override string ToString()
        {
            string value = "";

            bool external = Entry == null;

            string extra = "";

            if (Entry == null)
            {
                string file = BundleCache.GetFileByEntryID(EntryID);
                if (!string.IsNullOrEmpty(file))
                {
                    extra = ", Path: " + BundleCache.GetRelativePath(file);
                    BundleArchive archive = BundleArchive.Read(file);
                    Entry = archive.GetEntryByID(EntryID);
                }
            }

            if (Entry != null && Entry.Type == EntryType.VertexDescriptor)
            {
                VertexDesc desc = VertexDesc.Read(Entry);
                value = ", Attribute Count: " + desc.AttributeCount.ToString("D2");
            }

            string location = external ? "External" : "Internal";

            string info = "(External)";

            if (Entry != null)
            {
                info = "(" + location + ": " + EntryIndex.ToString("D3") + ", " + Entry.Type + value + extra + ")";
            }
            return("ID: 0x" + EntryID.ToString("X8") + ", PtrOffset: 0x" + EntryPointerOffset.ToString("X8") + " " + info);
        }
Exemplo n.º 2
0
        public static BundleArchive Read(string path)
        {
            using (Stream s = File.OpenRead(path))
            {
                try
                {
                    BinaryReader2 br = new BinaryReader2(s);

                    BundleArchive result = new BundleArchive();
                    result.Path = path;

                    if (!result.Read(br))
                    {
                        br.Close();

                        return(null);
                    }

                    br.Close();

                    return(result);
                }
                catch (IOException ex)
                {
                    Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
                    return(null);
                } catch (ReadFailedError ex)
                {
                    Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
                    return(null);
                }
            }
        }
Exemplo n.º 3
0
        public BundleEntry(BundleArchive archive)
        {
            Archive = archive;

            /*Archive = new BundleReference();
             * Archive.Path = archive.Path;
             * Archive.EntryCount = (uint)archive.Entries.Count;*/
            Dependencies = new List <Dependency>();
        }