Ejemplo n.º 1
0
        public void Read()
        {
            foreach (var subChunk in SubData.Chunks)
            {
                switch (subChunk.Name)
                {
                case "MOPY":
                    MOPY = new MOPY(subChunk);
                    break;

                case "MOVI":
                    MOVI = new MOVI(subChunk);
                    break;

                case "MOVT":
                    MOVT = new MOVT(subChunk);
                    break;

                case "MONR":
                    MONR = new MONR(subChunk);
                    break;

                case "MODR":
                    MODR = new MODR(subChunk);
                    break;

                case "MLIQ":
                    MLIQ = new MLIQ(subChunk);
                    break;
                }
            }

            Generate();
        }
Ejemplo n.º 2
0
        private MOVI[] ReadMOVIChunk(uint size, BinaryReader bin)
        {
            var numIndices = size / sizeof(ushort);
            var indices    = new MOVI[numIndices];

            for (var i = 0; i < numIndices; i++)
            {
                indices[i].indice = bin.ReadUInt16();
            }
            return(indices);
        }
Ejemplo n.º 3
0
        private MOVI[] ReadMOVIChunk(BlizzHeader chunk, BinaryReader bin)
        {
            var numIndices = chunk.Size / sizeof(ushort);
            //Console.WriteLine(numIndices + " indices!");
            var indices = new MOVI[numIndices];

            for (var i = 0; i < numIndices; i++)
            {
                indices[i].indice = bin.ReadUInt16();
            }
            return(indices);
        }
Ejemplo n.º 4
0
        public void ExtractMOVI(ICLIFlags toolFlags)
        {
            string       basePath;
            ExtractFlags flags = toolFlags as ExtractFlags;

            basePath = flags?.OutputPath;
            if (string.IsNullOrWhiteSpace(basePath))
            {
                throw new Exception("no output path");
            }

            const string container = "DebugMovies";

            foreach (ulong key in Program.TrackedFiles[0xB6])
            {
                using (Stream videoStream = OpenFile(key)) {
                    if (videoStream != null)
                    {
                        using (BinaryReader reader = new BinaryReader(videoStream))
                        {
                            MOVI movi = reader.Read <MOVI>();
                            videoStream.Position = 128;  // wrapped in "MOVI" for some reason
                            string videoFile = Path.Combine(basePath, container, GUID.LongKey(key).ToString("X12"), $"{GUID.LongKey(key):X12}.bk2");
                            WriteFile(videoStream, videoFile);
                            FindLogic.Combo.ComboInfo audioInfo = new FindLogic.Combo.ComboInfo
                            {
                                SoundFiles = new System.Collections.Generic.Dictionary <ulong, FindLogic.Combo.SoundFileInfo>
                                {
                                    { movi.MasterAudio, new FindLogic.Combo.SoundFileInfo(movi.MasterAudio) }
                                },
                                SaveRuntimeData = new FindLogic.Combo.ComboSaveRuntimeData
                                {
                                    Threads = false
                                }
                            };
                            SaveLogic.Combo.SaveSoundFile(flags, Path.Combine(basePath, container, GUID.LongKey(key).ToString("X12")), audioInfo, movi.MasterAudio, false);
                        }
                    }
                }
            }
        }