// **************************************************************************
// **************************************************************************
// **************************************************************************
// **                                                                      **
// ** XVTPXL.H                                                     PROGRAM **
// **                                                                      **
// ** Simple module for graphics file handling.                            **
// **                                                                      **
// ** Last modified : 05 Nov 1997 by John Brandwood                        **
// **                                                                      **
// **************************************************************************
// **************************************************************************
// **************************************************************************

#ifndef __XVTPXL_h
#define __XVTPXL_h

#ifndef __LFPTYPES_h
 #include "lfptypes.h"
#endif

//
// GLOBAL DATA STRUCTURES AND DEFINITIONS
//

// IMG image structure.

typedef	struct IMG_RGB_S
	{
	UB                  ub___r;
	UB                  ub___g;
	UB                  ub___b;
	UB                  ub___a;
	} IMG_RGB_T;

typedef	struct IMG_PAL_S
	{
	IMG_RGB_T           acl__rgb[256];
	} IMG_PAL_T;

typedef	struct IMG_HDR_S
	{
	struct IMG_HDR_S *  pcl__h;
	unsigned char *     pub__i;
	IMG_PAL_T *         pcl__p;
	int                 si___w;
	int                 si___h;
	int                 si___b;
	int                 si___n;
	} IMG_HDR_T;

typedef	struct IMG_BOX_S
	{
	IMG_HDR_T *         pcl__h;
	int                 si___x;
	int                 si___y;
	int                 si___w;
	int                 si___h;
	} IMG_BOX_T;

//
// GLOBAL VARIABLES
//

//
// GLOBAL FUNCTION PROTOTYPES
//

extern	IMG_HDR_T *         AllocImg                (
								int                 si___w,
								int                 si___h,
								int                 si___b);

extern	SI                  FindImgCols             (
								IMG_HDR_T *         pcl__Img,
								SI *                psi__RowY,
								SI *                psi__RowH);

extern	SI                  FindImgRows             (
								IMG_HDR_T *         pcl__Img,
								SI *                psi__RowY,
								SI *                psi__RowH);

extern	void                FindImgEdge             (
								IMG_BOX_T *         pcl__Box);

extern	UB *                GrabSprite              (
								IMG_BOX_T *         pcl__Src,
								UB *                pub__Dst);

extern	UB *                GrabSpriteBtmToTop      (
								IMG_BOX_T *         pcl__Src,
								UB *                pub__Dst);

extern	IMG_HDR_T *         LoadPcx                 (
								char *              name);

extern	int                 SavePcx                 (
								char *              name,
								IMG_HDR_T *         imghdr);



//
// End of __XVTPXL_h
//

#endif



// **************************************************************************
// **************************************************************************
// **************************************************************************
//	END OF XVTPXL.H
// **************************************************************************
// **************************************************************************
// **************************************************************************