Exemplo n.º 1
0
        private void LoadTable()
        {
            int num = 400 + ((this.m_Index.Length - 0x88b8) / 0xaf);

            this.m_Table = new int[num];
            for (int i = 0; i < num; i++)
            {
                object obj2 = BodyTable.m_Entries[i];
                if ((obj2 == null) || BodyConverter.Contains(i))
                {
                    this.m_Table[i] = i;
                }
                else
                {
                    BodyTableEntry entry = (BodyTableEntry)obj2;
                    this.m_Table[i] = (entry.m_OldID | -2147483648) | (((entry.m_NewHue ^ 0x8000) & 0xffff) << 15);
                }
            }
        }
Exemplo n.º 2
0
        static BodyTable()
        {
            string path = Engine.FileManager.ResolveMUL("Body.def");

            if (File.Exists(path))
            {
                string       str2;
                StreamReader reader = new StreamReader(path);
                while ((str2 = reader.ReadLine()) != null)
                {
                    if (((str2 = str2.Trim()).Length != 0) && !str2.StartsWith("#"))
                    {
                        try
                        {
                            int    index  = str2.IndexOf('{');
                            int    num2   = str2.IndexOf('}');
                            string str3   = str2.Substring(0, index).Trim();
                            string str4   = str2.Substring(index + 1, (num2 - index) - 1).Trim();
                            string str5   = str2.Substring(num2 + 1).Trim();
                            int    length = str4.IndexOf(',');
                            if (length > -1)
                            {
                                str4 = str4.Substring(0, length).Trim();
                            }
                            int newID  = Convert.ToInt32(str3);
                            int oldID  = Convert.ToInt32(str4);
                            int newHue = Convert.ToInt32(str5);
                            m_Entries[newID] = new BodyTableEntry(oldID, newID, newHue);
                            continue;
                        }
                        catch
                        {
                            Debug.Error("Bad def format");
                            continue;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 static BodyTable()
 {
     string path = Engine.FileManager.ResolveMUL("Body.def");
     if (File.Exists(path))
     {
         string str2;
         StreamReader reader = new StreamReader(path);
         while ((str2 = reader.ReadLine()) != null)
         {
             if (((str2 = str2.Trim()).Length != 0) && !str2.StartsWith("#"))
             {
                 try
                 {
                     int index = str2.IndexOf('{');
                     int num2 = str2.IndexOf('}');
                     string str3 = str2.Substring(0, index).Trim();
                     string str4 = str2.Substring(index + 1, (num2 - index) - 1).Trim();
                     string str5 = str2.Substring(num2 + 1).Trim();
                     int length = str4.IndexOf(',');
                     if (length > -1)
                     {
                         str4 = str4.Substring(0, length).Trim();
                     }
                     int newID = Convert.ToInt32(str3);
                     int oldID = Convert.ToInt32(str4);
                     int newHue = Convert.ToInt32(str5);
                     m_Entries[newID] = new BodyTableEntry(oldID, newID, newHue);
                     continue;
                 }
                 catch
                 {
                     Debug.Error("Bad def format");
                     continue;
                 }
             }
         }
     }
 }