//===========================================================================//
// File: ExportUntil.h
// Project: MechWarrior 4
// Contents: helper function for exporters
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/10/00 fwang Initial coding, 
//---------------------------------------------------------------------------//
// Copyright (C) 1998, Fasa Interactive, Inc.
// All Rights reserved worldwide
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL
//===========================================================================//

#if !defined(_EXPORTUTIL__INCLUDED_)
#define _EXPORTUTIL__INCLUDED_

#include "stdafx.h"

#ifdef STRICT // Already defined by stdafx,
#undef STRICT // so we avoid warning linking msg
#endif
#ifdef _MBCS // The same as above
#undef _MBCS
#endif

#include <Stuff\StuffHeaders.hpp>
#include <ElementProxies\ElementProxies.hpp>
#include "MaxProxies\MaxProxyHeaders.hpp"
#include "Proxies\ProxyHeaders.hpp"
#include <proxies\optimizeflatshading.hpp>

void ClearDirectory(CString dir);
ElementProxies::ElementSceneProxy *InitElementScene(CString texturepath);
int DestroyElementScene(ElementProxies::ElementSceneProxy *element_scene);
MAXProxies::MAXScene *MakeMaxScene(Interface *i,CString strHintFile);
int CopyPolygonMeshProxyToElement(
	ElementProxies::ElementSceneProxy *element_scene,
	MAXProxies::MAXPolygonMesh *max_mesh,bool bFlatShading, 
	Interface *ip,int& progress,bool suppress);
int CopyGroupProxyToElement(
	ElementProxies::ElementSceneProxy *element_scene,
	MAXProxies::MAXGroup *max_proxy,bool bFlatShading, 
	Interface *ip,int& progress,bool suppress);
int CopySceneMaxToElement(
	ElementProxies::ElementSceneProxy *element_scene,
	MAXProxies::MAXScene *max_scene,bool bFlatShading, 
	Interface *ip,int& progress,bool suppress);
int FusePolygonMeshProxy(
	ElementProxies::ElementPolygonMeshProxy *mesh, int child_count,
	Interface *ip,int& progress,bool suppress);
int FuseElementScene(
	ElementProxies::ElementSceneProxy *element_scene,
	Interface *ip,int& progress,bool suppress);
int OptimizeElementScene(ElementProxies::ElementSceneProxy *element_scene);
int SetExplicitFogMode(ElementProxies::ElementSceneProxy *element_scene, int newFogMode);
int SetExplicitLightingMode(ElementProxies::ElementSceneProxy *element_scene, MidLevelRenderer::MLRState::LightingMode newLightingMode);
int SetExplicitAlphaMode(ElementProxies::ElementSceneProxy *element_scene, MidLevelRenderer::MLRState::AlphaMode newAlphaMode);
int SaveElementScene(ElementProxies::ElementSceneProxy *element_scene,CString filename);
int SaveElementShape(ElementRenderer::Element *element_shape,CString filename);
int GetMeshMatrices(Proxies::GenericProxy *proxy,CMapStringToPtr *pTransInfo);
bool IsNodeCamera(INode *node);
bool IsNodeGeometry(INode *node);
bool IsNodePartOfGroupGeometry(INode *node);
INode *FindNodeByName(INode *nde,CString &str);
INode *FindNodeByNames(INode *nde,CString strs[]);
CString GetGamePath(Interface *ip);
INode *GetLightNode(INode *node);
int ReportError(const char *,bool bSuppress=false);

#endif
