|
@@ -4,6 +4,7 @@ Type=Function
|
|
|
Subtype=tigcc.a
|
|
|
Header Files=sprites.h
|
|
|
Definition=void Sprite8 (short x, short y, short height, const unsigned char *sprite, void *vm_addr, short mode);
|
|
|
+See Also=sprites.h/ClipSprite8
|
|
|
|
|
|
[Library Call]
|
|
|
Asm=1
|
|
@@ -20,10 +21,11 @@ mode=d3
|
|
|
Draws a sprite with a width of 8 pixels or less on the screen.
|
|
|
|
|
|
[Explanation]
|
|
|
-Sprite8 draws a sprite with a width of 8 pixels or less on the screen.
|
|
|
-Use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A> or <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> for wider sprites.
|
|
|
-This routine is many times faster than TIOS routines like
|
|
|
-<A HREF="$$LINK(graph.h/DrawIcon)">DrawIcon</A>, <A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A>, etc.
|
|
|
+Sprite8 draws a sprite with a width of 8 pixels or less on the screen. See <A HREF="$$LINK(sprites.h/ClipSprite8)">ClipSprite8</A>
|
|
|
+for a version that handles out-of-screen sprites gracefully, and <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>, <A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>,
|
|
|
+<A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> or <A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A> for wider sprites.
|
|
|
+This routine is much faster than TIOS routines such as <A HREF="$$LINK(graph.h/DrawIcon)">DrawIcon</A>,
|
|
|
+<A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A>, etc.
|
|
|
<I>x</I> and <I>y</I> are the coordinates of the upper left corner of the sprite.
|
|
|
<I>height</I> is the height of the sprite. <I>sprite</I> is a pointer to the array of
|
|
|
unsigned characters which define the shape of the sprite (line by line). <I>vm_addr</I> is the pointer
|
|
@@ -83,11 +85,15 @@ Here the sprite mask is <CODE>{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}</
|
|
|
be inverted before passing it to the Sprite8 function. For this purpose, the operator '~' may be
|
|
|
very useful. Note that '~' is "bitwise NOT". Of course, ~0xFF is the same as 0x00, but this notation
|
|
|
makes the program more clear (and it does not increase the code size, because the inverting will
|
|
|
-be performed at compilation time). And if you want to use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A> or
|
|
|
-<A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>, the notation ~0xFF will still be valid in a short int array, or in a long int array
|
|
|
-if you add the <B>'L'</B> suffix (see the respective info about <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>).
|
|
|
-Without this notation, you must use 0x00 in Sprite8, but 0xFF00 in <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>, and
|
|
|
-0xFFFFFF00 in <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>. This is why a notation like ~0xFF is more universal.
|
|
|
+be performed at compilation time). And if you want to use <A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>,
|
|
|
+<A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>, <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> or
|
|
|
+<A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>, the notation ~0xFF will still be valid in a short int
|
|
|
+array, or in a long int array if you add the <B>'L'</B> suffix (see the respective info about
|
|
|
+<A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A> and <A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>).
|
|
|
+Without this notation, you must use 0x00 in Sprite8, but 0xFF00 in
|
|
|
+<A HREF="$$LINK(sprites.h/Sprite16)">Sprite16</A>/<A HREF="$$LINK(sprites.h/ClipSprite16)">ClipSprite16</A>, and
|
|
|
+0xFFFFFF00 in <A HREF="$$LINK(sprites.h/Sprite32)">Sprite32</A>/<A HREF="$$LINK(sprites.h/ClipSprite32)">ClipSprite32</A>.
|
|
|
+This is why a notation like ~0xFF is more universal.
|
|
|
<BR><BR>
|
|
|
Starting from TIGCC v0.91, you can use binary numbers to define your sprites. On the one hand,
|
|
|
it makes the program incompatible with other C dialects as well as previous (ancient) versions of
|