コード例 #1
0
            static List <PictureSetPaletteEntry> ReadEntries(Stream stream, PictureExtendedOpcode opcode)
            {
                List <PictureSetPaletteEntry> list = new List <PictureSetPaletteEntry>();

                switch (opcode)
                {
                case PictureExtendedOpcode.SetPaletteEntry:
                    while (PeekContinue(stream))
                    {
                        list.Add(new PictureSetPaletteEntry(ReadByte(stream), ReadByte(stream)));
                    }
                    break;

                case PictureExtendedOpcode.SetPalette:
                    var paletteIndex = ReadByte(stream) * PictureRenderer.EgaDitherPaletteSize;
                    for (var colorIndex = 0; colorIndex < PictureRenderer.EgaDitherPaletteSize; colorIndex++)
                    {
                        list.Add(new PictureSetPaletteEntry((byte)(paletteIndex + colorIndex), ReadByte(stream)));
                    }
                    break;
                }

                return(list);
            }
コード例 #2
0
 /// <summary>Read the instruction.</summary>
 /// <param name="stream"></param>
 /// <param name="opcode"></param>
 public Mono123(Stream stream, PictureExtendedOpcode opcode)
     : base(opcode)
 {
     Unknown = ReadByte(stream);
 }
コード例 #3
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="opcode"></param>
 /// <param name="entries"></param>
 public SetPalette(PictureExtendedOpcode opcode, IEnumerable <PictureSetPaletteEntry> entries) : base(opcode)
 {
     Entries = new List <PictureSetPaletteEntry>(entries);
 }
コード例 #4
0
 /// <summary>Read the instruction.</summary>
 /// <param name="stream"></param>
 /// <param name="opcode"></param>
 public SetPalette(Stream stream, PictureExtendedOpcode opcode) : this(opcode, ReadEntries(stream, opcode))
 {
 }
コード例 #5
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="opcode"></param>
 /// <param name="entries"></param>
 public SetPalette(PictureExtendedOpcode opcode, params PictureSetPaletteEntry[] entries) : this(opcode, (IEnumerable <PictureSetPaletteEntry>)entries)
 {
 }
コード例 #6
0
            static List<PictureSetPaletteEntry> ReadEntries(Stream stream, PictureExtendedOpcode opcode)
            {
                List<PictureSetPaletteEntry> list = new List<PictureSetPaletteEntry>();

                switch (opcode) {
                    case PictureExtendedOpcode.SetPaletteEntry:
                        while (PeekContinue(stream))
                            list.Add(new PictureSetPaletteEntry(ReadByte(stream), ReadByte(stream)));
                        break;

                    case PictureExtendedOpcode.SetPalette:
                        var paletteIndex = ReadByte(stream) * PictureRenderer.EgaDitherPaletteSize;
                        for (var colorIndex = 0; colorIndex < PictureRenderer.EgaDitherPaletteSize; colorIndex++)
                            list.Add(new PictureSetPaletteEntry((byte)(paletteIndex + colorIndex), ReadByte(stream)));
                        break;
                }

                return list;
            }
コード例 #7
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="extendedOpcode"></param>
 public PictureInstruction(PictureExtendedOpcode extendedOpcode)
 {
     Opcode         = PictureOpcode.ExtendedOpcode;
     ExtendedOpcode = extendedOpcode;
 }
コード例 #8
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="extendedOpcode"></param>
 public PictureInstruction(PictureExtendedOpcode extendedOpcode)
 {
     Opcode = PictureOpcode.ExtendedOpcode;
     ExtendedOpcode = extendedOpcode;
 }
コード例 #9
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="opcode"></param>
 /// <param name="entries"></param>
 public SetPalette(PictureExtendedOpcode opcode, IEnumerable<PictureSetPaletteEntry> entries)
     : base(opcode)
 {
     Entries = new List<PictureSetPaletteEntry>(entries);
 }
コード例 #10
0
 /// <summary>Initialise the instruction.</summary>
 /// <param name="opcode"></param>
 /// <param name="entries"></param>
 public SetPalette(PictureExtendedOpcode opcode, params PictureSetPaletteEntry[] entries)
     : this(opcode, (IEnumerable<PictureSetPaletteEntry>)entries)
 {
 }
コード例 #11
0
 /// <summary>Read the instruction.</summary>
 /// <param name="stream"></param>
 /// <param name="opcode"></param>
 public SetPalette(Stream stream, PictureExtendedOpcode opcode)
     : this(opcode, ReadEntries(stream, opcode))
 {
 }
コード例 #12
0
 /// <summary>Read the instruction.</summary>
 /// <param name="stream"></param>
 /// <param name="opcode"></param>
 public Mono123(Stream stream, PictureExtendedOpcode opcode)
     : base(opcode)
 {
     Unknown = ReadByte(stream);
 }