Exemplo n.º 1
0
        private void ReadTextures(PropertyReader.Property p, IMEPackage pcc)
        {
            int count = BitConverter.ToInt32(p.raw, 24);
            int start = 28;

            for (int i = 0; i < count; i++)
            {
                // read next 68 bytes
                List <PropertyReader.Property> props = PropertyReader.ReadProp(pcc, p.raw, start);
                TextureOverride to = new TextureOverride();

                foreach (PropertyReader.Property sp in props)
                {
                    string propName = pcc.getNameEntry(sp.Name);
                    switch (propName)
                    {
                    case "nName":
                        int nameI = sp.Value.IntValue;
                        if (pcc.isName(nameI))
                        {
                            to.ParamName = pcc.Names[nameI];
                        }
                        break;

                    case "m_pTexture":
                        int objTextIndex = sp.Value.IntValue;
                        if (pcc.isExport(objTextIndex - 1))
                        {
                            to.TextureName = pcc.Exports[objTextIndex - 1].ObjectName;
                        }
                        break;

                    case "None":
                        break;
                    }
                }
                TextureOverrides.Add(to);
                start = props[props.Count - 1].offend;
            }
        }