123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- [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 <A HREF="$$LINK(sprites.h/Sprite8)">Sprite8</A>, but it takes sprites with a width of 32 pixels.
- <I>sprite</I> 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
- <PRE>static const unsigned long sprite[] = {...};
- </PRE>
- <B>Note:</B> 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 <B>'L'</B> (long) suffix to the end of the value.
- <BR><BR>
- 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 <CODE>graphlib::put_sprite</CODE> (see <A HREF="$$INFOLINK(faq)">Frequently Asked Questions</A>
- 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:
- <UL>
- <LI>
- If you don't need too fast action, the built-in TIOS function <A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A> may be good enough.
- </LI>
- <LI>
- If you need a very fast sprite routine for very large sprites, then you must write it yourself, or use prewritten ones in
- ExtGraph or Genlib.
- </LI>
- </UL>
- <BR><BR>
- See <A HREF="$$LINK(sprites.h/Sprite8)">Sprite8</A> for more info about sprites, and
- <A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A> for a version that handles out-of-screen sprites gracefully.
|