/* ** File : sprite.h ** Author: D Smethurst ** Desc. : prototypes for the functions in the source files ** Version: 0.1 **/ #ifndef __SPRITE_H__ #define __SPRITE_H__ /* ** Alter this if you want each sprite to have ** more frames. */ #define MAX_FRAMES 10 /* ** Forward reference */ struct Sprite; /* ** Currently unused in this version */ typedef VPSP (void (void * s)); /* ** Use my own boolean type */ typedef short BOOL; #define u_long unsigned long #define FALSE 0 #define TRUE 1 /* ** Error defines - assume this will grow ! */ #define NO_ERROR -1 #define SPR_TOO_MANY_FRAMES 0 #define SPR_NO_MEM 1 extern int mystrerror; extern char *errors[]; /* ** My own sprite structure. */ typedef struct Sprite { short x,y; /* sprite position */ short w,h; /* sprite w/h */ short dx, dy; /* Movement in direction x & y - added for v0.2*/ GsSPRITE spr; /* Actual psx sprite */ u_long curframe; /* Current frame to display */ u_long frames[MAX_FRAMES]; /* List of frames */ int n; /* Number of frames to this sprite */ short uTicks; /* Number of ticks between updates */ VPSP *update; /* Update function for this sprite - unused atm */ } Sprite, * lpSprite; /* ** Spritelist structure */ typedef struct spritelist { lpSprite s; /* Sprite in this entry */ short tick; /* tick the list entry is on */ struct spritelist *next; /* Next entry */ struct spritelist *prev; /* Last entry */ } spritelist, * lpspritelist; /* Implemented */ /* Sprite.c */ lpSprite SprCreate( u_long addr ); lpSprite SprCreateN( u_long *addrs, int n ); BOOL SprChangeFrame( lpSprite s, int n ); void SprAttachCallBack( lpSprite spr, VPSP cback, short nTicks ); /** Internal call to sprite.c **/ /* Don't use - Dave */ void InitSprite( lpSprite s ); /* SprLst.c */ BOOL SprLstRemove( lpSprite s, lpspritelist l ); lpspritelist SprLstAdd( lpSprite s, lpspritelist l ); lpSprite SprLstCollision( lpSprite s, lpspritelist l ); void SprLstDraw( lpspritelist l, GsOT dtoOT ); void SprLstUpdate( lpspritelist l ); void SpritePrintError( void ); #endif /* __SPRITE_H__ */