//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_OptionsFile.cpp
//
// Copyright (c) 2007 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

/******************************************************************************/
/* Included Files                                                             */
/******************************************************************************/

#include "Core/Asura.h"

#include "Load&Save/ToolsAVP_OptionsFile.h"

// AVP Tools
#include "ToolsAVP_System.h"

// Misc
#include <stdio.h>

/******************************************************************************/
/* ToolsAVP_OptionsFile Class Functions                                       */
/******************************************************************************/

void ToolsAVP_OptionsFile::LoadProjectSpecificOptions( const char* pcBuffer )
{
	#define BOOL_READ( string, var ) GetBoolFromIniFileBuffer( string, pcBuffer, var )
	#define INT_READ( string, var ) GetIntFromIniFileBuffer( string, pcBuffer, var )
	#define FLOAT_READ( string, var ) GetFloatFromIniFileBuffer( string, pcBuffer, var )

	int iTemp = 0;
	INT_READ( "Curr Vision Mode", iTemp );

	ToolsAVP_System::SetCamera(iTemp);
}

void ToolsAVP_OptionsFile::SaveProjectSpecificOptions( FILE* pxFile )
{
	#define BOOL_WRITE( string, var ) fprintf( pxFile, "%s = %s\n", string, var ? "Yes" : "No" )
	#define INT_WRITE( string, var ) fprintf( pxFile, "%s = %d\n", string, var )
	#define FLOAT_WRITE( string, var ) fprintf( pxFile, "%s = %f\n", string, var )

	fprintf( pxFile, "\n##AVP3 settings##\n" );
	INT_WRITE( "Curr Vision Mode", ToolsAVP_System::s_uCurrVisionMode );
}
