The image file I'm using is a 32x32 PNG with a 16 colour indexed palette created with Photoshop. The grit switch file I'm using is
Code: Select all
# Set the warning/log level to 3
-W3
# Tell grit to include a palette (the first index in it will be transparent)
-p
# Tile the image
-gt
# Set the bit depth to 4 (16 colors)
-gB4
However when I tried copying the following array
Code: Select all
uint16 spherePalRed[16] = { 0, RGB15(29,0,0), RGB15(27,0,0), RGB15(25,0,0),
RGB15(23,0,0), RGB15(21,0,0), RGB15(19,0,0), RGB15(17,0,0),
RGB15(15,0,0), RGB15(13,0,0), RGB15(11,0,0), RGB15(9,0,0),
RGB15(7,0,0), RGB15(5,0,0), RGB15(3,0,0), RGB15(31,0,0) };
Code: Select all
dmaCopyHalfWords(SPRITE_DMA_CHANNEL,
&spherePalRed,
&SPRITE_PALETTE[nextAvailableSpriteNum * COLORS_PER_PALETTE],
COLORS_PER_PALETTE);
I assumed the palette created would have 16 colours but when I looked at the header file it creates, the palette is 256, not 16
Code: Select all
// sphereWhite, 32x32@4,
// + palette 256 entries, not compressed
// + 16 tiles not compressed
// Total size: 512 + 512 = 1024