/// <summary> /// Write a single batch. /// </summary> /// <param name="bw">The binarywriter to write with.</param> public void Write(DhBinaryWriter bw) { // Write face count. bw.WriteU16(FaceCount); // Write list size. (CALCULATED) bw.WriteS16(0); // Write vertex attributes. bw.WriteU32((uint)VertexAttributes); // Write normals flag. bw.Write(UseNormals ? 1 : 0); // Write position winding flag. bw.Write(Positions); // Write uv count. bw.Write(UvCount); // Write NBT flag. bw.Write(UseNBT ? 1 : 0); // Write primitive offset. (CALCULATED) bw.WriteU32(0); // Write unknown 1. bw.WriteS32s(Unknown1); // 8 bytes }
/// <summary> /// Write a single material with specified Binary Writer. /// </summary> /// <param name="bw">Binary Writer to use.</param> public void Write(DhBinaryWriter bw) { // Write Index. bw.WriteS16(Index); // Write Unknown 1. (Unused index?) bw.WriteS16(Unknown1); // Write U-Wrapping. bw.Write(WrapU); // Write V-Wrapping. bw.Write(WrapV); // Write Unknown 2. (Flags?) bw.WriteS16(Unknown2); // Write Unknown 3. bw.WriteS32s(Unknown3); }