#79262 - Dark Knight ez - Wed Apr 12, 2006 3:31 pm
Hey everybody. Yet another question. This time concerning sprites.
I've been checking out several tutorials/examples which use sprites, but they do not give enough information for me to fully comprehend it all. Why some specific values are used, amongst other things.
Using Patater's guide, the sprite initializing (palette and graphics) seems to crash (or at least stay stuck therein for a VERY long time - didn't have the patience to check).
To be more precise, this seems to happen in the for-loop which addresses SPRITE_GFX_SUB. (Note that I used '0' as gfxID in the code by commenting that piece out.)
Now, my question is, why is there in the for-loop a 16(!) bit-shift to the left and if that's not the fault here, what else could it be?
Oh, one remark which might affect things:
The graphics I'm using (font_8x8_digits_bin) was actually a 88*8 picture. Would I be right in assuming that once that's loaded in properly, I could just pick out the x-th tile by using x as gfxID? (The picture contains all the digits and a ':' symbol in a row.)
Thanks in advance for any help.
I've been checking out several tutorials/examples which use sprites, but they do not give enough information for me to fully comprehend it all. Why some specific values are used, amongst other things.
Using Patater's guide, the sprite initializing (palette and graphics) seems to crash (or at least stay stuck therein for a VERY long time - didn't have the patience to check).
To be more precise, this seems to happen in the for-loop which addresses SPRITE_GFX_SUB. (Note that I used '0' as gfxID in the code by commenting that piece out.)
Code: |
//copy in the sprite palettes
dmaCopy(sprite_pal_bin, (uint16 *)SPRITE_PALETTE_SUB, sprite_pal_bin_size); //size of data to copy //copy the sprite grahics in obj graphics mem for(unsigned int i=0; i<font_8x8_digits_bin_size << 16; i++) SPRITE_GFX_SUB[/*font_8x8_gfxID * 16 +*/ i] = ((uint16*)font_8x8_digits_bin)[i]; |
Now, my question is, why is there in the for-loop a 16(!) bit-shift to the left and if that's not the fault here, what else could it be?
Oh, one remark which might affect things:
The graphics I'm using (font_8x8_digits_bin) was actually a 88*8 picture. Would I be right in assuming that once that's loaded in properly, I could just pick out the x-th tile by using x as gfxID? (The picture contains all the digits and a ':' symbol in a row.)
Thanks in advance for any help.