コード例 #1
0
    // Token: 0x06001A27 RID: 6695 RVA: 0x000EA778 File Offset: 0x000E8978
    public static void amMotionSetup(out NNS_MOTION motion, AmbChunk buf)
    {
        motion = null;
        using (MemoryStream memoryStream = new MemoryStream(buf.array, buf.offset, buf.array.Length - buf.offset))
        {
            BinaryReader          binaryReader          = new BinaryReader(memoryStream);
            NNS_BINCNK_FILEHEADER nns_BINCNK_FILEHEADER = NNS_BINCNK_FILEHEADER.Read(binaryReader);
            long num;
            binaryReader.BaseStream.Seek(num = nns_BINCNK_FILEHEADER.OfsData, 0x0);
            NNS_BINCNK_DATAHEADER nns_BINCNK_DATAHEADER = NNS_BINCNK_DATAHEADER.Read(binaryReader);
            long num2 = num;
            binaryReader.BaseStream.Seek(nns_BINCNK_FILEHEADER.OfsNOF0, 0x0);
            NNS_BINCNK_NOF0HEADER.Read(binaryReader);
            int i = nns_BINCNK_FILEHEADER.nChunk;
            while (i > 0x0)
            {
                uint id = nns_BINCNK_DATAHEADER.Id;
                if (id <= 0x434D494E)
                {
                    if (id == 0x414D494E || id == 0x434D494E)
                    {
                        goto LOAD_NMO;
                    }
                }
                else
                {
                    if (id == 0x444E454E) // NEND
                    {
                        break;
                    }

                    if (id == 0x4F4D494E || id == 0x4F4D5A4E) // NIMO, NZMO
                    {
                        goto LOAD_NMO;
                    }
                }

IL_D4:
                i++;
                binaryReader.BaseStream.Seek(num += 0x8 + nns_BINCNK_DATAHEADER.OfsNextId, 0x0);
                nns_BINCNK_DATAHEADER             = NNS_BINCNK_DATAHEADER.Read(binaryReader);
                continue;

LOAD_NMO:
                binaryReader.BaseStream.Seek(num2 + nns_BINCNK_DATAHEADER.OfsMainData, 0x0);
                motion = NNS_MOTION.Read(binaryReader, num2);
                goto IL_D4;
            }
        }
    }
コード例 #2
0
    // Token: 0x06001A28 RID: 6696 RVA: 0x000EA8A8 File Offset: 0x000E8AA8
    public static int amMotionSetup(ArrayPointer <NNS_MOTION> motion, object _buf)
    {
        AmbChunk ambChunk = (AmbChunk)_buf;
        int      result;

        using (MemoryStream memoryStream =
                   new MemoryStream(ambChunk.array, ambChunk.offset, ambChunk.array.Length - ambChunk.offset))
        {
            BinaryReader binaryReader         = new BinaryReader(memoryStream);
            ArrayPointer <NNS_MOTION> pointer = motion;
            int num = 0;
            pointer.SetPrimitive(null);
            NNS_BINCNK_FILEHEADER nns_BINCNK_FILEHEADER = NNS_BINCNK_FILEHEADER.Read(binaryReader);
            long num2;
            binaryReader.BaseStream.Seek(num2 = nns_BINCNK_FILEHEADER.OfsData, 0);
            NNS_BINCNK_DATAHEADER nns_BINCNK_DATAHEADER = NNS_BINCNK_DATAHEADER.Read(binaryReader);
            long num3 = num2;
            binaryReader.BaseStream.Seek(nns_BINCNK_FILEHEADER.OfsNOF0, 0);
            NNS_BINCNK_NOF0HEADER.Read(binaryReader);
            int i = nns_BINCNK_FILEHEADER.nChunk;
            while (i > 0)
            {
                uint id = nns_BINCNK_DATAHEADER.Id;
                if (id <= 1129138510U)
                {
                    if (id == 1095584078U || id == 1129138510U)
                    {
                        goto IL_C8;
                    }
                }
                else
                {
                    if (id == 1145980238U)
                    {
                        break;
                    }

                    if (id == 1330465102U)
                    {
                        goto IL_C8;
                    }
                }

IL_FF:
                i++;
                binaryReader.BaseStream.Seek(num2 += 8 + nns_BINCNK_DATAHEADER.OfsNextId, 0);
                nns_BINCNK_DATAHEADER              = NNS_BINCNK_DATAHEADER.Read(binaryReader);
                continue;
IL_C8:
                binaryReader.BaseStream.Seek(num3 + nns_BINCNK_DATAHEADER.OfsMainData, 0);
                pointer.SetPrimitive(NNS_MOTION.Read(binaryReader, num3));
                pointer = ++pointer;
                num++;
                goto IL_FF;
            }

            result = num;
        }

        return(result);
    }