Пример #1
0
        void relocateAnimData(uint off2)
        {
            os.Position = off2;
            wr.Write(ps[0]);
            wr.Write((uint)(off2 - off + reloc + 0x90U));
            wr.Write(ps[2]);
            wr.Write(ps[3]);
            wr.Write(ps[4]);
            wr.Write(ps[5]);

            os.Position = off2 + 0x90U + 0x10U;
            int c0 = br.ReadUInt16();
            int c1 = br.ReadUInt16();

            os.Position = off2 + 0x90U + 0x18U;
            uint pos = br.ReadUInt32();

            int ct = c1 - c0;

            uint off3 = off2 + 0x90U + pos;

            if (off3 < (uint)os.Length)
            {
                BSReloc.Run(os, off3, ct, c0);
            }
        }
Пример #2
0
        uint ty04(uint pos)
        {
            os.Position = off + pos;
            wr.Write(pos0);
            wr.Write(reloc + pos + 0x90U);
            wr.Write(pos2);
            wr.Write(pos3);

            os.Position = off + pos + 0x90U + 0x10U;
            uint c10 = br.ReadUInt16();
            uint c12 = br.ReadUInt16();
            uint c14 = br.ReadUInt32();

#if true
            BSReloc.Run(os, off + pos + 0x90U + c14, (int)c10, 0);
#else
            List <Corner> alc = new List <Corner>();
            for (int t = 0; t < (int)c10; t++)
            {
                os.Position = off + pos + 0x90U + c14 + 64 * t;
                Corner o = new Corner();
                o.bi = br.ReadInt32();
                o.pi = br.ReadInt32();
                if (o.pi != -1)
                {
                    if (alc[o.pi].x3 == -1)   // no children yet
                    {
                        alc[o.pi].x3 = t;
                    }
                    else   // having children
                    {
                        int myx3 = alc[o.pi].x3;
                        alc[o.pi].x3 = t;
                        o.x1         = myx3;
                    }
                }
                alc.Add(o);
            }
            for (int t = 0; t < (int)c10; t++)
            {
                Debug.WriteLine(alc[t]);
            }
            for (int t = 0; t < (int)c10; t++)
            {
                os.Position = off + pos + 0x90U + c14 + 64 * t;
                Corner o = alc[t];
                os.Seek(+2, SeekOrigin.Current);
                wr.Write((ushort)o.x1);
                os.Seek(+2, SeekOrigin.Current);
                wr.Write((ushort)o.x3);
            }
#endif

            return(reloc + pos);
        }