Tricks and Techniques

Sparse Sprites
The buf in a bitmap entry may be NULL, indicating that nothing should be drawn. This area will be 100% transparent.

Early-Ending Sprites
Setting the width of a bitmap entry to zero (0) signals an early exit to drawing the sprite’s bitmaps.

Variable Size Bitmaps
Each bitmap can have a different drawn “width” and the corresponding texture can have a different width_img. To vary the vertical size of a sprite, set the actual_height field. If this is bigger than the sprite’s bmHeightReal, then this actual_height is used for loading TMEM.

Explosions
Each sprite can specify the spacing between tiles in pixels by setting the explx and exply fields. The default value is zero (0). This spacing is not affected by the scaling of the sprite.

Bitmap Re-use
If the buf of the current bitmap matches the buf of the previous bitmap (not counting NULL bufs) in this sprite, then TMEM will not be re-loaded. This very simple form of texture caching is used in the font example.

Sprite Re-use
Each sprite has an associated display list and an associated next_dl pointer. When spDraw is called, new display list entries are added to the area pointed at by next_dl. This doesn’t have to correspond to the pre-allocated display list allocated for the sprite; it could point somewhere else.

This allows a sprite to get drawn multiple times, each with a different setting of some parameters (position, scale, color, solid/textured, and so on). Sufficient display list area must be allocated for this to operate correctly.

Copyright © 1999 Nintendo of America Inc. All Rights Reserved Nintendo and N64 are registered trademarks of Nintendo Last Updated January, 1999