public void Save(System.IO.Stream stream) { if (aampFileV1 != null) { aampFileV1.Save(stream); } else { aampFileV2.Save(stream); } }
public byte[] Save() { var mem = new MemoryStream(); if (aampFileV1 != null) { aampFileV1.Save(mem); } else { aampFileV2.Save(mem); } return(mem.ToArray()); }
private void LoadParameters(aampv1.AampFile aamp) { if (aamp.EffectType == "Probe Data") { probeLightingConfig = new ProbeLighting(); viewport.AddDrawable(probeLightingConfig); var probeRoot = new ProbeLightingWrapper(probeLightingConfig); treeView1.Nodes.Add(probeRoot); uint index = 0; foreach (var val in aamp.RootNode.childParams) { var entry = new ProbeLighting.Entry(); entry.Index = index++; probeLightingConfig.Entries.Add(entry); probeRoot.Nodes.Add(new ProbeLightingEntryWrapper(entry)); foreach (var param in val.paramObjects) { switch (param.HashString) { case "param_obj": foreach (var data in param.paramEntries) { if (data.HashString == "index") { entry.Index = (uint)data.Value; } if (data.HashString == "type") { entry.Type = (uint)data.Value; } } break; case "grid": entry.Grid = LoadGridData(param.paramEntries); break; case "sh_index_buffer": LoadIndexBuffer(param.paramEntries, entry); break; case "sh_data_buffer": LoadDataBuffer(param.paramEntries, entry); break; } } } aamp.Save($"{CourseFolder}/DEBUG_PROBE.aamp"); foreach (var entry in probeLightingConfig.Entries) { Console.WriteLine(entry.Name); Console.WriteLine($"IndexType {entry.IndexType}"); Console.WriteLine($"DataType {entry.DataType}"); Console.WriteLine($"MaxIndexNum {entry.MaxIndexNum}"); Console.WriteLine($"UsedIndexNum {entry.UsedIndexNum}"); Console.WriteLine($"MaxShDataNum {entry.MaxShDataNum}"); Console.WriteLine($"UsedShDataNum {entry.UsedShDataNum}"); Console.WriteLine($"AABB_Max_Position {entry.Grid.AABB_Max_Position}"); Console.WriteLine($"AABB_Min_Position {entry.Grid.AABB_Min_Position}"); Console.WriteLine($"Voxel_Step_Position {entry.Grid.Voxel_Step_Position}"); Console.WriteLine($"DataBuffer {entry.DataBuffer.Length}"); Console.WriteLine($"IndexBuffer {entry.IndexBuffer.Length}"); } } }