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;
}