#117678 - neilio - Tue Feb 06, 2007 3:32 pm
I'm trying to follow the Pern Project guide on loading sprites into object graphics memory and I don't quite get the way in which it's loaded..
We're copying in data for a 64 x 64 sprite in 256 colour (that much I know), and I kind of get why we're multiplying the sprite by 16. I'm guessing that the 64 * 64 in the For definition are because we're working with a 64 x 64 sprite, but I don't get the division by 2. Is this division related to using shorts in the sprite data?
I know this is a pretty newb question but any help is appreciated![/quote]
_________________
I'd like to think this signature is under development, but it isn't.
Quote: | ||
... The last thing we do is copy in our sprite graphics and palette. OBJ_GFXMem is defined in gba.h as 0x06010000. We then offset that address the correct number of sprite characters by multiplying the starting character by 16 (each character is based on an 8x8 16 color character, this is 64 pixels at 4 bits apiece for 32 bytes, or 16 shorts which is the type of our arrays). In our case the gfxID is 0 so this is not needed but when we do more sprites this will become very important. |
We're copying in data for a 64 x 64 sprite in 256 colour (that much I know), and I kind of get why we're multiplying the sprite by 16. I'm guessing that the 64 * 64 in the For definition are because we're working with a 64 x 64 sprite, but I don't get the division by 2. Is this division related to using shorts in the sprite data?
I know this is a pretty newb question but any help is appreciated![/quote]
_________________
I'd like to think this signature is under development, but it isn't.