public WriteColor3D ( |
||
color | ||
리턴 | void |
public void Write(BrgBinaryWriter writer) { writer.Write(this.Id); writer.Write((int)this.Flags); writer.Write(this.unknown01b); writer.Write(Encoding.UTF8.GetByteCount(this.DiffuseMap)); writer.WriteColor3D(this.DiffuseColor); writer.WriteColor3D(this.AmbientColor); writer.WriteColor3D(this.SpecularColor); writer.WriteColor3D(this.EmissiveColor); writer.WriteString(this.DiffuseMap, 0); if (this.Flags.HasFlag(BrgMatFlag.SpecularExponent)) { writer.Write(this.SpecularExponent); } if (this.Flags.HasFlag(BrgMatFlag.BumpMap)) { writer.WriteString(this.BumpMap, 4); } if (this.Flags.HasFlag(BrgMatFlag.Alpha)) { writer.Write(this.Opacity); } if (this.Flags.HasFlag(BrgMatFlag.REFLECTIONTEXTURE)) { writer.Write((byte)this.sfx.Count); for (int i = 0; i < this.sfx.Count; i++) { writer.Write(this.sfx[i].Id); writer.WriteString(this.sfx[i].Name, 2); } } }
public void Write(Stream stream) { using (BrgBinaryWriter writer = new BrgBinaryWriter(new LittleEndianBitConverter(), stream)) { writer.Write(1280463949); // MTRL UInt32 nameLength = (UInt32)Encoding.UTF8.GetByteCount(this.Texture); writer.Write(nameLength); for (int i = 0; i < 5; ++i) { writer.Write(this.unk[i]); } writer.WriteColor3D(this.Diffuse); writer.WriteColor3D(this.Ambient); writer.WriteColor3D(this.Specular); writer.WriteColor3D(this.Emissive); writer.Write(this.SpecularLevel); writer.Write(this.Alpha); writer.Write(this.Id); writer.Write(this.SelfIlluminating); writer.Write(this.ClampU); writer.Write(this.ClampV); writer.Write(this.LightSpecular); writer.Write(this.AffectsAmbient); writer.Write(this.AffectsDiffuse); writer.Write(this.AffectsSpecular); writer.Write(this.Updateable); writer.Write(this.AlphaMode); // Seems to be very often 10, wave has a 2 here, phoenix has 6 writer.Write(this.AmbientIntensity); writer.Write(this.DiffuseIntensity); writer.Write(this.SpecularIntensity); writer.Write(this.EmissiveIntensity); writer.Write(this.ColorTransform); // Val of 4 seems to be PC writer.Write(this.TextureTransform); writer.Write(this.TextureFactor); // Has something to do with Cube Map writer.Write(this.MultiTextureMode); // Has something to do with Cube Map writer.Write(this.TexGenMode0); writer.Write(this.TexGenMode1); // Has something to do with Cube Map writer.Write(this.TexCoordSet0); writer.Write(this.TexCoordSet1); writer.Write(this.TexCoordSet2); writer.Write(this.TexCoordSet3); writer.Write(this.TexCoordSet4); writer.Write(this.TexCoordSet5); writer.Write(this.TexCoordSet6); writer.Write(this.TexCoordSet7); for (int i = 0; i < 3; ++i) { writer.WriteTexel(this.unk2[i]); } for (int i = 0; i < 3; ++i) { writer.WriteTexel(this.unk3[i]); } for (int i = 0; i < 4; ++i) { writer.Write(this.unk4[i]); } if (nameLength > 0) { writer.WriteString(this.Texture); } } }
public void Write(Stream stream) { using (BrgBinaryWriter writer = new BrgBinaryWriter(new LittleEndianBitConverter(), stream)) { writer.Write(1280463949); // MTRL UInt32 nameLength = (UInt32)Encoding.UTF8.GetByteCount(this.Texture); writer.Write(nameLength); for (int i = 0; i < 5; ++i) { writer.Write(this.unk[i]); } writer.WriteColor3D(this.Diffuse); writer.WriteColor3D(this.Ambient); writer.WriteColor3D(this.Specular); writer.WriteColor3D(this.Emissive); writer.Write(this.SpecularLevel); writer.Write(this.Alpha); writer.Write(this.Id); writer.Write(this.SelfIlluminating); writer.Write(this.ClampU); writer.Write(this.ClampV); writer.Write(this.LightSpecular); writer.Write(this.AffectsAmbient); writer.Write(this.AffectsDiffuse); writer.Write(this.AffectsSpecular); writer.Write(this.Updateable); writer.Write(this.AlphaMode); // Seems to be very often 10, wave has a 2 here, phoenix has 6 writer.Write(this.AmbientIntensity); writer.Write(this.DiffuseIntensity); writer.Write(this.SpecularIntensity); writer.Write(this.EmissiveIntensity); writer.Write(this.ColorTransform); // Val of 4 seems to be PC writer.Write(this.TextureTransform); writer.Write(this.TextureFactor); // Has something to do with Cube Map writer.Write(this.MultiTextureMode); // Has something to do with Cube Map writer.Write(this.TexGenMode0); writer.Write(this.TexGenMode1); // Has something to do with Cube Map writer.Write(this.TexCoordSet0); writer.Write(this.TexCoordSet1); writer.Write(this.TexCoordSet2); writer.Write(this.TexCoordSet3); writer.Write(this.TexCoordSet4); writer.Write(this.TexCoordSet5); writer.Write(this.TexCoordSet6); writer.Write(this.TexCoordSet7); for (int i = 0; i < 3; ++i) { writer.WriteTexel(this.unk2[i]); } for (int i = 0; i < 3; ++i) { writer.WriteTexel(this.unk3[i]); } for (int i = 0; i < 4; ++i) { writer.Write(this.unk4[i]); } if (nameLength > 0) { writer.WriteString(this.Texture); } } }