Beispiel #1
0
 //all covered by AbstractWrapper
 protected override string GetResourceName(Data.TypeAlias ta)
 {
     if (!SimPe.Helper.FileFormat)
     {
         return(base.GetResourceName(ta));
     }
     SimPe.Interfaces.Files.IPackedFile pf = Package.Read(FileDescriptor);
     byte[] ab = pf.GetUncompressedData(0x48);
     return((ab.Length > 0x44 ? "0x" + Helper.HexString(ab[0x44]) + ": " : "") + Helper.ToString(pf.GetUncompressedData(0x40)));
 }
Beispiel #2
0
        /// <summary>
        /// Load the assigned Wrapper, and initiate the Resource
        /// </summary>
        /// <param name="fii"></param>
        /// <returns></returns>
        public SimPe.Interfaces.Plugin.IFileWrapper GetWrapper(SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem fii)
        {
            if (fii == null)
            {
                return(null);
            }

            //try by Type
            SimPe.Interfaces.Plugin.IFileWrapper wrapper =
                (SimPe.Interfaces.Plugin.IFileWrapper)FileTable.WrapperRegistry.FindHandler(fii.FileDescriptor.Type);

            //try by Signature
            if (wrapper == null)
            {
                SimPe.Interfaces.Files.IPackedFile pf = pkg.Package.Read(fii.FileDescriptor);
                wrapper = FileTable.WrapperRegistry.FindHandler(pf.GetUncompressedData(0x40));
            }

            return(wrapper);
        }