public void CopyTo(asStream stream) { stream.Put(R); stream.Put(G); stream.Put(B); stream.Put(A); }
public ColorRGBA(asStream stream) { R = stream.GetFloat(); G = stream.GetFloat(); B = stream.GetFloat(); A = stream.GetFloat(); }
public override void Load(asStream stream) { Resolution = stream.GetShort(); Stride = stream.GetShort(); Unknown = stream.GetShort(); Flags = stream.GetShort(); Material = stream.GetShort(); Texture = stream.GetShort(); Physics = stream.GetShort(); var numVerts = (Resolution * Stride); Vertices = new List <DLPVertex>(numVerts); for (int i = 0; i < numVerts; i++) { var vertex = new DLPVertex(stream); Vertices.Add(vertex); } UserData = stream.GetString(); }
public override void Save(asStream stream) { stream.PutString(Name, 32); stream.Put(Flags); stream.Put(Unknown1); stream.Put(Unknown2); // alignment stream.Put((byte)0); }
static List <T> ParseDB <T>(string filename, string libName, string entriesName) where T : agiRefreshable, IAGILibraryData, new() { var stream = new asStream(filename); Console.WriteLine($"Parsing DB: \"{filename}\""); var numEntries = stream.GetInt(); var entries = new List <T>(numEntries); for (int i = 0; i < numEntries; i++) { var entry = new T(); entry.Load(stream); entries.Add(entry); } //var writer = new StringBuilder(); // //writer.AppendLine($"# {libName}"); //writer.AppendLine($"# {entriesName,-12} {entries.Count}"); //writer.AppendLine(); //foreach (var entry in entries) //{ // entry.Print(writer); // writer.AppendLine(); //} //File.WriteAllText(Path.ChangeExtension(filename, ".log"), writer.ToString()); using (var file = new StreamWriter(Path.ChangeExtension(filename, ".csv"))) using (var writer = new CsvWriter(file)) { var writeHeader = true; foreach (var entry in entries) { if (writeHeader) { entry.LibraryHeader(writer); writeHeader = false; } entry.LibrarySave(writer); } file.Flush(); } return(entries); }
public override void Load(asStream stream) { Name = stream.GetString(32); Flags = stream.GetByte(); Unknown1 = stream.GetByte(); Unknown2 = stream.GetByte(); // ignore alignment stream.Skip(1); }
public override void Save(asStream stream) { stream.PutString(Name, 32); Emission.CopyTo(stream); Ambient.CopyTo(stream); Diffuse.CopyTo(stream); Specular.CopyTo(stream); stream.Put(Shininess); stream.Put(Reserved); }
public override void Load(asStream stream) { int strLen = stream.GetByte(); Name = stream.GetString(strLen); var vertsCount = stream.GetInt(); var patchesCount = stream.GetInt(); Vertices = new short[vertsCount]; Patches = new short[patchesCount]; stream.Get(Vertices, vertsCount); stream.Get(Patches, patchesCount); }
public override void Load(asStream stream) { Name = stream.GetString(32); Emission = new ColorRGBA(stream); Ambient = new ColorRGBA(stream); Diffuse = new ColorRGBA(stream); Specular = new ColorRGBA(stream); Shininess = stream.GetFloat(); Reserved = stream.GetShort(); }
public override void Load(asStream stream) { Vertex = stream.GetShort(); Normals = new Vector3() { X = stream.GetFloat(), Y = stream.GetFloat(), Z = stream.GetFloat() }; SMap = stream.GetFloat(); TMap = stream.GetFloat(); Color = stream.GetInt(); }
public override void Save(asStream stream) { var strLen = (byte)(Name.Length + 1); stream.Put(strLen); stream.PutString(Name, strLen); var vertsCount = (Vertices != null) ? Vertices.Length : 0; var patchesCount = (Patches != null) ? Patches.Length : 0; stream.Put(vertsCount); stream.Put(patchesCount); stream.Put(Vertices); stream.Put(Patches); }
public override void Save(asStream stream) { stream.Put(Vertex); var norms = new[] { Normals.X, Normals.Y, Normals.Z }; stream.Put(norms, 3); stream.Put(SMap); stream.Put(TMap); stream.Put(Color); }
public override void Save(asStream stream) { stream.Put(Resolution); stream.Put(Stride); stream.Put(Unknown); stream.Put(Flags); stream.Put(Material); stream.Put(Texture); stream.Put(Physics); foreach (var vertex in Vertices) { vertex.Save(stream); } stream.PutString(UserData); }
public override void Load(asStream stream) { Name = stream.GetString(32); Friction = stream.GetFloat(); Elasticity = stream.GetFloat(); Drag = stream.GetFloat(); BumpHeight = stream.GetFloat(); BumpWidth = stream.GetFloat(); SinkDepth = stream.GetFloat(); PtxRate = stream.GetFloat(); Type = stream.GetInt(); Sound = stream.GetInt(); Velocity = new Vector2(stream); PtxColor = new ColorRGB(stream); }
public override void Save(asStream stream) { stream.PutString(Name, 32); stream.Put(Friction); stream.Put(Elasticity); stream.Put(Drag); stream.Put(BumpHeight); stream.Put(BumpWidth); stream.Put(SinkDepth); stream.Put(PtxRate); stream.Put(Type); stream.Put(Sound); Velocity.CopyTo(stream); PtxColor.CopyTo(stream); }
public virtual void Load(asStream stream) { return; }
public DLPPatch(DLPFile template, asStream stream) { Template = template; Load(stream); }
public agiMaterial(asStream stream) { Load(stream); }
public DLPTexture(asStream stream) { Load(stream); }
protected DLPFile(string filename) { FileName = filename; Stream = new asStream(filename); }
public Vector3(asStream stream) { X = stream.GetFloat(); Y = stream.GetFloat(); Z = stream.GetFloat(); }
public void CopyTo(asStream stream) { stream.Put(X); stream.Put(Y); stream.Put(Z); }
public DLPGroup(asStream stream) { Load(stream); }
public DLPPhysics(asStream stream) { Load(stream); }
public DLPMaterial(asStream stream) { Load(stream); }
public virtual void Save(asStream stream) { return; }
public agiPhysics(asStream stream) { Load(stream); }
public DLPVertex(asStream stream) { Load(stream); }
public agiTexture(asStream stream) { Load(stream); }