N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

spIntro

Introduction
This page is an introduction to all the sprite manipulation functions.

The sp.h file holds the data structure type definitions, symbolic attribute names, and function prototypes. The data structures used by the sprite library are described in detail in the Sprites chapter of the N64 Programming Manual. Attributes are listed and described in the spSetAttribute and spClearAttribute function pages and where appropriate in other pages.

Sprite Manipulation Functions
  • spInit is called at the beginning of sprite drawing. Some GBI display list commands are added to the specified glistp to get the RCP into the correct mode for sprite rendering. This sets default texturing modes.

  • spFinish is called at the end of sprite drawing. Some GBI display list commands are added to the specified glistp to get the RCP to complete all pending drawing operations and reset the RCP to its regular state. It also tacks on a gEndDisplayList.

  • spMove sets the screen position of the upper-left corner of the sprite.

  • spScale sets the resizing amount for this sprite. Scales may be less than 1.0 to produce a smaller image or greater than 1.0 to create an expanded image.

  • spFlip controls the orientation of the sprite. This is not currently available.

  • spSetZ sets the Z-Buffer depth of the sprite. This may cause the sprite to be obscured by previously drawn sprites that were drawn with a smaller value of Z.

  • spColor sets the color of the sprite. Based on how the sprite is to be drawn, this could be either PRIMITIVE_COLOR or FILL_COLOR.

  • spSetAttribute sets the indicated attributes (a bit-wise OR of many attributes).

  • spClearAttribute clears the indicated attributes (a bit-wise OR of many attributes).

  • spScissor bounds the region in which sprites will be drawn. Tiles of sprites that lie entirely outside this region are not added to the output display list. Tiles that cross the boundary are appropriately clipped.

  • spDraw constructs a display list starting at sp->next_dl that will draw the sprite into the frame buffer in the indicated way. This display list is terminated with a gEndDispalyList entry and the sp->next_dl entry is updated to point to one entry past this. The pointer to the start of this display list is returned.
See Also
mksprite





Nintendo® Confidential


Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.

Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998