Esempio n. 1
0
 private void Redraw()
 {
     gBuffer.Clear(BackColor);
     if (!macro.IsEmpty)
     {
         for (int i = 0; i < macro.MacroSize; i++)
         {
             DrawSquare(i, 0, macro.GetMacroByte(i));
         }
     }
 }
Esempio n. 2
0
        private int GetCurrentValue(AdvancedPaletteEditType edit, int ppuMacroIndex, int dataByteIndex)
        {
            var      pointer = Level.PalettePointers[ppuMacroIndex];
            PpuMacro macro   = new PpuMacro();

            if (pointer.IsLevelBank)
            {
                macro = Level.GetPaletteMacro(ppuMacroIndex);
            }

            switch (edit)
            {
            case AdvancedPaletteEditType.DataOffset:
                return(pointer.Value);

                break;

            case AdvancedPaletteEditType.DataDest:
                return(macro.PpuDestination.Value);

                break;

            case AdvancedPaletteEditType.DataSize:
                return(macro.MacroSize);

                break;

            case AdvancedPaletteEditType.MacroDataEdit:
                if (dataByteIndex == -1)
                {
                    throw new InvalidOperationException("AdvancedPaletteEdit.GetCurrentValue: edit type was MacroDataEdit, but a macro byte index was not specified.");
                }

                return(macro.GetMacroByte(dataByteIndex));

            default:
                throw new ArgumentException("AdvancedPaletteEdit.GetCurrentValue: Invalid edit type.");
            }
        }