public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write((uint)this.Flags); bw.WriteVector3f(this.Position); bw.Write(this.GlobalStartRadius); bw.Write(this.GlobalEndRadius); bw.Write(this.LandFog.Serialize()); bw.Write(this.UnderwaterFog.Serialize()); } return ms.ToArray(); } }
public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { foreach (Vector3f visibleVertex in this.VisibleVertices) { bw.WriteVector3f(visibleVertex); } } return ms.ToArray(); } }
public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { byte[] nameOffsetBytes = BitConverter.GetBytes(this.NameOffset); byte[] finalNameOffsetBytes = new byte[3]; Buffer.BlockCopy(nameOffsetBytes, 0, finalNameOffsetBytes, 0, 3); bw.Write(finalNameOffsetBytes); bw.Write((byte)this.Flags); bw.WriteVector3f(this.Position); // TODO: Investigate whether or not this is a Quat16 in >= BC bw.WriteQuaternion32(this.Orientation); bw.Write(this.Scale); bw.WriteBGRA(this.StaticLightingColour); } return ms.ToArray(); } }
public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { foreach (Vector3f normal in this.Normals) { bw.WriteVector3f(normal); } } return ms.ToArray(); } }
public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write((byte)this.Type); bw.Write(this.bUseAttenuation); bw.Write(this.bUseUnknown1); bw.Write(this.bUseUnknown2); bw.WriteBGRA(this.Colour); bw.WriteVector3f(this.Position); bw.Write(this.Intensity); bw.Write(this.AttenuationStartRadius); bw.Write(this.AttenuationEndRadius); bw.Write(this.Unknown1StartRadius); bw.Write(this.Unknown1EndRadius); bw.Write(this.Unknown2StartRadius); bw.Write(this.Unknown2EndRadius); } return ms.ToArray(); } }
public byte[] Serialize() { using (MemoryStream ms = new MemoryStream()) { using (BinaryWriter bw = new BinaryWriter(ms)) { bw.Write(this.WidthVertices); bw.Write(this.HeightVertices); bw.Write(this.WidthTileFlags); bw.Write(this.HeightTileFlags); bw.WriteVector3f(this.Location); bw.Write(this.MaterialIndex); foreach (LiquidVertex liquidVertex in this.LiquidVertices) { bw.Write(liquidVertex.Serialize()); } foreach (LiquidFlags liquidFlag in this.LiquidTileFlags) { bw.Write((byte)liquidFlag); } } return ms.ToArray(); } }