#ifndef INC_SPRITE
#define INC_SPRITE
typedef struct sprite_data SPRITE;
struct sprite_data
{
SPRITE * next;
SPRITE * prev;
BMP * bitmap;
POINT position;
POINT oldpos;
POINT velocity;
RECT bounds;
RECT collision;
bitmask_t *bitmask;
char *name;
bool hidden; bool drag; bool gravity; bool proto; int z;
int action; int direction; int type; int width;
int height;
int frames;
int current_frame;
int delay;
int trigger;
};
typedef enum
{
S_NONE, PLAYER, ENEMY, BOSS, PROJECTILE, P_PROJECTILE
} sprite_types;
typedef enum
{
STOP, WRAP, BOUNCE, DIE
} action;
typedef enum
{
rKILL, rNONE
} resulting_actions;
SPRITE *sprite_from_bitmap( BMP *bitmap, int frames, int delay, char *name );
SPRITE *sprite_from_initial( BMP *bitmap, POINT position, POINT velocity,
int z, RECT bounds, int action, int width, int height, char *name, int type );
SPRITE *is_point_in_sprite( int x, int y );
bool SpriteCollision(SPRITE *hitter, SPRITE *hittee);
bool CheckSpriteCollision(SPRITE *sprite);
bool TestCollision( SPRITE *sprite1, SPRITE *sprite2 );
int update_sprite( SPRITE *sprite );
void CalcCollisionRect( SPRITE *sprite );
void draw_sprite(SPRITE *sprite, HDC hDC);
void DrawSprites( SPRITE *sprite, HDC hDC );
void DrawFrame( SPRITE *sprite, HDC hDC );
void update_frame( SPRITE *sprite );
void link_by_zorder( SPRITE *sprite );
void CleanSprites( void );
void UpdateSprites( void );
void SetVelocity( SPRITE *sprite, int x, int y );
void SetPosition( SPRITE *sprite, POINT position );
#endif