[Main] Name=Sprite32 Type=Function Subtype=tigcc.a Header Files=sprites.h Definition=void Sprite32 (short x, short y, short height, const unsigned long *sprite, void *vm_addr, short mode); Real Definition=extern void Sprite32(short asm("d0"),short asm("d1"),short asm("d2"),__cpulong asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; See Also=sprites.h/ClipSprite32 [Library Call] Asm=1 [Registers] x=d0 y=d1 height=d2 sprite=a0 vm_addr=a1 mode=d3 [Description] Draws a sprite with a width of 32 pixels or less on the screen. [Explanation] Sprite32 works exactly like Sprite8, but it takes sprites with a width of 32 pixels. sprite is now a pointer to the array of unsigned long integers which defines the sprite. So, to define a sprite (or sprite mask), use something like
static const unsigned long sprite[] = {...};
Note: If you define a sprite mask and invert it with the '~' operator, you need to take care of the possibility of the first two bytes being zero in one constant. In this case, the constant will be assumed to be a 16 bit value, so only 16 bits will be inverted. Then the constant is promoted to an unsigned long integer, and the first 16 bits are still zero as if they actually belonged to the mask. To take care of this problem, add the 'L' (long) suffix to the end of the value.

If you want to use sprites wider than 32 pixels (which is not very likely), one solution is to use a "kernel"-based program and graphlib::put_sprite (see Frequently Asked Questions for more info about how to do it). If you don't want to use kernel-based programs, the proposed method depends on what the use of the sprite will be:

See Sprite8 for more info about sprites, and ClipSprite32 for a version that handles out-of-screen sprites gracefully.