public void LoadBinaryData(byte[] inData) { using (MemoryStream ms = new MemoryStream(inData)) { using (BinaryReader br = new BinaryReader(ms)) { for (int y = 0; y < 16; ++y) { if (y % 2 == 0) { // Read a block of 9 high res vertices for (int x = 0; x < 9; ++x) { this.HighResVertexLights.Add(br.ReadRGBA()); } } else { // Read a block of 8 low res vertices for (int x = 0; x < 8; ++x) { this.LowResVertexLights.Add(br.ReadRGBA()); } } } } } }
public ModelMaterial(byte[] inData) { using (MemoryStream ms = new MemoryStream(inData)) { using (BinaryReader br = new BinaryReader(ms)) { this.Flags = (MaterialFlags) br.ReadUInt32(); this.Shader = (ShaderTypes) br.ReadUInt32(); this.BlendMode = (BlendingMode) br.ReadUInt32(); this.FirstTextureOffset = br.ReadUInt32(); this.FirstColour = br.ReadRGBA(); this.FirstFlags = (MaterialFlags)br.ReadUInt32(); this.SecondTextureOffset = br.ReadUInt32(); this.SecondColour = br.ReadRGBA(); this.GroundType = new UInt32ForeignKey("TerrainType", "ID", br.ReadUInt32()); this.ThirdTextureOffset = br.ReadUInt32(); this.BaseDiffuseColour = br.ReadRGBA(); this.ThirdFlags = (MaterialFlags)br.ReadUInt32(); this.RuntimeData1 = br.ReadUInt32(); this.RuntimeData2 = br.ReadUInt32(); this.RuntimeData3 = br.ReadUInt32(); this.RuntimeData4 = br.ReadUInt32(); } } }
public void LoadBinaryData(byte[] inData) { using (MemoryStream ms = new MemoryStream(inData)) { using (BinaryReader br = new BinaryReader(ms)) { this.TextureCount = br.ReadUInt32(); this.GroupCount = br.ReadUInt32(); this.PortalCount = br.ReadUInt32(); this.LightCount = br.ReadUInt32(); this.DoodadNameCount = br.ReadUInt32(); this.DoodadDefinitionCount = br.ReadUInt32(); this.DoodadSetCount = br.ReadUInt32(); this.BaseAmbientColour = br.ReadRGBA(); this.AreaTableID = new UInt32ForeignKey("WMOAreaTable", "WMOID", br.ReadUInt32()); this.BoundingBox = br.ReadBox(); this.Flags = (RootFlags) br.ReadUInt32(); } } }