Exemple #1
0
        public void Write(BlamLib.IO.EndianWriter s)
        {
            s.WriteTag(Ext);
            int count = Names.Count;

            s.Write(count);
            for (int x = 0; x < count; x++)
            {
                s.Write(Names[x]);
                s.Write(Scenarios[x]);
            }
        }
Exemple #2
0
        public override void Write(BlamLib.IO.EndianWriter s)
        {
            CacheFile cf = s.Owner as CacheFile;

            if (cf.EngineVersion == BlamVersion.Halo2_PC)
            {
                return;
            }
            if (cf.EngineVersion == BlamVersion.Halo2_Alpha)
            {
                return;
            }

            s.WriteTag((char[])MiscGroups.head);
            s.Write(8);
            s.Write(fileLength);
            s.Write(0);
            s.Write(offsetToIndex);
            s.Write(indexStreamSize);
            s.Write(tagBufferSize);
            s.Write(0);             // needs to be calc'd

            s.Write(new byte[256]);
            s.Write("02.09.27.09809", false);
            s.Write((int)cacheType);
            s.Write(0);             // needs to be calc'd
            s.Write(0);             // needs to be calc'd
            s.Write(0); s.Write(0);

            s.Write(0);             // needs to be calc'd

            s.Write(0);             // needs to be calc'd
            s.Write(0);             // needs to be calc'd

            s.Write(/*stringIdsBufferAlignedOffset*/ 0);
            s.Write(stringIdsCount);

            s.Write(stringIdsBufferSize);
            s.Write(stringIdIndicesOffset);
            s.Write(stringIdsBufferOffset);

            s.Write(0);             // 4 bools

            s.Write(Filetime.dwHighDateTime);                       s.Write(Filetime.dwHighDateTime);

            // mainmenu
            s.Write(SharedFiletimes[0].dwHighDateTime);     s.Write(SharedFiletimes[0].dwHighDateTime);
            // shared
            s.Write(SharedFiletimes[1].dwHighDateTime);     s.Write(SharedFiletimes[1].dwHighDateTime);
            // shared sp
            s.Write(SharedFiletimes[2].dwHighDateTime);     s.Write(SharedFiletimes[2].dwHighDateTime);

            s.Write(name, false);
            s.Write(0);
            s.Write(scenarioPath, 256);
            s.Write(Convert.ToInt32(needsShared));

            s.Write(tagNamesCount);
            s.Write(tagNamesBufferOffset);
            s.Write(tagNamesBufferSize);
            s.Write(tagNameIndicesOffset);

            s.Write(0);             // checksum

            s.Write(new byte[1320]);

            s.WriteTag((char[])MiscGroups.foot);
        }