Alexandria.Engines.Sciagi.Resources.PictureInstruction.SetPalette.ReadEntries C# (CSharp) Метод

ReadEntries() статический приватный Метод

static private ReadEntries ( Stream stream, PictureExtendedOpcode opcode ) : List
stream Stream
opcode PictureExtendedOpcode
Результат List
            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;
            }
PictureInstruction.SetPalette