private void AnnotateStructFieldCounts(EngineStruct obj) { int fieldCount = 0; foreach (EngineStruct.Field field in obj.Fields) { field.FieldOffset = fieldCount; if (field.Type is EngineStruct @struct) { field.FieldCount = @struct.CountFields(); } else { field.FieldCount = 1; } fieldCount += field.FieldCount; } }
private void AnnotateStructTypes(EngineStruct obj) { foreach (EngineStruct.Field field in obj.Fields) { if (field.TypeName.StartsWith("ptr_") && field.Name.Equals("array")) { field.Type = ToType(field.TypeName); } else if (field.IndexedSize > 1) { field.Type = ToType("ptr_" + field.TypeName); } else { field.Type = ToType(field.TypeName); } } }