#138866 - ghuldan - Thu Aug 30, 2007 1:05 am
hi
What's the format of 16 bits sprite colors ?
I try to convert my 256 colors palette sprite to 16 bits sprite using the same ressources (i.e indexed gfx with a palette), but when i try to fill my gfx with my old color palette, it does not seem to work (sprite is transparent).
But if i fill it with a color i pick from PAGfx it works.
by now i use this to create a color :
#define RGB(r, g, b) ( ( (b) << 10 ) + ( (g) << 5 ) + (r) )
ex : color = RGB(31,31,31); (for white color)
it does not work
it does work
Can someone help plz ?
What's the format of 16 bits sprite colors ?
I try to convert my 256 colors palette sprite to 16 bits sprite using the same ressources (i.e indexed gfx with a palette), but when i try to fill my gfx with my old color palette, it does not seem to work (sprite is transparent).
But if i fill it with a color i pick from PAGfx it works.
by now i use this to create a color :
#define RGB(r, g, b) ( ( (b) << 10 ) + ( (g) << 5 ) + (r) )
ex : color = RGB(31,31,31); (for white color)
Code: |
unsigned short *gfx = malloc(sizeof(unsigned short) * 32 * 32);
for (i = 0; i < 32 * 32; i++) gfx[i] = RGB(31,31,31); PA_Create16bitSprite (..., ..., (void*)gfx, OBJ_SIZE_32X32, ..., ...); |
it does not work
Code: |
unsigned short *gfx = malloc(sizeof(unsigned short) * 32 * 32);
for (i = 0; i < 32 * 32; i++) gfx[i] = 33791; /*picked from a 16 bits sprite created by PAGfx*/ PA_Create16bitSprite (..., ..., (void*)gfx, OBJ_SIZE_32X32, ..., ...); |
it does work
Can someone help plz ?