/*===========================================================================
 *
 * File:	Dfcommon.H
 * Author:	Dave Humphrey (uesp@m0use.net)
 * Created On:	Monday, June 25, 2001
 *
 * Description
 *
 *=========================================================================*/
#ifndef __DFCOMMON_H
#define __DFCOMMON_H

/*===========================================================================
 *
 * Begin Required Include Files
 *
 *=========================================================================*/
  #include "common/dl_err.h"
/*===========================================================================
 *		End of Required Include Files
 *=========================================================================*/


/*===========================================================================
 *
 * Begin Defines
 *
 *=========================================================================*/

	/* Number of defined Daggerfall regions */
  #define DF_MAX_REGIONS 62

	/* Coordinate conversion factors */
  #define DF_COOR_BLOCKTO3D (256l)

	/* Common daggerfall specific error codes */
  #define DFERR_BSA_DIRTYPE	  1001
  #define DFERR_BSA_NOTFOUND	  1002
  #define DFERR_BSA_READONLY	  1003
  #define DFERR_BSA_NUMFILES      1004
  #define DFERR_3D_READPASTEND    1101
  #define DFERR_3D_READPASTSTART  1102
  #define DFERR_3D_DATA2SUBRECORD 1103
  #define DFERR_3D_BADVERSION     1104
  #define DFERR_3D_BADHEADER      1105
  #define DFERR_3D_BADPOINTS      1106
  #define DFERR_3D_BADFACES       1107
  #define DFERR_3D_BADNORMALS     1108
  #define DFERR_3D_BADDATA1       1109
  #define DFERR_3D_BADDATA2       1110
  #define DFERR_IMG_READFILE	  1201
  #define DFERR_IMG_IMAGESIZE	  1202
  #define DFERR_CIF_MAXIMAGES     1251
  #define DFERR_COL_NUMENTRIES    1301
  #define DFERR_TEXTURE_SUBIMAGES 1401
  #define DFERR_TEXTURE_IMAGESIZE 1402
  #define DFERR_TEXTURE_BADHEIGHT 1403
  #define DFERR_TEXTURE_NUMIMAGES 1404
  #define DFERR_TEXTURE_BADINDEX  1405
  #define DFERR_RMB_RECORDSIZE    1501
  #define DFERR_RMB_CHARINDEX     1502
  #define DFERR_BLOCKS_RMBINDEX   1551
  #define DFERR_BLOCKS_NOTRMB	  1552
  #define DFERR_BLOCKS_NOTRDI	  1553
  #define DFERR_BLOCKS_NOTRDB	  1554
   

/*===========================================================================
 *		End of Defines
 *=========================================================================*/


/*===========================================================================
 *
 * Begin Function Definitions
 *
 *=========================================================================*/

	/* Return a valid region name string */
  char* GetDFRegionName (const int Index);

	/* Attempt to open a DF file */
  FILE* DFOpenFile (const char* pFilename, const char* pMode = "rb");

	/* Store the Arena2 path for later use */
  const char* GetDFArena2Path (void);
  void	      SetDFArena2Path (const char* pPath);

/*===========================================================================
 *		End of Function Definitions
 *=========================================================================*/


/*===========================================================================
 *
 * Begin External Variables
 *
 *=========================================================================*/

/*===========================================================================
 *		End of External Variables
 *=========================================================================*/


#endif
/*===========================================================================
 *		End of File DFCommon.H
 *=========================================================================*/