///////////////////////////////////////////////////////////////////////////////
/// @file AssembleMain.cpp
///
/// @brief Destiny3D Shader [Dis]Assembler main program
///
/// @author JesusFreak
///
/// 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 May 2002
/// @author JesusFreak
/// @remarks Creation
///
/// @date May 2003
/// @author Assassin
/// @remarks re-named from Main.cpp to AssembleMain.cpp
///
///////////////////////////////////////////////////////////////////////////////

// Include the headers we need
#include <iostream>
#include "deString.hpp"

// Define our version number
#define DE_SHADERASM_VERSION .1

deBoolean Assemble(int ArgCount,char * Arguments[]); // In Assembler.cpp
deBoolean Disassemble(int ArgCount,char * Arguments[]); // In Disassembler.cpp

int main(int ArgCount,char * Arguments[])
{
	// Print the program's name and version info
	cout << "Destiny 3D Shader Assembler and Disassembler " << DE_SHADERASM_VERSION << "\n";

	// Check to see if we were passed in enough arguments
	if(ArgCount >= 4)
	{
		// Run the assembler
		if(strcmp(Arguments[1],"-a") == 0)
		{
			return Assemble(ArgCount,Arguments);
		}
		// Run the disassembler
		else if(strcmp(Arguments[1],"-d") == 0)
		{
			return Disassemble(ArgCount,Arguments);
		}
	}

	// We shouldn't of got this far so print out instructions on how to use the program
	cout << "Usage: deShaderAsm [Mode Flag] [InputFileName] [OutputFileName]\n"
		 << "Valid mode Flags are:\n" << "-a	Assembles the Input file\n"
		 << "-d	Disassembles the Input file\n"
		 << "NOTE: All three parameters must be specified in the order shown.\n";
	return 1;
}