Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 public void RemovePalette(PaletteInfo pi)
 {
     Palettes.Remove(pi);
     paletteLookup.Remove(pi.Guid);
     if (PaletteRemoved != null)
     {
         PaletteRemoved(this, new TEventArgs <PaletteInfo>(pi));
     }
 }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        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));
            }
        }
Exemplo n.º 8
0
 public SpecialManager()
 {
     SpecialPalette = new PaletteInfo();
     SpecialBanks = new List<GraphicsBank>();
 }
Exemplo n.º 9
0
        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;
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
 }
Exemplo n.º 12
0
 public void RemovePalette(PaletteInfo pi)
 {
     Palettes.Remove(pi);
     paletteLookup.Remove(pi.Guid);
     if (PaletteRemoved != null) PaletteRemoved(this, new TEventArgs<PaletteInfo>(pi));
 }
Exemplo n.º 13
0
 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;
 }
Exemplo n.º 14
0
 public SpecialManager()
 {
     SpecialPalette = new PaletteInfo();
     SpecialBanks   = new List <GraphicsBank>();
 }