Al_Bro wrote:As far as the colours not taking - are you sure you have set up your palette memory correctly?
I think all is correct. If I only declare an array for the sprite and another one for pallette all works. But if i declare another array, the sprite is showed bad. Some colors disapears. And I only do this:
Code: Select all
u16 palette2;
palette2 = new u16[256];
Then, the first sprite doesn't show all colors. But more strange is that if i restart DS, sometimes it works. It happens randomly. After that i decided to save in a txt file the information of palette and tiles. To do that i have to cross the two arrays, and i discover it works well when i do that. I am desperated. For more information, I load the sprite with an u8 array and this algorithm:
Code: Select all
for (i=0;i<(image.width*image.height);i++){
index = take_tile_position(i);
fread(&tile[index],sizeof(u8),1, file);
}
Image is stored linearly, and tile is stored in blocks 8x8 pixels, so
take_tile_position returns the index position of
i in the tile. I could read 8 bytes instead 1 and increment
i by 8, but it works worst. tile is an array created using operator
new in other function and passed as u8*.