public void GlobalSetupNative() { var palContents = File.ReadAllText(_paletteFileName); _pal = PaletteJsonSerializer.ReadPalette(palContents, new ColorFactory()); _codec = new Snes3bppCodec(8, 8); Setup(_nativeFileName, "native"); }
/// <summary> /// Read a palette from a JSON file /// </summary> /// <param name="paletteFileName">Path to the JSON palette file</param> public Palette ReadJsonPalette(string paletteFileName) { if (!File.Exists(paletteFileName)) { throw new FileNotFoundException($"{nameof(ReadJsonPalette)}: Could not locate file {paletteFileName}"); } string json = File.ReadAllText(paletteFileName); var pal = PaletteJsonSerializer.ReadPalette(json, ColorFactory); return(pal); }
public void GlobalSetupGeneric() { var palContents = File.ReadAllText(_paletteFileName); _pal = PaletteJsonSerializer.ReadPalette(palContents, new ColorFactory()); //var codecFileName = Path.Combine(Directory.GetCurrentDirectory(), "Resources", _genericCodecFileName); var serializer = new XmlGraphicsFormatReader(_codecSchemaFileName); var format = serializer.LoadFromFile(_genericCodecFileName); _codec = new IndexedFlowGraphicsCodec((FlowGraphicsFormat)format.AsSuccess.Result); Setup(_genericFileName, "generic"); }