public void AddNewPalette(string name)
 {
     PaletteInfo pi = new PaletteInfo();
     pi.Guid = Guid.NewGuid();
     pi.Name = name;
     Palettes.Add(pi);
     paletteLookup.Add(pi.Guid, pi);
     if (PaletteAdded != null) PaletteAdded(this, new TEventArgs<PaletteInfo>(pi));
 }
 public void RemovePalette(PaletteInfo pi)
 {
     Palettes.Remove(pi);
     paletteLookup.Remove(pi.Guid);
     if (PaletteRemoved != null)
     {
         PaletteRemoved(this, new TEventArgs <PaletteInfo>(pi));
     }
 }
        public void LoadDefaultSpecials()
        {
            XDocument xDoc = XDocument.Parse(Resource.special_definitions);
            XElement  root = xDoc.Element("specials");

            SpecialPalette = new PaletteInfo();
            SpecialPalette.LoadFromElement(root.Element("palette"));
            SpecialPalette.IsSpecial = true;
        }
        public void AddNewPalette(string name)
        {
            PaletteInfo pi = new PaletteInfo();

            pi.Guid = Guid.NewGuid();
            pi.Name = name;
            Palettes.Add(pi);
            paletteLookup.Add(pi.Guid, pi);
            if (PaletteAdded != null)
            {
                PaletteAdded(this, new TEventArgs <PaletteInfo>(pi));
            }
        }
 public bool LoadFromElement(XElement e)
 {
     Palettes.Clear();
     paletteLookup.Clear();
     foreach (var p in e.Elements("palette"))
     {
         PaletteInfo pi = new PaletteInfo();
         pi.LoadFromElement(p);
         Palettes.Add(pi);
         paletteLookup.Add(pi.Guid, pi);
     }
     return(true);
 }
        public void AddNewPalette(string name, byte[] paletteData)
        {
            PaletteInfo pi = new PaletteInfo();
            pi.Guid = Guid.NewGuid();
            pi.Name = name;
            Palettes.Add(pi);

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    pi[i, j] = paletteData[ (i * 4) + j];
                }
            }

            paletteLookup.Add(pi.Guid, pi);
            if (PaletteAdded != null) PaletteAdded(this, new TEventArgs<PaletteInfo>(pi));
        }
        public void AddNewPalette(string name, byte[] paletteData)
        {
            PaletteInfo pi = new PaletteInfo();

            pi.Guid = Guid.NewGuid();
            pi.Name = name;
            Palettes.Add(pi);

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    pi[i, j] = paletteData[(i * 4) + j];
                }
            }

            paletteLookup.Add(pi.Guid, pi);
            if (PaletteAdded != null)
            {
                PaletteAdded(this, new TEventArgs <PaletteInfo>(pi));
            }
        }
 public SpecialManager()
 {
     SpecialPalette = new PaletteInfo();
     SpecialBanks = new List<GraphicsBank>();
 }
        public void LoadDefaultSpecials()
        {
            XDocument xDoc = XDocument.Parse(Resource.special_definitions);
            XElement root = xDoc.Element("specials");

            SpecialPalette = new PaletteInfo();
            SpecialPalette.LoadFromElement(root.Element("palette"));
            SpecialPalette.IsSpecial = true;
        }
Exemple #10
0
        private void CmbPalettes_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CurrentPalette != null)
            {
                CurrentPalette.PaletteChanged -= CurrentPalette_PaletteChanged;
            }

            CurrentPalette = CmbPalettes.SelectedItem as PaletteInfo;
            CurrentPalette.PaletteChanged += new EventHandler<TEventArgs<DoubleValue<int, int>>>(CurrentPalette_PaletteChanged);
            WldView.CurrentPalette = CurrentPalette;
            BlsSelector.CurrentPalette = CurrentPalette;
            BlvRight.CurrentPalette = BlvLeft.CurrentPalette = CurrentPalette;

            foreach (var sv in SpriteViewers)
            {
                sv.CurrentPalette = CurrentPalette;
            }
        }
Exemple #11
0
 public void SwitchObjects(PatternTable table, BlockDefinition definition, PaletteInfo palette)
 {
     BlsSelector.HaltRendering = true;
     BlsSelector.CurrentTable = table;
     BlsSelector.CurrentDefiniton = definition;
     BlsSelector.HaltRendering = false;
     BlsSelector.CurrentPalette = palette;
 }
 public void RemovePalette(PaletteInfo pi)
 {
     Palettes.Remove(pi);
     paletteLookup.Remove(pi.Guid);
     if (PaletteRemoved != null) PaletteRemoved(this, new TEventArgs<PaletteInfo>(pi));
 }
 public bool LoadFromElement(XElement e)
 {
     Palettes.Clear();
     paletteLookup.Clear();
     foreach (var p in e.Elements("palette"))
     {
         PaletteInfo pi = new PaletteInfo();
         pi.LoadFromElement(p);
         Palettes.Add(pi);
         paletteLookup.Add(pi.Guid, pi);
     }
     return true;
 }
 public SpecialManager()
 {
     SpecialPalette = new PaletteInfo();
     SpecialBanks   = new List <GraphicsBank>();
 }