//**************************************************************************
//**
//**	##   ##    ##    ##   ##   ####     ####   ###     ###
//**	##   ##  ##  ##  ##   ##  ##  ##   ##  ##  ####   ####
//**	 ## ##  ##    ##  ## ##  ##    ## ##    ## ## ## ## ##
//**	 ## ##  ########  ## ##  ##    ## ##    ## ##  ###  ##
//**	  ###   ##    ##   ###    ##  ##   ##  ##  ##       ##
//**	   #    ##    ##    #      ####     ####   ##       ##
//**
//**	$Id: wad.h,v 1.7 2004/11/23 12:43:11 dj_jl Exp $
//**
//**	Copyright (C) 1999-2002 JÆnis Legzdi·ý
//**
//**	This program is free software; you can redistribute it and/or
//**  modify it under the terms of the GNU General Public License
//**  as published by the Free Software Foundation; either version 2
//**  of the License, or (at your option) any later version.
//**
//**	This program is distributed in the hope that it will be useful,
//**  but WITHOUT ANY WARRANTY; without even the implied warranty of
//**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//**  GNU General Public License for more details.
//**
//**************************************************************************
//**
//**	WAD I/O functions.
//**
//**************************************************************************

// HEADER FILES ------------------------------------------------------------

// MACROS ------------------------------------------------------------------

// TYPES -------------------------------------------------------------------

//	Boom namespaces.
enum EWadNamespace
{
	WADNS_Global,
	WADNS_Sprites,
	WADNS_Flats,
	WADNS_ColorMaps,
	WADNS_ACSLibrary,
	WADNS_NewTextures,
	WADNS_Voices,
};

// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------

void W_InitMultipleFiles(const char** filenames);
void W_InitFile(const char* filename);

void W_OpenAuxiliary(const char *filename);
void W_CloseAuxiliaryFile(void);
void W_CloseAuxiliary(void);

void W_BuildGLNodes(int lump);
void W_BuildPVS(int lump, int gllump);

int	W_CheckNumForName(const char* name, EWadNamespace NS = WADNS_Global);
int	W_GetNumForName(const char* name, EWadNamespace NS = WADNS_Global);

int	W_LumpLength(int lump);
const char *W_LumpName(int lump);

void W_ReadLump(int lump, void *dest);
void* W_CacheLumpNum(int lump, int tag);
void* W_CacheLumpName(const char* name, int tag,
	EWadNamespace NS = WADNS_Global);
FArchive* W_CreateLumpReader(const char* name, int tag = 0,
	EWadNamespace NS = WADNS_Global);

bool W_ForEachLump(bool (*func)(int, const char*, int, EWadNamespace));

void W_CleanupName(const char *src, char *dst);

// PUBLIC DATA DECLARATIONS ------------------------------------------------

//**************************************************************************
//
//	$Log: wad.h,v $
//	Revision 1.7  2004/11/23 12:43:11  dj_jl
//	Wad file lump namespaces.
//	
//	Revision 1.6  2002/05/18 16:56:35  dj_jl
//	Added FArchive and FOutputDevice classes.
//	
//	Revision 1.5  2002/01/07 12:16:43  dj_jl
//	Changed copyright year
//	
//	Revision 1.4  2001/09/14 16:52:14  dj_jl
//	Added dynamic build of GWA file
//	
//	Revision 1.3  2001/07/31 17:16:31  dj_jl
//	Just moved Log to the end of file
//	
//	Revision 1.2  2001/07/27 14:27:54  dj_jl
//	Update with Id-s and Log-s, some fixes
//
//**************************************************************************
