public ImageRenderer( StructTable<string, ImageDescriptor> imageDescriptors, Images images, SpriteBatch spriteBatch) { _imageDescriptors = imageDescriptors; _images = images; _spriteBatch = spriteBatch; }
private static void ProcessStruct(DataExporterFlags flags, Type t) { foreach (var file in flags.Paths) { var structTable = new StructTable(File.ReadAllBytes(file)); var ft = Path.ChangeExtension(file, ".json"); var Entries = structTable.Cast(t); File.WriteAllText(ft, JsonConvert.SerializeObject(new { t.FullName, Entries }, Formatting.Indented, new StringEnumConverter())); Logger.Info("Struct", ft); } }
public void AddDeclarations(IEnumerable <Declaration> aDeclarations) { foreach (var decl in aDeclarations) { if (DeclarationsToIgnore.Contains(decl.Name)) { continue; } //== "sp_uint64" || decl.Name == "bool" || decl.Name == "byte") continue; if (decl.Kind == "typedef") { StructCType structType = decl.CType as StructCType; EnumCType enumType = decl.CType as EnumCType; FunctionCType functionType = decl.CType as FunctionCType; if (structType != null) { if (structType.Fields == null) { HandleTable.Add(decl.Name); } else { StructTable.Add(decl.Name, structType); } } else if (enumType != null) { EnumTable.Add(decl.Name, enumType); } else if (functionType != null) { FunctionTypedefTable.Add(decl.Name, functionType); } } else if (decl.Kind == "instance") { FunctionCType funcType = decl.CType as FunctionCType; if (funcType == null) { continue; } FunctionTable.Add(decl.Name, funcType); } } }
public Images(GraphicsDevice graphicsDevice, StructTable<string,Color> colorTable, StructTable<string,Pattern> patternTable) { _graphicsDevice = graphicsDevice; _colorTable = colorTable; _patternTable = patternTable; }