//********************************************************************
// This source file is part of Ninfa3D Engine
// 
// Copyright (C) 2008-2009 Viz_fuerte.
// All rights reserved.
// 
// LIMITED WARRANTY
// This software is provided "as-is", without any express or implied warranty.
// In no event shall the author be held liable for any damages arising from the use of this software.
// This is a contract. By accepting the Ninfa3D Engine (the SOFTWARE), 
// you (either an individual or a single entity, the LICENSEE) accept the terms and conditions of this licensing agreement.
// 
// If the LICENSEE does not accept the terms and conditions, then LICENSEE must not accept the SOFTWARE.
// If at a later time the LICENSEE decides not to continue licensing the SOFTWARE under these terms and 
// conditions, then the LICENSEE must delete permanently all files constituting the SOFTWARE.
//
// File: File.cpp
//********************************************************************

/*--------------------------------------------------------------------
Includos*/

	#include "..\..\Header Files\Ninfa3D.h"

/*--------------------------------------------------------------------
Variables externas*/

	extern IrrlichtDevice* device;
	extern IVideoDriver* driver;
	extern ISceneManager* SceneManager;
	extern IGUIEnvironment* guienv;
	extern IGPUProgrammingServices* gpu;
	extern IFileSystem* filesy;

/*--------------------------------------------------------------------
Declaration global de funciones*/

extern "C"
{

	/*====================================================================
	Cambia el directorio*/

	DLL_EXPORT void DLL_APIENTRY ChangeDirectory(const char* directory)
	{
		filesy->changeWorkingDirectoryTo(directory);
	}

	/*====================================================================
	Devuelve TRUE si el archivo existe*/

	DLL_EXPORT bool DLL_APIENTRY ExistFile(const char* file)
	{
		return filesy->existFile(file);
	}

	/*====================================================================
	Devuelve TRUE si el archivo existe*/

	DLL_EXPORT void DLL_APIENTRY LoadZip(const char* file)
	{
		filesy->addZipFileArchive(file);
	}
	
	/* ----------------------------------------------------------------------------
	load a scene created with irrEdit
	*/
	DLL_EXPORT void DLL_APIENTRY nLoadScene( const char* filename )
	{
  	  SceneManager->loadScene(filename);
	}


	/* ----------------------------------------------------------------------------
	save the current scene out to a file that is compatible with irrEdit
	*/
	DLL_EXPORT void DLL_APIENTRY nSaveScene( const char* filename )
	{
    	SceneManager->saveScene(filename);
	}




}