protected xaMaterialSection ParseMaterialSection(int numMaterials) { xaMaterialSection section = new xaMaterialSection(); section.MaterialList = new List <xaMaterial>(numMaterials); for (int i = 0; i < numMaterials; i++) { xaMaterial mat = new xaMaterial(); section.MaterialList.Add(mat); mat.Name = reader.ReadName(); int numColors = reader.ReadInt32(); mat.ColorList = new List <xaMaterialColor>(numColors); for (int j = 0; j < numColors; j++) { xaMaterialColor color = new xaMaterialColor(); mat.ColorList.Add(color); color.Diffuse = reader.ReadColor4(); color.Ambient = reader.ReadColor4(); color.Specular = reader.ReadColor4(); color.Emissive = reader.ReadColor4(); color.Power = reader.ReadSingle(); color.Unknown1 = reader.ReadBytes(4); } } return(section); }
protected xaMaterialSection ParseMaterialSection() { xaMaterialSection section = null; if (reader.ReadByte() == 1) { section = ParseMaterialSection(reader.ReadInt32()); } return(section); }