public void Write(BinaryWriterEx bw) { bw.Write(cntVertex); bw.Write(ptrVertex); bw.WriteArrayInt16(sizes); bw.WriteArrayUInt32(offs); for (int i = 0; i < cntVertex; i++) { verts[i].Write(bw); } foreach (var face in faces) { face.Write(bw); } }
public void Write(BinaryWriterEx bw) { bw.WriteArrayInt16(ind); bw.Write((ushort)quadFlags); //bw.Write(unk1); // bw.Write(drawOrderLow); bw.Write(bitvalue); bw.Write(drawOrderHigh); bw.WriteArrayUInt32(ptrTexMid); bb.Write(bw); bw.Write((byte)terrainFlag); bw.Write(WeatherIntensity); bw.Write(WeatherType); bw.Write(TerrainFlagUnknown); bw.Write(id); bw.Write(trackPos); bw.Write(midunk); Debug.Log(bw.BaseStream.Position); bw.Write(ptrTexLow); bw.Write(offset2); Debug.Log(offset2); foreach (Vector2s v in unk3) { v.Write(bw); Debug.Log(v); } Debug.Log(ptrTexLow); long texpos = bw.BaseStream.Position; bw.Seek((int)ptrTexLow + 4, SeekOrigin.Begin); texlow.Write(bw); int texIndex = 0; Debug.Log((ptrTexLow + 4) / 16 + ", " + ptrTexMid.Length / 16); if (38435 == (ptrTexLow + 4) / 16) { Debug.Log("----------THE INTERESTING ONE----------"); } foreach (uint u in ptrTexMid) { bw.Seek((int)u + 4, SeekOrigin.Begin); if (tex[texIndex] != null) { tex[texIndex].Write(bw); } texIndex++; } if (38435 == (ptrTexLow + 4) / 16) { Debug.Log("----------THE INTERESTING ONE----------"); } bw.Seek((int)texpos, SeekOrigin.Begin); }