/****************************************************************************
*
* GENDRAW.H
*
* PROGRAMMER : Chris
*    VERSION : 00.00
*    CREATED : 05/06/98
*   MODIFIED : 05/06/98
*       TABS : 5
*
* DESCRIPTION
*	Header file for GENDRAW.C
*
*****************************************************************************/

#ifndef _GENDRAW_H
#define _GENDRAW_H

/*---------------------------------------------------------------------------
 *	Import Headers
\*--------------------------------------------------------------------------*/

#include "typedefs.h"
#include "..\game\items.h"

/*---------------------------------------------------------------------------
 *	Constants
\*--------------------------------------------------------------------------*/

#define AMMO_X	256
#define AMMO_Y	128

#define HEALTHBAR_X	(phd_scrwidth-36-HEALTHBAR_W)
#define HEALTHBAR_Y	18
#define HEALTHBAR_W	133

#define AIRBAR_X	(phd_scrwidth-36-AIRBAR_W)
#define AIRBAR_Y	32
#define AIRBAR_W 	133

#define DASHBAR_X	(phd_scrwidth-36-DASHBAR_W)
#define DASHBAR_Y	46
#define DASHBAR_W	133

#define COLDBAR_X	(phd_scrwidth-36-COLDBAR_W)
#define COLDBAR_Y	60
#define COLDBAR_W	133

/*---------------------------------------------------------------------------
 *	Type Definitions
\*--------------------------------------------------------------------------*/

typedef struct	{
	uint8 abLeftRed[5];
	uint8 abLeftGreen[5];
	uint8 abLeftBlue[5];
	uint8 abRightRed[5];
	uint8 abRightGreen[5];
	uint8 abRightBlue[5];
}GouraudBarColourSet;

#ifndef _SG_COL
#define _SG_COL
typedef uint32 SG_COL;
#endif

/*---------------------------------------------------------------------------
 *	Macros
\*--------------------------------------------------------------------------*/

#define S_DrawHealthBar(n) S_DrawGouraudBar(HEALTHBAR_X, HEALTHBAR_Y, HEALTHBAR_W, (n*HEALTHBAR_W)/100, (PoisonFlag) ? &poisonBarColourSet : &healthBarColourSet)
#define S_DrawAirBar(n) S_DrawGouraudBar(AIRBAR_X, AIRBAR_Y, AIRBAR_W, (n*HEALTHBAR_W)/100, &airBarColourSet)
#define S_DrawDashBar(n) S_DrawGouraudBar(DASHBAR_X, DASHBAR_Y, DASHBAR_W, (n*DASHBAR_W)/100, &dashBarColourSet)
#define S_DrawColdBar(n) S_DrawGouraudBar(COLDBAR_X, COLDBAR_Y, COLDBAR_W, (n*DASHBAR_W)/100, &coldBarColourSet)

#define S_DrawScreenSprite2d S_DrawScreenSprite

/*---------------------------------------------------------------------------
 *	Prototypes
\*--------------------------------------------------------------------------*/

extern GouraudBarColourSet healthBarColourSet;
extern GouraudBarColourSet poisonBarColourSet;
extern GouraudBarColourSet airBarColourSet;
extern GouraudBarColourSet dashBarColourSet;
extern GouraudBarColourSet coldBarColourSet;

#ifdef LOAD_KANJI
extern void S_DrawKanji(sint32 x, sint32 y, sint32 z, sint32 scaleH, sint32 scaleV, sint16 sprnum, sint16 shade, uint16 flags);
extern void S_DrawKanjiPage(sint32 x, sint32 y, sint32 z, sint32 scaleH, sint32 scaleV, sint16 sprnum, sint16 shade, uint16 flags);
#endif

extern void S_DrawScreenSprite(sint32 x, sint32 y, sint32 z, sint32 scaleH, sint32 scaleV, sint16 sprnum, sint16 shade, uint16 flags);
extern void S_DrawPickup(sint16 x, sint16 y, sint16 object_num);
//extern void S_DrawPickup(sint32 x, sint32 y, sint32 scale, sint16 sprnum, sint16 shade, uint16 flags);
extern void S_DrawScreenBox( sint32 sx, sint32 sy, sint32 z, sint32	w, sint32 h, sint32 col, SG_COL *grdptr, uint16 flags);
extern void S_DrawScreenFBox(sint32 sx, sint32 sy, sint32 z, sint32 w, sint32 h, sint32 col, SG_COL *grdptr, uint16 flags);
extern void S_DrawScreenLine(sint32 sx, sint32 sy, sint32 z, sint32 w, sint32 h, sint32 col, SG_COL *grdptr, uint16 flags);
extern void S_DrawFlatBox(sint32 sx, sint32 sy, sint32 z, sint32 w, sint32 h, SG_COL *grdptr );
extern void S_DrawGouraudBar(short nXPos,short nYPos,short nWidth,short nBarWidth, GouraudBarColourSet* pColourSet);
extern void S_DrawLine(sint32 x1, sint32 y1, sint32 z, sint32 x2, sint32 y2, sint32 col, SG_COL *grdptr, uint16 flags);
extern void S_DrawSprite(uint32 dwFlags, sint32 nX, sint32 nY, sint32 nZ, sint16 nSprite, sint16 nShade, sint16 nScale);
extern void S_PrintShadow(sint16 size, sint16 *bptr, ITEM_INFO *iptr, int underwater);
extern void S_InsertBackPolygon(sint32 min_x, sint32 min_y, sint32 max_x, sint32 max_y, uint32 col);

#endif
