#ifndef	MIP_H
#define	MIP_H
/*
 * ============================================================================
 * structures
 * ============================================================================
 */
struct mipheader {
  int numtex;
  int offset[0];
};

#define NAMELEN_MIP 16
struct mipmap {
  char name[16];
  int width, height;
  int mip0, mip1, mip2, mip3;
};

#define ANIM_MIPMAP	'+'
#define WARP_MIPMAP	'*'
#define WARP_X		64
#define WARP_Y		64
#define SKY_MIPMAP	"sky"
#define SKY_X		256
#define SKY_Y		128

#define NAMELEN_WAL 32
struct wal {
  char name[32];
  int width, height;
  int mip0, mip1, mip2, mip3;
  char animname[32];
  int flags, contents, value;
};

#define	MIP_MULT(x)	((x)+(x/(2*2))+(x/(4*4))+(x/(8*8)))

/*
 * ============================================================================
 * globals
 * ============================================================================
 */

/*
 * ============================================================================
 * prototypes
 * ============================================================================
 */

struct palpic *GetMipMap(FILE *file, unsigned char MipLevel);
struct palpic *ParseMipMap(struct mipmap *MipMap, unsigned char MipLevel);
bool PutMipMap(FILE *file, struct palpic *Picture);
bool PutMipMap0(FILE *file, struct palpic *Picture);
bool PasteMipMap(struct mipmap *MipMap, struct palpic *Picture);
bool PasteMipMap0(struct mipmap *MipMap, struct palpic *Picture);
#endif
