///////////////////////////////////////////////////////////////////////////////
/// @file map2dworld.hpp
///
/// @brief Loader for Quake-style MAP files
///
/// @author Assassin
///
/// This file is the intellectual property of Novus Delta, LLC.. Usage of the
/// contents of this file is subject to the Destiny3D Member License which
/// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
///
/// This file is distributed "AS IS" without warranty of any kind.  Novus
/// Delta, LLC. does not guarantee the fitness of the contents of this file
/// for any particular purpose.
///
/// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
///
/// <hr>
///                                 Change History
/// <hr>
///
/// @date Dec 2003
/// @author Assassin
/// @remarks Shifted into external CLI tool
///
///////////////////////////////////////////////////////////////////////////////

#ifndef MAP2DWORLD_HPP
#define MAP2DWORLD_HPP

#include "deMapLoader.hpp"

class IdeSceneABT;

namespace deMapConverter
{
	struct ClippedBrush_t
	{
		deTArray<Face_t*>	mFaces;
		deAABB				BBox;
	};
	
	// extern
	Entity_t* FindEntityNamed(FullData_t * pData, const deString2& name);
	deString2 GetEntityData(Entity_t* pEntity, deString2 name);
	void WeldVertices(deTArray<ClippedBrush_t>& clippedBrushes);
	void CopyBrush(ClippedBrush_t& target, const Brush_t& source);
	void ClipBrush(ClippedBrush_t& clipBrush, const Brush_t& planeBrush, bool bClipOnPlane);
	void LoadMAP(const char* filename, deDouble Scale, IdeRenderTexture * DefaultTex, 
		bool doUnion, bool doWeld, FullData_t& outData);
}


#endif // MAP2DWORLD_HPP