Get palette index of a sprite pixel
Posted: Sun Apr 19, 2009 2:08 am
Hi, I'm trying to get palette index of a sprite. SpriteMapping_1D_128 means sprite are saved in "squares" of 8x8 pixels each one. I have a pointer to the sprite allocation in Vram. If I want to get palette index for pixel (1,9) (first row, column nine), i must get it using pointer[64] isn't i?? (Is the element 65, but array index begins at 0 )
I don't know i am mistaken. Can somebody help me??
If this is correct, I have a second problem. In animated simple sprite example, sprite information is stored in a u16 collection of data, but this data is copied to Vram using a u8 pointer. If palette made of 256 colors, i need a u8 type to save a number between 0 and 255. Why in that example take tiles of sprite with a u16 (for 0 to 256 palette index) and after that copy it using a u8 pointer?. Thanks
I don't know i am mistaken. Can somebody help me??
If this is correct, I have a second problem. In animated simple sprite example, sprite information is stored in a u16 collection of data, but this data is copied to Vram using a u8 pointer. If palette made of 256 colors, i need a u8 type to save a number between 0 and 255. Why in that example take tiles of sprite with a u16 (for 0 to 256 palette index) and after that copy it using a u8 pointer?. Thanks