still debugging, give us the ability to offset the pixel value by an arbitrary palette selector value

This commit is contained in:
Michael Becker 2020-03-23 01:36:14 -04:00
parent 779877a5bb
commit d31ccfafa1
No known key found for this signature in database
GPG Key ID: 389DFF5D73781A12

View File

@ -134,6 +134,8 @@ namespace UniversalEditor.Plugins.ChaosWorks.DataFormats.Multimedia.PictureColle
// now that we've loaded the frame definitions and embedded color palette,
// we can go back and read the pixel data
List<List<byte>> lists = new List<List<byte>>();
int paletteSelector = 0;
for (uint i = 0; i < frameCount; i++)
{
int x = 0, y = 0;
@ -169,11 +171,11 @@ namespace UniversalEditor.Plugins.ChaosWorks.DataFormats.Multimedia.PictureColle
size_count = (ushort)(-(short)size_count);
byte index = br.ReadByte();
Color color = palette.Entries[index].Color;
Color color = palette.Entries[paletteSelector + index].Color;
for (int k = 0; k < size_count; k++)
{
Console.WriteLine("cwe-sprite: setting pixel ({0}, {1}) to color {2}", x, y, color);
// Console.WriteLine("cwe-sprite: setting pixel ({0}, {1}) to color {2}", x, y, color);
pic.SetPixel(color, y, x);
y++;
}
@ -183,9 +185,9 @@ namespace UniversalEditor.Plugins.ChaosWorks.DataFormats.Multimedia.PictureColle
for (int k = 0; k < size_count; k++)
{
byte index = br.ReadByte();
Color color = palette.Entries[index].Color;
Color color = palette.Entries[paletteSelector + index].Color;
Console.WriteLine("cwe-sprite: setting pixel ({0}, {1}) to color {2}", x, y, color);
// Console.WriteLine("cwe-sprite: setting pixel ({0}, {1}) to color {2}", x, y, color);
pic.SetPixel(color, y, x);
y++;
}