#135698 - ghuldan - Wed Jul 25, 2007 5:43 pm
I got a small C problem here, using palib, when i do this, it works perfectly :
But when i do this :
Then i got a black background.
For the last line i dispairedly tried many things :
PA_LoadSimpleBg(0, 3, bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, &bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, &bg.tileData[0], map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, (void*)bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, (s32*)bg.tileData, map, BG_512X512, 0, 1);
I think there is something i did not understand at all ... help plz
Code: |
const unsigned char tilesData[...] = { ... };
const short map[...] = { ... }; PA_LoadPal(PAL_BG0, ...); PA_LoadSimpleBg(0, 3, tilesData, map, BG_512X512, 0, 1); |
But when i do this :
Code: |
typedef struct bg_struct {
const unsigned char *tileData; const short *mapData; } bg_struct; const unsigned char tiles[...] = { ... }; const short map[...] = { ... }; bg_struct bg; bg.tileData = tiles; bg.mapData = map; [u]//here i can printf "bg.tileData" or "bg.mapData" : it is well filled[/u] PA_LoadPal(PAL_BG0, ...); PA_LoadSimpleBg(0, 3, bg.tileData, bg.mapData, BG_512X512, 0, 1); |
Then i got a black background.
For the last line i dispairedly tried many things :
PA_LoadSimpleBg(0, 3, bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, &bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, &bg.tileData[0], map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, (void*)bg.tileData, map, BG_512X512, 0, 1);
PA_LoadSimpleBg(0, 3, (s32*)bg.tileData, map, BG_512X512, 0, 1);
I think there is something i did not understand at all ... help plz