public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); EmissionF.Save(utility); AmbientF.Save(utility); DiffuseF.Save(utility); Specular0F.Save(utility); Specular1F.Save(utility); Constant0F.Save(utility); Constant1F.Save(utility); Constant2F.Save(utility); Constant3F.Save(utility); Constant4F.Save(utility); Constant5F.Save(utility); Emission.Save(utility); Ambient.Save(utility); Diffuse.Save(utility); Specular0.Save(utility); Specular1.Save(utility); Constant0.Save(utility); Constant1.Save(utility); Constant2.Save(utility); Constant3.Save(utility); Constant4.Save(utility); Constant5.Save(utility); utility.Write(CommandCache); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); utility.Write(DynamicAllocator); // Texture Reference saveContext.WritePointerPlaceholder(TextureReference); // Sampler saveContext.WritePointerPlaceholder(TextureSampler); utility.Write(Commands); utility.Write(CommandsLength); // Seems to be length of the aforementioned "Commands"? ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(TextureReference); saveContext.SaveAndMarkReference(TextureSampler); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); // The 4 UInts here WOULD BE: // Count of Targets // Offset to Targets // Count of Types // Offset to Types utility.Write(Stubs); // ... but just make sure they're all unused for now for (var i = 0; i < 4; i++) { if (Stubs[i] != 0) { throw new NotImplementedException("BlendShape: Trying to fetch data, NOT IMPLEMENTED"); } } }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); // Bone Indices if (BoneReferences != null) { BoneIndices = BoneReferences.Select(b => (uint)b.Index).ToList(); // Rebuild from referenced objects } saveContext.WriteValueListPointerPlaceholder(BoneIndices); // Skinning utility.Write((uint)Skinning); // Faces saveContext.WriteObjectListPointerPlaceholder(Faces); ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(BoneIndices); saveContext.SaveAndMarkReference(Faces); Faces.SaveList(saveContext); }
public override void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); utility.Write(Flags); saveContext.StringTable.EnqueueAndWriteTempRel(Name); utility.Write(MemberType); saveContext.WriteDICTPointerPlaceholder(Elements); utility.Write(BlendOperationTypes.Length); utility.Write(BlendOperationTypes); utility.Write((uint)EvaluationTiming); utility.Write(Unknown); ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(Elements); Elements?.SaveEntries(saveContext); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write((uint)Constant); utility.Write(RawCommands); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); Center.Write(utility); Orientation.Write(utility); Size.Write(utility); utility.Write(Unknown); }
// Intended for simple lists of ints, floats, etc. public void WriteValueListPointerPlaceholder <TVal>(IEnumerable <TVal> values) { CGFXDebug.SaveStart($"HEADER of list of {typeof(TVal).Name} [WriteValueListPointerPlaceholder]", this); // Number of values var length = values?.Count() ?? 0; Utility.Write(length); // Reference the value list WritePointerPlaceholder(values); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(IsPolygonOffsetEnabled ? 1U : 0U); utility.Write((uint)FaceCulling); utility.Write(PolygonOffsetUnit); utility.Write(FaceCullingCommand); }
public virtual void Save(SaveContext saveContext) { CGFXDebug.SaveStart(this, saveContext); var utility = saveContext.Utility; utility.Write(TypeId); saveContext.StringTable.EnqueueAndWriteTempRel(Name); utility.Write((uint)Type); SaveInternal(saveContext); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); saveContext.StringTable.EnqueueAndWriteTempRel(SamplerName); saveContext.StringTable.EnqueueAndWriteTempRel(TableName); saveContext.WritePointerPlaceholder(LUT); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); // Common values... utility.Write(TypeId); utility.Write((uint)AttrName); utility.Write((uint)Type); // If all good, continue the save! SaveInternal(saveContext); }
public virtual void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); utility.WriteMagic(Magic); utility.Write(Revision); saveContext.StringTable.EnqueueAndWriteTempRel(Name); saveContext.WriteDICTPointerPlaceholder(MetaDatas); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); saveContext.WritePointerPlaceholder(Parent); utility.Write((uint)MinFilter); BorderColor.Save(utility); utility.Write(LODBias); }
// List of items, writes pointer reference per item public void SaveAndMarkReference(IEnumerable <ISaveable> items) { var itemNames = (items != null) ? items.Where(i => i != null).Select(i => i.GetType().Name).Distinct().ToList() : new[] { "<null>" }.ToList(); CGFXDebug.SaveStart($"List of {string.Join(", ", itemNames)} [WriteObjectListPointerPlaceholder]", this); SaveAndMarkReference(items, () => { foreach (var item in items) { WritePointerPlaceholder(item); } }); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write((uint)Input); utility.Write((uint)Scale); saveContext.WritePointerPlaceholder(Sampler); ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(Sampler); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); utility.Write(TypeId); saveContext.StringTable.EnqueueAndWriteTempRel(Name); utility.Write(MemberOffset); utility.Write(BlendOpIndex); utility.Write((uint)ObjType); utility.Write(MemberType); utility.Write(MaterialPtr); SaveInternal(saveContext); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); TexEnvBufferColorF.Save(utility); // Fragment Shader utility.Write(FragmentFlags); utility.Write((uint)TranslucencyKind); utility.Write((uint)FresnelSelector); utility.Write((uint)BumpTexture); utility.Write((uint)BumpMode); utility.Write(IsBumpRenormalize ? 1u : 0u); // Fragment Lighting var pointerTableForFragLightLUTs = new[] { ReflectanceRSampler, ReflectanceGSampler, ReflectanceBSampler, Distribution0Sampler, Distribution1Sampler, FresnelSampler }; saveContext.WritePointerPlaceholder(pointerTableForFragLightLUTs); for (var i = 0; i < TextureEnvironments.Length; i++) { TextureEnvironments[i].Save(saveContext); } utility.Write(AlphaTestRawCommands); utility.Write(FragmentShaderRawCommands); ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(pointerTableForFragLightLUTs); pointerTableForFragLightLUTs.SaveList(saveContext); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); saveContext.WriteObjectListPointerPlaceholder(FaceDescriptors); saveContext.WriteValueListPointerPlaceholder(BufferObjs); utility.Write(Flags); utility.Write(CommandAlloc); ///////////////////////////// // Begin saving dependent data saveContext.SaveAndMarkReference(FaceDescriptors); saveContext.SaveAndMarkReference(BufferObjs); FaceDescriptors.SaveList(saveContext); }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); ///////// DEPTH ///////// // See also SPICA GfxFragOp / GfxFragOpDepth utility.Write(DepthFlags); utility.Write(DepthPICACommandsRaw); ///////// BLEND ///////// // See also SPICA GfxFragOp / GfxFragOpBlend utility.Write((uint)BlendMode); BlendColor.Save(utility); utility.Write(BlendPICACommandsRaw); ///////// STENCIL ///////// // See also SPICA GfxFragOp / GfxFragOpStencil utility.Write(StencilOperationRaw); }
// For lists of ISaveable objects public void WriteObjectListPointerPlaceholder(IEnumerable <ISaveable> items) { var itemNames = (items != null) ? items.Where(i => i != null).Select(i => i.GetType().Name).Distinct().ToList() : new[] { "<null>" }.ToList(); CGFXDebug.SaveStart($"HEADER of list of {string.Join(", ", itemNames)} [WriteObjectListPointerPlaceholder]", this); // Number of items var length = items?.Count() ?? 0; Utility.Write(length); if (length > 0) { // Write what will become a pointer to a list of pointers WritePointerPlaceholder(items); } else { // No list made if no items available (ESPECIALLY if it's null) Utility.Write(0u); // Null pointer } }
// This writes the Chunk, calling SaveInternal to write the raw data from superclasses public void Save(SaveContext saveContext) { CGFXDebug.SaveStart(this, saveContext); var utility = saveContext.Utility; // We'll need to patch in the length later, so we need to know where this chunk // is starting now... var chunkStart = utility.GetWritePosition(); utility.WriteMagic(Magic); utility.Write(0U); // Placeholder for chunk length // Write this chunk based on all superclass functionality... SaveInternal(saveContext); // Now we can compute and write out the chunk length var chunkEnd = utility.GetWritePosition(); utility.PushWritePosition(); utility.SetWritePosition(chunkStart + 4); utility.Write(chunkEnd - chunkStart); utility.PopWritePosition(); }
// A shortcut for a list of floats public void SaveAndMarkReference(IEnumerable <float> items) { CGFXDebug.SaveStart("list", this); SaveAndMarkReference(items, () => { Utility.Write(items.ToArray()); }); }