Exemple #1
0
        public unsafe ItemArt()
        {
            FileStream fs = new FileStream(Engine.FileManager.ResolveMUL(Files.ArtIdx), FileMode.Open, FileAccess.Read, FileShare.Read);

            fs.Seek(0x30000L, SeekOrigin.Begin);
            fixed(Entry3D *entrydRef = this.m_Index)
            {
                Engine.NativeRead(fs, (void *)entrydRef, 0x30000);
            }

            fs.Close();
            this.m_Stream  = new FileStream(Engine.FileManager.ResolveMUL(Files.ArtMul), FileMode.Open, FileAccess.Read, FileShare.Read);
            this.m_Verdata = new FileStream(Engine.FileManager.ResolveMUL(Files.Verdata), FileMode.Open, FileAccess.Read, FileShare.Read);
            int num = 0;

            Engine.NativeRead(this.m_Verdata, (void *)&num, 4);
            if (num > 0)
            {
                Entry5D[] entrydArray = new Entry5D[num];
                fixed(Entry5D *entrydRef2 = entrydArray)
                {
                    Engine.NativeRead(this.m_Verdata, (void *)entrydRef2, num * 20);
                    for (int k = 0; k < num; k++)
                    {
                        Entry5D entryd = entrydRef2[k];
                        if (((entryd.m_FileID == 4) && (entryd.m_BlockID >= 0x4000)) && (entryd.m_BlockID < 0x8000))
                        {
                            entryd.m_BlockID &= 0x3fff;
                            this.m_Index[entryd.m_BlockID].m_Lookup = entryd.m_Lookup;
                            this.m_Index[entryd.m_BlockID].m_Length = entryd.m_Length;
                            this.m_Index[entryd.m_BlockID].m_Extra  = entryd.m_Extra;
                        }
                    }
                }
            }
            ArtTableEntry[] entries = ArtTable.m_Entries;
            for (int i = 0; i < this.m_Translate.Length; i++)
            {
                this.m_Translate[i] = i;
            }
            int length = entries.Length;

            for (int j = 0; j < length; j++)
            {
                ArtTableEntry entry = entries[j];
                if ((entry.m_OldID >= 0x4000) && (entry.m_NewID >= 0x4000))
                {
                    this.m_Translate[entry.m_NewID & 0x3fff] = entry.m_OldID & 0x3fff;
                    if (this.m_Index[entry.m_NewID & 0x3fff].m_Lookup == -1)
                    {
                        this.m_Index[entry.m_NewID & 0x3fff].m_Lookup = j | -2147483648;
                        this.m_Index[entry.m_NewID & 0x3fff].m_Length = this.m_Index[entry.m_OldID & 0x3fff].m_Length;
                    }
                }
            }
        }
Exemple #2
0
 public unsafe ItemArt()
 {
     FileStream fs = new FileStream(Engine.FileManager.ResolveMUL(Files.ArtIdx), FileMode.Open, FileAccess.Read, FileShare.Read);
     fs.Seek(0x30000L, SeekOrigin.Begin);
     fixed (Entry3D* entrydRef = this.m_Index)
     {
         Engine.NativeRead(fs, (void*) entrydRef, 0x30000);
     }
     fs.Close();
     this.m_Stream = new FileStream(Engine.FileManager.ResolveMUL(Files.ArtMul), FileMode.Open, FileAccess.Read, FileShare.Read);
     this.m_Verdata = new FileStream(Engine.FileManager.ResolveMUL(Files.Verdata), FileMode.Open, FileAccess.Read, FileShare.Read);
     int num = 0;
     Engine.NativeRead(this.m_Verdata, (void*) &num, 4);
     if (num > 0)
     {
         Entry5D[] entrydArray = new Entry5D[num];
         fixed (Entry5D* entrydRef2 = entrydArray)
         {
             Engine.NativeRead(this.m_Verdata, (void*) entrydRef2, num * 20);
             for (int k = 0; k < num; k++)
             {
                 Entry5D entryd = entrydRef2[k];
                 if (((entryd.m_FileID == 4) && (entryd.m_BlockID >= 0x4000)) && (entryd.m_BlockID < 0x8000))
                 {
                     entryd.m_BlockID &= 0x3fff;
                     this.m_Index[entryd.m_BlockID].m_Lookup = entryd.m_Lookup;
                     this.m_Index[entryd.m_BlockID].m_Length = entryd.m_Length;
                     this.m_Index[entryd.m_BlockID].m_Extra = entryd.m_Extra;
                 }
             }
         }
     }
     ArtTableEntry[] entries = ArtTable.m_Entries;
     for (int i = 0; i < this.m_Translate.Length; i++)
     {
         this.m_Translate[i] = i;
     }
     int length = entries.Length;
     for (int j = 0; j < length; j++)
     {
         ArtTableEntry entry = entries[j];
         if ((entry.m_OldID >= 0x4000) && (entry.m_NewID >= 0x4000))
         {
             this.m_Translate[entry.m_NewID & 0x3fff] = entry.m_OldID & 0x3fff;
             if (this.m_Index[entry.m_NewID & 0x3fff].m_Lookup == -1)
             {
                 this.m_Index[entry.m_NewID & 0x3fff].m_Lookup = j | -2147483648;
                 this.m_Index[entry.m_NewID & 0x3fff].m_Length = this.m_Index[entry.m_OldID & 0x3fff].m_Length;
             }
         }
     }
 }