#92410 - nukomod - Thu Jul 13, 2006 12:56 pm
Hi, I started to play with tile background layers last night but already I'm having trouble :( I followed the tutorial at (http://www.dspassme.com/programmers_guide/tutorial/using_tiles.html) and I'm storing the location of the tile graphics as a u16* called m_tile. I created a pallete where all the colours are black, except for 1 which is pink and 2 which is yellow.
Now I'm trying to draw on to the tile graphics in code. Starting with the first tile I'm trying to set the palette of the first pixel by calling:
This didn't work and I reasoned its because each pixel is only 8bits in 256 colour mode. However when I changed the m_tile pointer to u8* I couldn't get it to work at all :( If I tried the below it had better results:
This seemed to work okay, I could set the palette entries of both pixels fine, except it displayed them the other way round to what I expected! (Yellow (2) then Pink (1) :( So the first two bytes are for the second pixel, and the second two bytes are for the first pixel.. I'm sure I'm missing something here... any help?
Sorry if I haven't described it properly or if its answered elsewhere.[/code]
Now I'm trying to draw on to the tile graphics in code. Starting with the first tile I'm trying to set the palette of the first pixel by calling:
Code: |
m_tile[0] = 1; //1 is a pink colour in the palette. |
This didn't work and I reasoned its because each pixel is only 8bits in 256 colour mode. However when I changed the m_tile pointer to u8* I couldn't get it to work at all :( If I tried the below it had better results:
Code: |
m_tile[0] = 0x0002 + 0x0100; //2 is a yellow colour. |
This seemed to work okay, I could set the palette entries of both pixels fine, except it displayed them the other way round to what I expected! (Yellow (2) then Pink (1) :( So the first two bytes are for the second pixel, and the second two bytes are for the first pixel.. I'm sure I'm missing something here... any help?
Sorry if I haven't described it properly or if its answered elsewhere.[/code]