public LureConfig() { cpath = Path.GetDirectoryName(Application.ExecutablePath); conf.Load(cpath+"/vlure.xml"); palettes.Add(new LurePalette(null,0)); foreach (XmlNode nd in conf.DocumentElement.ChildNodes) if (nd.NodeType==XmlNodeType.Element) { if (nd.Name=="path") lpath=nd.ChildNodes[0].Value; if (nd.Name == "files") { fileConf=nd; foreach (XmlNode nn in nd.ChildNodes) if (nn.NodeType == XmlNodeType.Element && nn.Name == "file") { LureFile lf = new LureFile(nn); files.Add(lf); if (lf.type == "text_decode_table") decode_tbl = lf.id; if (lf.type == "names") names = lf.id; } } if (nd.Name == "ruchars") txtConf = nd; } }
public LurePalette(LureFile f, int id) { if (f == null) { name = "GRAYSCALE"; for (int i = 0; i < 256; i++) { cols[i] = Color.FromArgb(i, i, i); } file = null; } else { palette_id = id; file = f; name = f.node.Attributes["name"].Value + (id == 0?"":"[" + id.ToString() + "]"); int ncol = (f.data.Length / 3); int psize = 64 * 3; if (id != 0) { id -= 1; ncol = 64; } for (int i = 0; i < 256; i++) { if (i >= ncol) { cols[i] = Color.Black; } else { byte r = f.data[i * 3 + id * psize]; byte g = f.data[i * 3 + 1 + id * psize]; byte b = f.data[i * 3 + 2 + id * psize]; r = (byte)((r << 2) + (r >> 4)); g = (byte)((g << 2) + (g >> 4)); b = (byte)((b << 2) + (b >> 4)); cols[i] = Color.FromArgb(r, g, b); } } } }
public LureConfig() { cpath = Path.GetDirectoryName(Application.ExecutablePath); conf.Load(cpath + "/vlure.xml"); palettes.Add(new LurePalette(null, 0)); foreach (XmlNode nd in conf.DocumentElement.ChildNodes) { if (nd.NodeType == XmlNodeType.Element) { if (nd.Name == "path") { lpath = nd.ChildNodes[0].Value; } if (nd.Name == "files") { fileConf = nd; foreach (XmlNode nn in nd.ChildNodes) { if (nn.NodeType == XmlNodeType.Element && nn.Name == "file") { LureFile lf = new LureFile(nn); files.Add(lf); if (lf.type == "text_decode_table") { decode_tbl = lf.id; } if (lf.type == "names") { names = lf.id; } } } } if (nd.Name == "ruchars") { txtConf = nd; } } } }
public LurePalette(LureFile f,int id) { if (f == null) { name = "GRAYSCALE"; for (int i = 0; i < 256; i++) cols[i] = Color.FromArgb(i, i, i); file = null; } else { palette_id = id; file = f; name=f.node.Attributes["name"].Value+(id==0?"":"["+id.ToString()+"]"); int ncol = (f.data.Length / 3); int psize=64*3; if (id != 0) { id -= 1; ncol = 64; } for (int i = 0; i < 256; i++) { if (i >= ncol) cols[i] = Color.Black; else { byte r = f.data[i * 3+id*psize]; byte g = f.data[i * 3 + 1 + id * psize]; byte b = f.data[i * 3 + 2 + id * psize]; r = (byte)((r << 2) + (r >> 4)); g = (byte)((g << 2) + (g >> 4)); b = (byte)((b << 2) + (b >> 4)); cols[i] = Color.FromArgb(r, g, b); } } } }