public void LoadDefault() { byte[] graphicsData = Resource.default_graphics; int dataPointer = 0; GraphicsBanks.Clear(); for (int i = 0; i < 256; i++) { GraphicsBank nextBank = new GraphicsBank(); for (int j = 0; j < 64; j++) { byte[] nextTileChunk = new byte[16]; for (int k = 0; k < 16; k++) nextTileChunk[k] = graphicsData[dataPointer++]; nextBank[j] = new Tile(nextTileChunk); } GraphicsBanks.Add(nextBank); } XDocument xDoc = XDocument.Parse(Resource.default_graphics_names); foreach (var e in xDoc.Element("graphicsinfo").Elements("graphics")) { GraphicsInfo gi = new GraphicsInfo(); gi.LoadFromElement(e); GraphicsInfo.Add(gi); } }
public void LoadDefault() { byte[] graphicsData = Resource.default_graphics; int dataPointer = 0; GraphicsBanks.Clear(); for (int i = 0; i < 256; i++) { GraphicsBank nextBank = new GraphicsBank(); for (int j = 0; j < 64; j++) { byte[] nextTileChunk = new byte[16]; for (int k = 0; k < 16; k++) { nextTileChunk[k] = graphicsData[dataPointer++]; } nextBank[j] = new Tile(nextTileChunk); } GraphicsBanks.Add(nextBank); } XDocument xDoc = XDocument.Parse(Resource.default_graphics_names); foreach (var e in xDoc.Element("graphicsinfo").Elements("graphics")) { GraphicsInfo gi = new GraphicsInfo(); gi.LoadFromElement(e); GraphicsInfo.Add(gi); } }
private void UpdateGraphicsNames(GraphicsInfo gi) { bool reselect = false; int index = 0; index = CmbGraphics1.Items.IndexOf(gi); reselect = CmbGraphics1.SelectedIndex == index; CmbGraphics1.Items.RemoveAt(index); CmbGraphics1.Items.Insert(index, gi); if (reselect) CmbGraphics1.SelectedIndex = index; index = CmbGraphics2.Items.IndexOf(gi); reselect = CmbGraphics2.SelectedIndex == index; CmbGraphics2.Items.RemoveAt(index); CmbGraphics2.Items.Insert(index, gi); if (reselect) CmbGraphics2.SelectedIndex = index; index = CmbGraphics3.Items.IndexOf(gi); reselect = CmbGraphics3.SelectedIndex == index; CmbGraphics3.Items.RemoveAt(index); CmbGraphics3.Items.Insert(index, gi); if (reselect) CmbGraphics3.SelectedIndex = index; index = CmbGraphics4.Items.IndexOf(gi); reselect = CmbGraphics4.SelectedIndex == index; CmbGraphics4.Items.RemoveAt(index); CmbGraphics4.Items.Insert(index, gi); if (reselect) CmbGraphics4.SelectedIndex = index; }