示例#1
0
        public PacFileHandling(BinaryReader b)
        {
            pacFile        = new Pac();
            pacStream      = b;
            pacFile.header = ReadHeader();

            PacDirParse   dirParse     = new PacDirParse(pacStream, pacFile);
            PACHParser    pachParse    = new PACHParser();
            TextureParser textureParse = new TextureParser();

            if (pacFile.header.id == "PACH")
            {
                //You opened a free floating PACH file~!
                pacStream.BaseStream.Position = 0;
                pacFile.container             = pachParse.ReadPACHContainer(pacStream.ReadBytes((int)pacStream.BaseStream.Length));
            }
            else if (pacFile.header.id == "EPK8" || pacFile.header.id == "EPAC")
            {
                pacFile.dir = dirParse.ReadDir().ToArray();
            }
            else
            {
                //probably a texture archive...
                //pacFile.header.id = "Texture Archive";
                pacStream.BaseStream.Position = 0;
                pacFile.textures = textureParse.ReadTextures(pacStream);
            }
        }
示例#2
0
        public PacFileHandling(BinaryReader b)
        {
            pacFile = new Pac();
            pacStream = b;
            pacFile.header = ReadHeader();

            PacDirParse dirParse = new PacDirParse(pacStream, pacFile);
            PACHParser pachParse = new PACHParser();
            TextureParser textureParse = new TextureParser();

            if (pacFile.header.id == "PACH")
            {
                //You opened a free floating PACH file~!
                pacStream.BaseStream.Position = 0;
                pacFile.container = pachParse.ReadPACHContainer(pacStream.ReadBytes((int)pacStream.BaseStream.Length));
            }
            else if (pacFile.header.id == "EPK8" || pacFile.header.id == "EPAC")
            {
                pacFile.dir = dirParse.ReadDir().ToArray();
            }
            else
            {
                //probably a texture archive...
                //pacFile.header.id = "Texture Archive";
                pacStream.BaseStream.Position = 0;
                pacFile.textures = textureParse.ReadTextures(pacStream);
            }
        }