/*
*     ___                       ___
*    / _ \___ _    _____ ____  / _ \_______ __    __
*   / ___/ _ \ |/|/ / -_) __/ / // / __/ _ `/ |/|/ /
*  /_/   \___/__,__/\__/_/   /____/_/  \_,_/|__,__/
*
*
*   Original Code by John Garrison
*   Written June 18-23, August 5, 1999
*   To be released under the LGPL
*
*   Drawing of sprites.
*
*   See LICENSE.TXT for more LGPL info
*/
#ifndef _PD_sprites_H
#define _PD_sprites_H

#ifdef __cplusplus
extern "C" {
#endif

#include "powerdraw.h"

#define PD_MAXFRAMES 10
#define CURRENT PD_MAXFRAMES+5 //Just needs to be more than PD_MAXFRAMES
#define ISTRUE 0
#define ISFALSE 1

typedef struct _PD_Sprite{
   Sint32 x, y;
   Uint32 width, height;
   int counter;
   PD_Surface **frame;
   int num_frames;
   int curr_frame;
   Uint32 clear_color;
   int state;
   int visible;
   Uint8 alpha;
}PD_Sprite;

PD_Sprite *PD_SpriteInit (int NumFrames, int Width, int Height);
int PD_GetSpriteFrame (PD_Sprite *Sprite, const char *File, int FrameNumber);
int PD_DrawSprite (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance);
int PD_DrawSpriteVFlipped (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance);
int PD_DrawSpriteHFlipped (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance);
int PD_DrawSpriteVHFlipped (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance);
int PD_DestroySprite (PD_Sprite *Sprite);
int PD_DrawSpriteRotated (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, int Angle);
int PD_DrawSpriteRotatedAround (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, int OX, int OY, int Angle);
int PD_DrawSpriteXSheared (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, int XShear);
int PD_DrawSpriteYSheared (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, int YShear);
int PD_DrawSpriteScaled (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, long Width, long Height);
int PD_DrawSpriteScaledBy (PD_Sprite *Sprite, PD_Surface *Surface, int StartFrame, int FrameAdvance, float XFactor, float YFactor);

#ifdef __cplusplus
};
#endif

#endif
